-
Notifications
You must be signed in to change notification settings - Fork 202
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): sync pending mutation events with latest synced metadata #3377
Conversation
e21e316
to
776b32e
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3377 +/- ##
==========================================
- Coverage 68.16% 68.12% -0.05%
==========================================
Files 1079 1078 -1
Lines 36033 35987 -46
==========================================
- Hits 24563 24517 -46
Misses 11470 11470
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Some follow up questions, first and formost would be: Should MutationEvent's version property be deprecated?
Exploring if we removed version
from MutationEvent:
- OutgoingMutationQueue processes existing pending mutations by reconciling the version from the incoming mutation response through
MutationEvent.reconcilePendingMutationEventsVersion
. Is this still needed if we always get the latest sync metadata from storage? - ReconcileAndLocalSaveOperation will call
notify(savedModel:mutationType)
and the hub payload is a MutationEvent. if the answer to the first question is thatversion
is deprecated, then this will impact customers listening to hub events with MutationEvent payloads. - Similar question to above, MutationEvent is also the event for
DataStore.observe
API. Asking the deprecated question in another way: Are other platform's observe API returning data that contains theversion
as well? - Some other areas of interest is AWSMutationDatabaseAdapter
...urces/AWSDataStorePlugin/Sync/MutationSync/OutgoingMutationQueue/OutgoingMutationQueue.swift
Outdated
Show resolved
Hide resolved
...WSDataStorePlugin/Sync/MutationSync/OutgoingMutationQueue/SyncMutationToCloudOperation.swift
Show resolved
Hide resolved
...StorePlugin/Sync/SubscriptionSync/ReconcileAndLocalSave/ReconcileAndLocalSaveOperation.swift
Show resolved
Hide resolved
I think for now, the safest way to do is mark it as deprecated field. If we remove the |
e9296ac
to
4077e16
Compare
...tationSync/AWSMutationDatabaseAdapter/AWSMutationDatabaseAdapter+MutationEventIngester.swift
Show resolved
Hide resolved
completion: completion) | ||
let operation = await SyncMutationToCloudOperation( | ||
mutationEvent: mutationEvent, | ||
getLatestSyncMetadata: { nil }, |
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.
We can test passing in a closure that returns non-nil as well and assert the API call is made with the version
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.
will update the test!
Issue #
#1308
Description
General Checklist
Given When Then
inline code documentation and are named accordinglytestThing_condition_expectation()
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.