AWS Amplify SDK IOS - Subscription When App Remains Idle for a Long Time Oflline #409
Labels
question
A question about how to use an existing feature
requesting info
Further information is needed before this is actionable
Describe the bug
When app is in background for a long time > 10 min without network connection, the subscriptions are not restarted.
To Reproduce
Steps to reproduce the behavior:
This is a very similar issue to: #396 except that I disabled network connection while app is in background by disabling WiFi while in background and then enabling WiFi right before I open the app again. If app is in background < 10 min without network connection this issue does not occur.
So to reproduce:
Start App and initialise a subscription to GraphQL via subscribe(subscription:queue:statusChangeHandler:resultHandler).
Make sure subscription is connected.
Send app to background.
Disable network by turning WiFi off.
Wait a rather long period of time (>10 minutes).
Enable WiFi.
Activate app again and try to create a new subscription from applicationWillEnterForeground.
The following logs are produced:
It seems to be hitting the following condition:
AppSyncLogger.debug("Self is nil, listener is not called.")
in AppSyncSubscriptionConnection.
I managed to work around this solution by manually disposing the subscriptions when app goes to background and then re-subscribing when app goes to foreground again but it was to my understanding that background/foreground and offline/online should be handled by the SDK itself?
Expected behavior
To be able to create new subscriptions.
Screenshots
Environment(please complete the following information):
Device Information (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: