@aws-amplify/datastore 3.12.1-unstable.7 → 3.12.2-unstable.3
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.
- package/CHANGELOG.md +16 -0
- package/dist/aws-amplify-datastore.js +32 -33
- package/dist/aws-amplify-datastore.js.map +1 -1
- package/dist/aws-amplify-datastore.min.js +2 -2
- package/dist/aws-amplify-datastore.min.js.map +1 -1
- package/lib/sync/processors/subscription.js +21 -20
- package/lib/sync/processors/subscription.js.map +1 -1
- package/lib-esm/sync/processors/subscription.js +21 -20
- package/lib-esm/sync/processors/subscription.js.map +1 -1
- package/package.json +7 -7
- package/src/sync/processors/subscription.ts +27 -20
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.12.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.12.0...@aws-amplify/datastore@3.12.1) (2022-06-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* decrease error handler verbosity on self recovering errors ([#9987](https://github.com/aws-amplify/amplify-js/issues/9987)) ([67ccf09](https://github.com/aws-amplify/amplify-js/commit/67ccf09a93221a06d4560300cfd67fdd9efeda71))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Reverts
|
|
15
|
+
|
|
16
|
+
* Revert "fix: decrease error handler verbosity on self recovering errors (#9987)" (#10004) ([eb73ad7](https://github.com/aws-amplify/amplify-js/commit/eb73ad70b3eee0632eaed4bae00f1d2179ae45b5)), closes [#9987](https://github.com/aws-amplify/amplify-js/issues/9987) [#10004](https://github.com/aws-amplify/amplify-js/issues/10004)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [3.12.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.11.3...@aws-amplify/datastore@3.12.0) (2022-06-15)
|
|
7
23
|
|
|
8
24
|
|
|
@@ -63054,7 +63054,7 @@ function () {
|
|
|
63054
63054
|
};
|
|
63055
63055
|
|
|
63056
63056
|
AuthClass.prototype.oAuthSignOutRedirect = function (resolve, reject) {
|
|
63057
|
-
var isBrowser = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["
|
|
63057
|
+
var isBrowser = Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["browserOrNode"])().isBrowser;
|
|
63058
63058
|
|
|
63059
63059
|
if (isBrowser) {
|
|
63060
63060
|
this.oAuthSignOutRedirectOrReject(reject);
|
|
@@ -63512,7 +63512,7 @@ function () {
|
|
|
63512
63512
|
dispatchAuthEvent('parsingCallbackUrl', {
|
|
63513
63513
|
url: URL
|
|
63514
63514
|
}, "The callback url is being parsed");
|
|
63515
|
-
currentUrl = URL || (_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["
|
|
63515
|
+
currentUrl = URL || (Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["browserOrNode"])().isBrowser ? window.location.href : '');
|
|
63516
63516
|
hasCodeOrError = !!(Object(url__WEBPACK_IMPORTED_MODULE_3__["parse"])(currentUrl).query || '').split('&').map(function (entry) {
|
|
63517
63517
|
return entry.split('=');
|
|
63518
63518
|
}).find(function (_a) {
|
|
@@ -64965,12 +64965,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64965
64965
|
*/
|
|
64966
64966
|
|
|
64967
64967
|
/* harmony default export */ __webpack_exports__["default"] = (function (callback) {
|
|
64968
|
-
if (_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["
|
|
64968
|
+
if (Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["browserOrNode"])().isBrowser && window.location) {
|
|
64969
64969
|
var url = window.location.href;
|
|
64970
64970
|
callback({
|
|
64971
64971
|
url: url
|
|
64972
64972
|
});
|
|
64973
|
-
} else if (_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["
|
|
64973
|
+
} else if (Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["browserOrNode"])().isNode) {
|
|
64974
64974
|
// continue building on ssr
|
|
64975
64975
|
(function () {}); // noop
|
|
64976
64976
|
|
|
@@ -71245,7 +71245,7 @@ var getAmplifyUserAgent = function getAmplifyUserAgent() {
|
|
|
71245
71245
|
__webpack_require__.r(__webpack_exports__);
|
|
71246
71246
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
|
|
71247
71247
|
// generated by genversion
|
|
71248
|
-
var version = '4.5.
|
|
71248
|
+
var version = '4.5.8';
|
|
71249
71249
|
|
|
71250
71250
|
/***/ }),
|
|
71251
71251
|
|
|
@@ -94264,6 +94264,32 @@ function () {
|
|
|
94264
94264
|
_a = subscriptionError.error, _b = __read((_a === void 0 ? {
|
|
94265
94265
|
errors: []
|
|
94266
94266
|
} : _a).errors, 1), _c = _b[0], _d = (_c === void 0 ? {} : _c).message, message = _d === void 0 ? '' : _d;
|
|
94267
|
+
|
|
94268
|
+
if (message.includes(_aws_amplify_pubsub__WEBPACK_IMPORTED_MODULE_4__["CONTROL_MSG"].REALTIME_SUBSCRIPTION_INIT_ERROR) || message.includes(_aws_amplify_pubsub__WEBPACK_IMPORTED_MODULE_4__["CONTROL_MSG"].CONNECTION_FAILED)) {
|
|
94269
|
+
// Unsubscribe and clear subscription array for model/operation
|
|
94270
|
+
subscriptions[modelDefinition.name][transformerMutationType].forEach(function (subscription) {
|
|
94271
|
+
return subscription.unsubscribe();
|
|
94272
|
+
});
|
|
94273
|
+
subscriptions[modelDefinition.name][transformerMutationType] = [];
|
|
94274
|
+
operationAuthModeAttempts[operation]++;
|
|
94275
|
+
|
|
94276
|
+
if (operationAuthModeAttempts[operation] >= readAuthModes.length) {
|
|
94277
|
+
// last auth mode retry. Continue with error
|
|
94278
|
+
logger.debug(operation + " subscription failed with authMode: " + readAuthModes[operationAuthModeAttempts[operation] - 1]);
|
|
94279
|
+
} else {
|
|
94280
|
+
// retry with different auth mode. Do not trigger
|
|
94281
|
+
// observer error or error handler
|
|
94282
|
+
logger.debug(operation + " subscription failed with authMode: " + readAuthModes[operationAuthModeAttempts[operation] - 1] + ". Retrying with authMode: " + readAuthModes[operationAuthModeAttempts[operation]]);
|
|
94283
|
+
|
|
94284
|
+
_authModeRetry(operation);
|
|
94285
|
+
|
|
94286
|
+
return [2
|
|
94287
|
+
/*return*/
|
|
94288
|
+
];
|
|
94289
|
+
}
|
|
94290
|
+
}
|
|
94291
|
+
|
|
94292
|
+
logger.warn('subscriptionError', message);
|
|
94267
94293
|
_e.label = 1;
|
|
94268
94294
|
|
|
94269
94295
|
case 1:
|
|
@@ -94292,39 +94318,12 @@ function () {
|
|
|
94292
94318
|
|
|
94293
94319
|
case 3:
|
|
94294
94320
|
e_1 = _e.sent();
|
|
94295
|
-
logger.error('
|
|
94321
|
+
logger.error('Subscription error handler failed with:', e_1);
|
|
94296
94322
|
return [3
|
|
94297
94323
|
/*break*/
|
|
94298
94324
|
, 4];
|
|
94299
94325
|
|
|
94300
94326
|
case 4:
|
|
94301
|
-
if (message.includes(_aws_amplify_pubsub__WEBPACK_IMPORTED_MODULE_4__["CONTROL_MSG"].REALTIME_SUBSCRIPTION_INIT_ERROR) || message.includes(_aws_amplify_pubsub__WEBPACK_IMPORTED_MODULE_4__["CONTROL_MSG"].CONNECTION_FAILED)) {
|
|
94302
|
-
// Unsubscribe and clear subscription array for model/operation
|
|
94303
|
-
subscriptions[modelDefinition.name][transformerMutationType].forEach(function (subscription) {
|
|
94304
|
-
return subscription.unsubscribe();
|
|
94305
|
-
});
|
|
94306
|
-
subscriptions[modelDefinition.name][transformerMutationType] = [];
|
|
94307
|
-
operationAuthModeAttempts[operation]++;
|
|
94308
|
-
|
|
94309
|
-
if (operationAuthModeAttempts[operation] >= readAuthModes.length) {
|
|
94310
|
-
logger.debug(operation + " subscription failed with authMode: " + readAuthModes[operationAuthModeAttempts[operation] - 1]);
|
|
94311
|
-
logger.warn('subscriptionError', message);
|
|
94312
|
-
return [2
|
|
94313
|
-
/*return*/
|
|
94314
|
-
];
|
|
94315
|
-
} else {
|
|
94316
|
-
logger.debug(operation + " subscription failed with authMode: " + readAuthModes[operationAuthModeAttempts[operation] - 1] + ". Retrying with authMode: " + readAuthModes[operationAuthModeAttempts[operation]]);
|
|
94317
|
-
|
|
94318
|
-
_authModeRetry(operation);
|
|
94319
|
-
|
|
94320
|
-
return [2
|
|
94321
|
-
/*return*/
|
|
94322
|
-
];
|
|
94323
|
-
}
|
|
94324
|
-
}
|
|
94325
|
-
|
|
94326
|
-
logger.warn('subscriptionError', message);
|
|
94327
|
-
|
|
94328
94327
|
if (typeof subscriptionReadyCallback === 'function') {
|
|
94329
94328
|
subscriptionReadyCallback();
|
|
94330
94329
|
}
|