-
Notifications
You must be signed in to change notification settings - Fork 41
Ignore conflicted records during resolve #349
Conversation
85e0b5d
to
b624090
Compare
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.
why not extend #313 to handle DELETE cases like this
1. [[CREATE, object], [UPDATE, object]] => [[CREATE, object], [UPDATE, object]]
2. [[CREATE, null], [UPDATE, null]] => [[CREATE(merged), null]]
3. [[CREATE/UPDATE, null]..., [DELETE, null]] => ignore
4. [[CREATE/UPDATE, object]..., [DELETE, object]] => [[DELETE, object]]
this sounds good, but probably contains another surprises |
it's ok, just a thought. We really need to consider timestamp when doing
|
b624090
to
350602f
Compare
@anthony your STR from above BM1, BM2 are interesting. First I tried it in my local branch, where I work on current PR - and could not reproduce it with several attemps. The only difference was at https://github.com/brave/brave-core/blob/master/components/brave_sync/brave_profile_sync_service_impl.cc#L793, I disable such ignore to see #261 STR works. Rebuild of my branch without mentioned workaround have made So workaround of Workaround should be reverted on Desktop, Android I think, except the current PR, no other actions required, because the browser gets On fetch record operation, the time is get from S3 key: The time of record is ignored when we send it to AWS So I think, there are no any specific processing of records time during resolve required. |
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.
++
This may be some other issue, but it's not the issue that is described in #261 |
Closing this PR as for #261 (comment) |
Fixes #261
When sync lib gets unexpected data, during the merge it can lead to wrong resolve result calculated changes.
These are in https://github.com/brave/sync/blob/staging/client/recordUtil.js#L212 when
nullIgnore()
is returned:If this records are ignored by themselves , it doesn't cause a trouble.
But before to be ignored, such records absorb the records of the same
objectId
and then the required changes become wrongly ignored. The illustration is #261 .Obviously, if we would not do resolve and apply each record to the model, this would give the result.
So to avoid the mess on resolve, such pairs which would be resolved to null, but can make other important changes to be wrongly ignored - such pairs are removed from the merge on resolve operation.
Will mark as not draft when add the test cases.