Closed frankarnaud closed 2 years ago
Hi @frankarnaud 👋 Thank you for raising this issue. I reached out to the DataStore team and they noticed that you are using the SQLite adapter in an Expo project. Unfortunately, that adapter is not currently compatible with Expo and meant to be used with React Native CLI projects.
You will have to uninstall datastore-storage-adapter
and remove SQLite Adapter
from the DataStore configuration so that DataStore uses the default adapter, AsyncStorage.
Hi @frankarnaud 👋 Thank you for raising this issue. I reached out to the DataStore team and they noticed that you are using the SQLite adapter in an Expo project. Unfortunately, that adapter is not currently compatible with Expo and meant to be used with React Native CLI projects.
You will have to uninstall
datastore-storage-adapter
and removeSQLite Adapter
from the DataStore configuration so that DataStore uses the default adapter, AsyncStorage.
Thank you for being so responsive. Indeed we use the expo in our application but in the bare workflow mode which would be similar to react-native cli or expo eject. As mentioned above we have noticed this problem on android. Most of our operations take a very long time.
We were already using datastore with AsyncStorage. But we encountered the mentioned issue #8405 which led us to use the recommendation from the official documentation.
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
DataStore
Amplify Categories
api
Environment information
Describe the bug
The read and write operations with datastore are too slow on android. Indeed to update an element we first do a query on id then a copyOf. In dev on a Redmi note 10 with 6GB ram the query takes about 8min which is much too long. When you make several successive requests, the time varies. We can do 65s, 161, 3min in the tests I performed. In production our users complain that successive operations can do 30mins. On IOS the problem does not arise whether it is with the emulator or an iphone. We are using @ aws-amplify / datastore-storage-adapter as mentioned in the doc.
Expected behavior
We want operations to be almost instantaneous since datastore is offline-first.
Reproduction steps
npx react-native init AmplifyDataStoreRN cd AmplifyDataStoreRN npx amplify-app@latest npm install aws-amplify @aws-amplify/datastore-storage-adapter react-native-sqlite-storage aws-amplify-react-native amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage @react-native-picker/picker
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
Xiaomi Redmi note 10s
Mobile Operating System
Android 11
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response