Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managing Reconnection Attempts for AWS AppSync Subscription with Apollo #758

Open
objectiveSee opened this issue Oct 21, 2023 · 2 comments

Comments

@objectiveSee
Copy link

objectiveSee commented Oct 21, 2023

I'm working on a project using AWS AppSync with Apollo to manage GraphQL subscriptions. I'm using aws-appsync-subscription-link with an Apollo subscription for real-time data. Everything works fine until the subscription connection is lost. Then, I have trouble getting the connection back automatically.

My main question is how to set up aws-appsync-subscription-link or Apollo so that if a subscription connection is lost or has an error, it tries to reconnect automatically. I've looked through a lot of documentation and forums but haven't found a clear answer or example on how to handle automatic reconnection in these situations.

I'd appreciate any advice or examples on how to adjust the configuration to retry the connection if it fails. Tips on the best ways to handle reconnection with AWS AppSync and Apollo would be really helpful. Thanks!

For more background, you can check out an issue I opened in the Apollo repository. They sent me here to find a solution to my problem.

Issue Link

Are you requesting a feature or reporting a bug?
🐛 bug

What's happening now?
When a subscription connection is lost, the system doesn't try to reconnect automatically.

If this is a bug, can you tell me how to reproduce it and, if possible, show a simple example of the problem?

  • Set up a subscription connection using aws-appsync-subscription-link with Apollo.
  • Lose the connection somehow, like by turning off the internet. You can also just have Wifi off from the beginning (eg. never connected)
  • Notice that it doesn't try reconnect after it has an error in connecting.

What should happen?

  • When a subscription connection is lost, it should try to reconnect automatically.

Which versions and environments (browser, react-native, nodejs) / OS are affected? Did it work in earlier versions?

Environment: React
OS: Mac

Related Issues

@mengdi
Copy link

mengdi commented May 28, 2024

+1 on this issue

@samsuchin
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants