awslabs / aws-mobile-appsync-sdk-js

JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Apache License 2.0
919 stars 266 forks source link

fix: check observer exists handleIncomingSubscriptionMessage #645

Open pckilgore opened 3 years ago

pckilgore commented 3 years ago

No Issue, although similar in nature to #515 #544 #596 (and PRs #609, #595).

Check observer exists before calling its methods in AppSyncRealTimeSubscriptionHandshakeLink##_handleIncomingSubscriptionMessage

This observer is being defaulted to null here, so I assume checking that and ignoring the event after logging is fine since I would expect the method to bail there rather than initialize to an invalid value? https://github.com/awslabs/aws-mobile-appsync-sdk-js/blob/fc173bfe3ce262b1dba422021fc57097c4926b7b/packages/aws-appsync-subscription-link/src/realtime-subscription-handshake-link.ts#L641

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. I Agree.

pckilgore commented 2 years ago

Bumping. What can I do here to help get it merged?

pckilgore commented 2 years ago

Hello again. Can I do anything to assist this is being merged?

Dollab commented 2 years ago

It would be really really great if this could be merged 🙏

simon-q commented 1 year ago

I opened a PR that fixes this following the existing code. Please review it: https://github.com/awslabs/aws-mobile-appsync-sdk-js/pull/735