Closed Bug 550627 Opened 14 years ago Closed 14 years ago

Default reconciliation to server wins for older changed items

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Mardak, Assigned: Mardak)

References

Details

Attachments

(1 file)

Instead of client wins on conflicts, do server wins if a changed item is pretty old. This means we need to track a change time from the tracker. Also, we need to make sure first syncs get reconciled as server wins if an item wasn't already changed.
We can use the X-Weave-Timestamp to compare a record's modified time with the current server time.

recordAge = X-Weave-Timestamp - record's modified
changeAge = Date.now() - tracker's time

if (changeAge < recordAge) client wins; else server wins
Blocks: 537653
I plan on getting this in after the security/versioning changes.
Assignee: nobody → edilee
Attached patch v1Splinter Review
Attachment #436520 - Flags: review?(mconnor)
Attachment #436520 - Flags: review?(mconnor) → review+
Comment on attachment 436520 [details] [diff] [review]
v1

addChangedID needs to allow updates... with that fixed, r=me
http://hg.mozilla.org/labs/weave/rev/060891b7067a
Save the time the tracker adds a new changed id and use that to compare the age of the record on the server vs the age of the local change to decide if it's server wins or client wins. Fix up various direct uses of changedIDs to use the API and make the save-to-disk lazy to avoid excessive writes. Add a test to make sure addChangedID only increases in time. 

(In reply to comment #4)
> addChangedID needs to allow updates... with that fixed, r=me
You ask for a fix.. and get a fix plus tests! >:)
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Depends on: 557503
Blocks: 557891
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: