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

Restarting Subscription once device moves online-offline-online (network connection) #602

Open
annucy opened this issue Nov 23, 2020 · 2 comments

Comments

@annucy
Copy link

annucy commented Nov 23, 2020

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
I am using awss-mobile-appsync-sdk-js and use Subscriptions (with buildSubscription helper) on componenetDidMount() method.
-> Once device is online, subcription works fine. Now if network connectivety goes off, subscription will stop(as expected).
-> Again, once connectivety comes back, I would expect subscription to restart automatically. But it does not happen

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
I am using awss-mobile-appsync-sdk-js and use Subscriptions (with buildSubscription helper) on componenetDidMount() method.
This is the code I am using

const SubscribeToMoreOptions = this.props.chatResponse.subscribeToMore(buildSubscription(
{
query: postSubscription,
variables: { conversationId: 'g-' + this.props.navigation.state.params.group.id }
},
{
query: allMessageConnection,
variables: { conversationId: 'g-' + this.props.navigation.state.params.group.id }
},
'id',
'add'))
}

-> Once device is online, subcription works fine. Now if network connectivety goes off, subscription will stop(as expected).
-> Again, once connectivity comes back, I would expect subscription to restart automatically.

Could you explain how these scenario needs to be handled?

What is the expected behavior?
Subscription should restart based on connectivety, or there should be call back for the user to handle this(restart subscription).

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?
"aws-appsync": "^4.0.1",
"aws-appsync-react": "^4.0.1",
"react-apollo": "^2.5.8",
"react": "16.9.0",
"react-native": "0.61.5",

@szad769
Copy link

szad769 commented Dec 4, 2020

Same Issue.

@jwelmac
Copy link

jwelmac commented Dec 7, 2020

Same here

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