-
Notifications
You must be signed in to change notification settings - Fork 194
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
[DataStore] Implement mutations in batches or upload data in the background #3434
Comments
This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you! |
Thank you for raising the feature request. Our team will prioritize it and will post an update on the issue once we have more information. |
@lawmicha I am experimenting with BackgroundTasks on iOS in order to trigger DataStore syncing to cloud and have a question. I am trying a naive approach that will "simply" call So far I have observed that I am able to call start/stop methods but I am unable to receive outbox events. Is there any code in DataStore which might prevent it running when app is in background state? |
Hi @fzy-spyro, there isn't anything in DataStore that I'm aware of that depends on the background/foreground state of the app. I wonder what the start sequence logs look like when you call |
@madej10 / @kubatatami DataStore currently does not have any special implementation that checks the app states to see whether it's in foreground or background, I think the path forward in this feature request are one or a combination of:
A note about batching, DataStore calls AppSync APIs |
Is your feature request related to a problem? Please describe.
Users open our app once or twice a day. On app startup we fetch data from physical device and save it in DataStore. For each day we may have ~2000 rows to save. We observe that DataStore send mutation queries for each row one by one and only when app is the foreground. Each mutation takes 300-800ms so to send all data to backend we have to keep app open for almost 20 minutes while our user have the app open for a few minutes only. In result we don't have a recent data on the backend and not synced data grows on mobile device.
Describe the solution you'd like
If Amplify SDK send mutation queries in batches (let's say 50 rows per request) then uploading ~2000 rows will be significantly faster and it will solve our issue.
Describe alternatives you've considered
Alternatively, if Amplify SDK let us to upload data when app is in the background it will also solve our issue. Our app keeps BLE connection with external device so it's active in the background for many minutes per day - enough to send all ~2000 rows.
Is the feature request related to any of the existing Amplify categories?
DataStore
Additional context
No response
The text was updated successfully, but these errors were encountered: