cozy-client 33.0.6 → 33.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1398,54 +1398,63 @@ var CozyClient = /*#__PURE__*/function () {
1398
1398
  mergedOptions = _objectSpread(_objectSpread({}, options), {}, {
1399
1399
  as: queryId
1400
1400
  });
1401
- _context9.next = 5;
1401
+ _context9.prev = 3;
1402
+ _context9.next = 6;
1402
1403
  return this.query(queryDefinition, mergedOptions);
1403
1404
 
1404
- case 5:
1405
+ case 6:
1405
1406
  resp = _context9.sent;
1406
1407
  documents = resp.data;
1407
1408
 
1408
- case 7:
1409
+ case 8:
1409
1410
  if (!(resp && resp.next)) {
1410
- _context9.next = 21;
1411
+ _context9.next = 22;
1411
1412
  break;
1412
1413
  }
1413
1414
 
1414
1415
  if (!resp.bookmark) {
1415
- _context9.next = 14;
1416
+ _context9.next = 15;
1416
1417
  break;
1417
1418
  }
1418
1419
 
1419
- _context9.next = 11;
1420
+ _context9.next = 12;
1420
1421
  return this.query(queryDefinition.offsetBookmark(resp.bookmark), mergedOptions);
1421
1422
 
1422
- case 11:
1423
+ case 12:
1423
1424
  resp = _context9.sent;
1424
- _context9.next = 18;
1425
+ _context9.next = 19;
1425
1426
  break;
1426
1427
 
1427
- case 14:
1428
+ case 15:
1428
1429
  currentResult = (0, _store.getRawQueryFromState)(this.store.getState(), queryId);
1429
- _context9.next = 17;
1430
+ _context9.next = 18;
1430
1431
  return this.query(queryDefinition.offset(currentResult.data.length), mergedOptions);
1431
1432
 
1432
- case 17:
1433
+ case 18:
1433
1434
  resp = _context9.sent;
1434
1435
 
1435
- case 18:
1436
+ case 19:
1436
1437
  documents.push.apply(documents, (0, _toConsumableArray2.default)(resp.data));
1437
- _context9.next = 7;
1438
+ _context9.next = 8;
1438
1439
  break;
1439
1440
 
1440
- case 21:
1441
+ case 22:
1441
1442
  return _context9.abrupt("return", documents);
1442
1443
 
1443
- case 22:
1444
+ case 25:
1445
+ _context9.prev = 25;
1446
+ _context9.t0 = _context9["catch"](3);
1447
+
1448
+ _logger.default.log("queryAll error for ".concat(_context9.t0.toString()));
1449
+
1450
+ return _context9.abrupt("return", []);
1451
+
1452
+ case 29:
1444
1453
  case "end":
1445
1454
  return _context9.stop();
1446
1455
  }
1447
1456
  }
1448
- }, _callee9, this);
1457
+ }, _callee9, this, [[3, 25]]);
1449
1458
  }));
1450
1459
 
1451
1460
  function queryAll(_x10) {
@@ -2636,7 +2645,7 @@ var CozyClient = /*#__PURE__*/function () {
2636
2645
  CozyClient.hooks = CozyClient.hooks || {};
2637
2646
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2638
2647
 
2639
- CozyClient.version = "33.0.6";
2648
+ CozyClient.version = "33.0.8";
2640
2649
 
2641
2650
  _microee.default.mixin(CozyClient);
2642
2651
 
@@ -1619,6 +1619,12 @@ describe('CozyClient', () => {
1619
1619
  expect(getRawQueryFromState).not.toHaveBeenCalled()
1620
1620
  expect(documents).toMatchSnapshot()
1621
1621
  })
1622
+ it('should not throw error if there is an error', async () => {
1623
+ const error = new Error('Fake error')
1624
+ jest.spyOn(client, 'query').mockRejectedValue(error)
1625
+
1626
+ await expect(client.queryAll(query)).resolves.not.toThrowError()
1627
+ })
1622
1628
  })
1623
1629
 
1624
1630
  describe('mutate', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "33.0.6",
3
+ "version": "33.0.8",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "@types/jest": "^26.0.20",
19
19
  "@types/lodash": "^4.14.170",
20
20
  "btoa": "^1.2.1",
21
- "cozy-stack-client": "^33.0.6",
21
+ "cozy-stack-client": "^33.0.8",
22
22
  "json-stable-stringify": "^1.0.1",
23
23
  "lodash": "^4.17.13",
24
24
  "microee": "^0.0.6",
@@ -73,5 +73,5 @@
73
73
  "react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
74
74
  },
75
75
  "sideEffects": false,
76
- "gitHead": "de2122ed2d54e23eec5d8ef224387a43d4ba9112"
76
+ "gitHead": "9662549227f701f77ae53d647b0b97e24dc94206"
77
77
  }