aws-mobile-appsync-sdk-ios icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-ios copied to clipboard

Correctly handling coming back online after saving a lot of mutations in offline

Open ifabijanovic opened this issue 5 years ago • 1 comments

My app is used for monitoring - every 5s it takes some readings and saves them by performing a mutation. While the phone has an active internet connection there are no issues - all mutations are nicely synced to the cloud.

However a realistic scenario is that the app would be used for monitoring purposes in a no-connection scenario. I simulate this by putting the phone in Airplane mode and leave it running for 12+ hours, producing 9k+ offline mutations. When I connect back to internet afterwards the app gets killed by iOS pretty quickly, i.e. less than a minute. There are no crash logs on the device so my guess is that it gets killed by the iOS watchdog. After restarting the app (and keeping the phone connected to internet) data starts getting synced and eventually everything is there.

As an added note - I do not perform any queries at all in the app - it just uses AppSync to push data to cloud so mutations only.

Is this something that is known/expected? Is there a way to throttle mutation sync? Is there some configuration parameter that could/should be used in a case like this?

Environment(please complete the following information):

  • AppSync SDK Version: 2.10.3
  • Dependency Manager: Cocoapods
  • Swift Version : 4.2

Device Information (please complete the following information):

  • Device: iPhone 7
  • iOS Version: 12.1

ifabijanovic avatar Mar 29 '19 08:03 ifabijanovic

Read my issue here. It's possible you are encountering the same thing https://github.com/awslabs/aws-mobile-appsync-sdk-ios/issues/173

I described a solution there as well

btn52396 avatar Mar 30 '19 00:03 btn52396

Thank you for opening this issue. AWS AppSync SDK for iOS entered maintenance mode in September 2023 and will receive no further updates as of September 2024.

Please use Amplify Swift going forward. For information on upgrading to Amplify Swift, refer to the Upgrade from AppSync SDK documentation.

atierian avatar Dec 07 '23 20:12 atierian