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

DataStore sync on Android physical devices takes very long time #4678

Closed
2 of 14 tasks
szymondobrzanski opened this issue Apr 9, 2024 · 7 comments
Closed
2 of 14 tasks
Assignees
Labels
bug Something is not working; the issue has reproducible steps and has been reproduced datastore Issues related to the DataStore Category pending-release Issues that have been addressed in main but have not been released

Comments

@szymondobrzanski
Copy link

Description

Greetings,

I've observed that syncing DataStore on Android physical devices running Android version 10 or higher is time-consuming, typically ranging from 20 seconds to 2 minutes. On devices with older Android versions (specifically tested with 7 and 8), the sync process is notably swifter, max 15 seconds. I haven't been able to replicate this issue on emulators. Comparatively, on iOS devices, the sync completes within a matter of seconds.

Upon initializing the app, I trigger the sync process to load all necessary data:

await Amplify.DataStore.start();
await Amplify.Hub.availableStreams[HubChannel.DataStore]!
        .firstWhere((event) => event.eventName == "ready");

Numerous Android users of my app have reported encountering the same issue. For now the only workaround I see is dropping DataStore and replacing it with API-based approach. However, this would force me to rewrite my application's infrastructure layer. While I've come across similar reported issues, they appear to have been closed without a definitive solution or explanation for the underlying cause.

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

Reproduce steps similar to case in my application:

  1. Add 20+ models to schema.graphql
  2. Populate them with data
  3. Build app on android physical device with android version 10+
  4. Register user
  5. Start sync
  6. Wait until sync finishes

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.19.5

Amplify Flutter Version

1.7.0

Deployment Method

Amplify CLI

Schema

No response

@Equartey Equartey added datastore Issues related to the DataStore Category pending-triage This issue is in the backlog of issues to triage labels Apr 9, 2024
@Equartey
Copy link
Contributor

Equartey commented Apr 9, 2024

Hi @szymondobrzanski, sorry you've ran into this issue. This is a known issue that we're working to resolve. We'll update you when we've released a fix.

@Equartey Equartey added bug Something is not working; the issue has reproducible steps and has been reproduced pending-release Issues that have been addressed in main but have not been released and removed pending-triage This issue is in the backlog of issues to triage labels Apr 9, 2024
@Equartey Equartey assigned Equartey and khatruong2009 and unassigned Equartey Apr 9, 2024
@szymondobrzanski
Copy link
Author

Hey @Equartey @khatruong2009, do you have an ETA for this fix?

@Equartey
Copy link
Contributor

@szymondobrzanski we do not have a concrete timeline, but I can assure you this is one of our top priorities.

We have an open PR #4279 that should resolve this issue.

We'll provide an update when its available.

@amitchaudhary140
Copy link

amitchaudhary140 commented Apr 11, 2024

Yes this is much needed because my Android users are complaining a lot. Good to know that it is your top priority and we expect the fix to be launched soon. @Equartey Could you please confirm this fix might work for React Native Expo projects as well? Or is it just Flutter?

@Equartey
Copy link
Contributor

Hi @amitchaudhary140, our fix will only be for Amplify Flutter. If you are observing similar issues with an Amplify React Native project, please submit a issue to their repo: https://github.com/aws-amplify/amplify-js/issues/new/choose

@tanle17th
Copy link

Hi @Equartey, do you guys have a plan for shipping #4279?

@NikaHsn
Copy link
Member

NikaHsn commented Apr 17, 2024

Thank you for your patience. The issue has been fixed in version 1.8.0. and I'm closing it. However, if you encounter any issues after updating to version 1.8.0, please don't hesitate to reopen it.

@NikaHsn NikaHsn closed this as completed Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working; the issue has reproducible steps and has been reproduced datastore Issues related to the DataStore Category pending-release Issues that have been addressed in main but have not been released
Projects
None yet
Development

No branches or pull requests

6 participants