-
Notifications
You must be signed in to change notification settings - Fork 247
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
iOS sync stop when app is in background and screen off only in Release #5041
Comments
Hello @JeremyLabelIO thank you for submitting this issue. We will look into this and get back to you! |
Hi @JeremyLabelIO, Are you pausing the app during a sync? Or do you lose sync functionality when pausing the app? DataStore changed in 2.1.0 to use our Dart first API category instead of using Amplify Swift under the hood. I suspect subscriptions management differs, specifically when the app isn't in the foreground. In the meantime, give one of these two workarounds a try.
These are just my initial thoughts. We'll provide a more concrete solution once we've looked into it more. |
Hi @Equartey I already try to stop and start DataStore when the app is being pause/resumed but without success. I confirm it is working with Amplify Flutter 2.0.0 but I have other issue with this version (mostly in Android) and it is complicated for us to maintain different version for iOS and Android. Do you think it will be fix soon ? Best Regards, Jeremy |
I was able to reproduce the syncing issue following the steps you provided. We will track this as a bug and will let you know if there are any updates. |
Hi @tyllark Thanks a lot. |
No problem, we will let you know when we have an update. |
Hello @tyllark We are encountering the same issue with API (GraphQL) subscriptions, where the sync stops when the app is in the background or the screen is off (only in Release mode). Could you please provide any updates on when this issue might be resolved? Thank you! |
Hi @gauravwagh1, we are still working to determine the root cause and will get back to you with any updates. |
Hi @JeremyLabelIO,
A bug was fixed in Amplify DataStore 2.4.1 that resolved this workaround. Can you give it another try on this version? |
I'm going to close this issue as we've released a fix for it. If you have additional questions, please open a new issue. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Hello @JeremyLabelIO and @gauravwagh1 sorry for the delay but we now have a fix for this issue under review. We will provide updates here when the fix is release, but in the meantime you can override your dependencies with the fix by including the following in your pubspec.yaml.
Please let us know if you have any issues with this workaround. |
@tyllark |
Hi @gauravwagh1 I just merged the changes. I will aim to schedule a release early next week. We will post here when the release is live. |
Hello @JeremyLabelIO and @gauravwagh1 the fix has been released! Please update your packages to 2.4.2. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Description
Hi,
After updating amplify_flutter and amplify_datastore from 1.8.0 to 2.1.0 if I put my iOS app in background, turn off the screen, the sync is completely stopped. The only way to start sync again is to kill the app and relaunch it.
Everything works fine in debug but not in release.
I already try this :
As of next steps, please enable optimizations in your debug build and see if the issue is occurring when enabling the optimization. In addition, by using this way you will be able to obtain logs regarding the issue:
https://github.com/apple/swift/blob/main/docs/OptimizationTips.rst#enabling-optimizations
But I have still no logs and no changes.
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.1 23B74 darwin-arm64, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
Pubspec :
environment:
sdk: '>=3.3.0 <4.0.0'
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_launcher_icons:
intl: ^0.19.0
amplify_flutter: 2.1.0
amplify_datastore: 2.1.0
amplify_api: 2.1.0
amplify_auth_cognito: 2.1.0
amplify_storage_s3: 2.1.0
Categories
Steps to Reproduce
Screenshots
No response
Platforms
Flutter Version
3.22.2
Amplify Flutter Version
2.1.0
Deployment Method
Amplify CLI
Schema
No response
The text was updated successfully, but these errors were encountered: