-
Notifications
You must be signed in to change notification settings - Fork 119
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
fix(datastore): Observe Query should not return deleted items, fixes - #2069 #2522
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8ec1435
fix(datastore): ObserveQuery showing deleted item
ankpshah 6eb5ac7
Fix(Datastore)- ObserveQuery deleted items not showing for local Dele…
ankpshah c5e1a6f
Fix(Datastore)- ObserveQuery deleted items showing for local Delete c…
ankpshah 6237a4d
Merge branch 'ankpshah/observe-query-deleted-items' of https://github…
ankpshah 6edbf30
Add test for ObserveQuery Delete record fix
ankpshah b1538dc
Merge branch 'main' of https://github.com/aws-amplify/amplify-android…
ankpshah 386efa1
Merge branch 'main' of https://github.com/aws-amplify/amplify-android…
ankpshah a9c0d73
fix(Datastore): PublishSubscriber subscribes before observation starts
ankpshah d02b234
fix(Datastore): Populate completeItemMap before Subject subscribes
ankpshah 0f21ef0
fix(Datastore): Test Observe Query does not return deleted record
ankpshah 2cbe19e
fix(Datastore): Fix test - Perform actions after observation starts
ankpshah 9c9443f
Nit: remove blank lines
ankpshah a00ee63
Nit: remove blank lines
ankpshah 16bb008
fix(Datastore): Add test - Observe Query Should Fail if returns delet…
ankpshah 67d142d
Nit: Fix Indentation, Add docs for test
ankpshah e61da21
Remove redundant test for delete
ankpshah 3cfba01
Nit: Lint fixes
ankpshah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Is it strictly necessary for the
onObservationStarted
to be so late?There is a slight behaviour change here in that if the initial query fails the caller will never see the onStarted callback, only onError (prior behaviour was to see onStarted and then onError). I'm not sure that is a problem, in fact it may be more correct than the prior implementation.
I was also looking at whether it would be possible for
onItemChange
to get invoked prior ononObservationStarted
, it's a bit ambiguous to me but I don't think so?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had requested this change after diving in together because it was easy to replicate incorrect values and counts if mutations were made before the initial query was successful. Once we report
onObservationStarted
, my expectation is that no observations would be missed once that value is returned. This was not the case with the immediate callback.If
completeItemMap
is empty (which is the case before its populated with initial values from a successful query, any item changes (such as a delete) will not properly be updated/removed from competeItemMap.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks.