Better unsubscription handling #14270
Labels
GraphQL
Related to GraphQL API issues
pending-maintainer-response
Issue is pending a response from the Amplify team.
pending-triage
Issue is pending triage
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
GraphQL API
Amplify Version
v6
Amplify Categories
api
Backend
Amplify Gen 2
Environment information
Describe the bug
Hello,
I encountered
MaxSubscriptionsReachedError
. There were some similar issues reported in this repository, and it seems the most of the problems are caused by unsubscription handling.The script below is a simplified
Provider
, and try to simulateunsubscribe()
right aftersubscribe()
to the subscription. This can happen in development build environment of React application, etc.The result is
cannot wait for subscription to be connected
. This means that the_waitForSubscriptionToBeConnected
cannot wait for subscription to be connected properly, of course it depends on the situation.The very first
subscriptionObserverMap.set()
requires onlyquery
,variables
andobserver
essentially, so we can be done it right after thesubscriptionId
is issued. How do you feel?Thanks,
Expected behavior
Unsubscription message should be sent even if unsubscribe immediately.
Reproduction steps
A proof of concept code below.
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: