Description
Description
I encountered an issue with AWS Amplify DataStore in Flutter where querying models results in the following error when launching the app for the second time in debug mode. However, I do not experience this issue in the production environment.
DataStoreException { "message": "Failed to start DataStore.", "recoverySuggestion": "Retry.", "underlyingException": "DataStoreException{message=Timed out while starting to observe storage changes., cause=java.lang.RuntimeException: DataStoreException{message=Error in querying the model., cause=android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=0, totalRows=1, recoverySuggestion=See attached exception for details.}, recoverySuggestion=There is a possibility that there is a bug if this error persists.
exception: Row too big to fit into CursorWindow requiredPos=0, totalRows=1; query: SELECT PersistentRecord.id AS PersistentRecord_id, PersistentRecord containedModelClassName AS PersistentRecord_containedModelClassName, PersistentRecord.containedModelId AS PersistentRecord_containedModelId, PersistentRecord.serializedMutationData AS PersistentRecord_serializedMutationData FROM PersistentRecord LIMIT ? OFFSET ?;"
The error suggests that a row is too big to fit into SQLite's CursorWindow.
Could you provide guidance on how to handle this issue?
Categories
- Analytics
- API (REST)
- API (GraphQL)
- Auth
- Authenticator
- DataStore
- Notifications (Push)
- Storage
Steps to Reproduce
- Create a DataStore model with large string or JSON fields.
- Save multiple large records to DataStore.
- Start the the app in debug mode and the stop/kill the app
- Restart the app in debug mode (2nd launch).
- Observe that DataStore fails to start with the error.
Screenshots
No response
Platforms
- iOS
- Android
- Web
- macOS
- Windows
- Linux
Flutter Version
3.22.1
Amplify Flutter Version
2.4.1
Deployment Method
Amplify Gen 2