-
Notifications
You must be signed in to change notification settings - Fork 127
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Before opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
Language and Async Model
Java
Amplify Categories
DataStore
Gradle script dependencies
N/A
Environment information
N/A
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
QueryPredicateGroup has a bad Gson serializer/deserializer.
This causes data to be improperly stored in the syncExpression column of LastSyncMetadata.
The initial sync may work correctly, but any subsequent sync attempts fail because QueryPredicate isn't properly registered in GsonFactory. The issue is caused by not being able to handle nested query predicates (groups and groups of groups).
Fixes Required:
- Clean up the serialization and deserialization for QueryPredicateGroup
- Do a 1 time delete of all syncExpressions within LastSyncMetadata that contain groups.
- Added a migration_flags table to mark when the invalid entries were deleted (or set by default on database recreation)
Reproduction steps (if applicable)
Add a sync expression like:
DataStoreConfiguration.builder().apply {
syncExpression(
Todo::class.java,
{ Todo.NAME.eq("Name").and(Todo.TODO_ID.eq("123")) }
)
}.build()
Watch initial sync pass, with subsequent sync's fail. Notice missing "_type" fields in serialized model in db
Code Snippet
// Put your code below this line.
Log output
// Put your logs below this line
Configuration File
No response
GraphQL Schema
// Put your schema below this line
Additional information and screenshots
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working