aws-appsync-subscription-link 2.4.1 → 2.4.2

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 CHANGED
@@ -3,6 +3,17 @@
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
+ <a name="2.4.2"></a>
7
+ ## [2.4.2](https://github.com/awslabs/aws-mobile-appsync-sdk-js/compare/aws-appsync-subscription-link@2.4.1...aws-appsync-subscription-link@2.4.2) (2022-11-17)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * added check for observer ([#736](https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/736)) ([758a55e](https://github.com/awslabs/aws-mobile-appsync-sdk-js/commit/758a55e))
13
+
14
+
15
+
16
+
6
17
  <a name="2.4.1"></a>
7
18
  ## [2.4.1](https://github.com/awslabs/aws-mobile-appsync-sdk-js/compare/aws-appsync-subscription-link@2.4.0...aws-appsync-subscription-link@2.4.1) (2022-10-07)
8
19
 
@@ -739,7 +739,17 @@ var AppSyncRealTimeSubscriptionHandshakeLink = /** @class */ (function (_super)
739
739
  ],
740
740
  });
741
741
  clearTimeout(startAckTimeoutId);
742
- observer.complete();
742
+ if (observer) {
743
+ observer.error({
744
+ errors: [
745
+ __assign({}, new graphql_1.GraphQLError("Connection failed: " + JSON.stringify(payload)))
746
+ ]
747
+ });
748
+ observer.complete();
749
+ }
750
+ else {
751
+ logger("observer not found for id: " + id);
752
+ }
743
753
  if (typeof subscriptionFailedCallback === "function") {
744
754
  subscriptionFailedCallback();
745
755
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-appsync-subscription-link",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "main": "lib/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "description": "AWS Mobile AppSync SDK for JavaScript",