amplify-android
amplify-android copied to clipboard
DataStore waits too long before it's ready
Before opening, please confirm:
- [X] I have searched for duplicate or closed issues and discussions.
Language and Async Model
Kotlin
The DataStore query doesn't do anything on the first load of the app, so I tried to listen for the DataStoreChannelEventName.READY event, but it took 1 minute from opening the app to when it got into Event Ready. Is there a way to sync data faster
Amplify Categories
DataStore
Gradle script dependencies
// Put output below this line
"version": "3.1",
</details>
### Environment information
<details>
Put output below this line
Gradle 6.7.1
Kotlin: 1.3.72 Groovy: 2.5.12 Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020 JVM: 11.0.11 (Oracle Corporation 11.0.11+9-LTS-194)
</details>
### Please include any relevant guides or documentation you're referencing
_No response_
### Describe the bug
The DataStore query doesn't do anything on the first load of the app, so I tried to listen for the DataStoreChannelEventName.READY event, but it took 1 minute from opening the app to when it got into Event Ready.
Is there a way to sync data faster
### Reproduction steps (if applicable)
_No response_
### Code Snippet
```java
// Put your code below this line.
Log output
// Put your logs below this line
amplifyconfiguration.json
No response
GraphQL Schema
// Put your schema below this line
Additional information and screenshots
No response
When you start datastore sync starts in the background. You can use the observe query API to get the realtime sync results and you will be notified when sync is complete as well.
The DataStore query doesn't do anything on the first load of the app, so I tried to listen for the DataStoreChannelEventName.READY event, but it took 1 minute from opening the app to when it got into Event Ready. Is there a way to sync data faster
The solution is not working :(. When we use observe query API we got data only after DataStoreChannelEventName.READY event . We got an empty array (initial data) and full array after DataStoreChannelEventName.READY event . Problem is longing time on DataStoreChannelEventName.READY event on the first load of the app.
Is there any data saved locally when the app is started?
@poojamat I don't save any data when the app is started. It is the first starting app
having the same issue, I resorted to loading static data from a json file. Any solutions?
A large dataset can cause DataStore sync to take more time to sync all the records and send the READY event. You can limit the number of records being synced using selective syncing.
A large dataset can cause DataStore sync to take more time to sync all the records and send the READY event. You can limit the number of records being synced using selective syncing.
my database consists of 20 tables. There is not much data at the moment, about 10 rows in each table. Sync takes more than 30 seconds ((I'm in apathy because I can't solve the problem ((
@nazarcybulskij Have you got any solution for faster sync ? I have only around 100 data but it takes more than 60 seconds.
@nazarcybulskij In ios with same user takes only 7 seconds it is big diff for sync between android and ios.
#2703 dramatically improved sync times for datastore, bringing it much closer to the iOS time, and was released in Amplify 2.14.10. I'm closing this issue but please feel free to open a new one if necessary.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.