Closed Bug 1278564 Opened 8 years ago Closed 8 years ago

Synchronization fails if all incoming bookmark records are value-only changes, resulting in no tree to merge

Categories

(Firefox for iOS :: Sync, defect)

All
iOS
defect
Not set
major

Tracking

()

RESOLVED FIXED
Tracking Status
fxios-v4.0 --- unaffected
fxios-v5.0 --- fixed
fxios 5.0+ ---

People

(Reporter: aaronmt, Assigned: rnewman)

Details

(Keywords: regression, reproducible)

Attachments

(1 file)

48 bytes, text/x-github-pull-request
fluffyemily
: review+
sleroux
: review+
Details | Review
There are reports of Synchronization failing for users on v5.0 (Beta), including Maria. The users are seeing the error message 'Syncing has failed'.
The troubleshooting link also leads to an article with no content.
One failed state (of how many?) that is reproducible.

=> Bookmark any site
=> Sync Now on your device
=> Sync Now on desktop
=> Modify the page title on desktop
=> Sync Now on desktop
=> Sync Now on your device

This will yield 'Syncing has failed.'
Keywords: reproducible
I get "Sync is unavailable". The first time was after a long delay, so probably some progress was made syncing.
Just updated to v5.0.0 (10) and still having syncing issues
The message I get is: Syncing has failed. The link to troubleshoot still goes nowhere.
(In reply to Aaron Train [:aaronmt] from comment #2)
> One failed state (of how many?) that is reproducible.
> 
> => Bookmark any site
> => Sync Now on your device
> => Sync Now on desktop
> => Modify the page title on desktop
> => Sync Now on desktop
> => Sync Now on your device
> 
> This will yield 'Syncing has failed.'

Can this case be fixed for 5.0?
> Can this case be fixed for 5.0?

I don't think so. I ran this scenario to see what kind of error was occurring and it looks like it's failing when merging bookmark changes. The reason being reported is the "Tree is unrooted" [1]. :rnewman might have some more insight as to why this is the case.

[1] https://github.com/mozilla/firefox-ios/blob/master/Sync/Synchronizers/Bookmarks/ThreeWayTreeMerger.swift#L1005
Assignee: nobody → etoop
If the sequence in Comment 2 is accurate, then the steps will be as follows:

> > => Bookmark any site

This should automatically trigger a sync, uploading two records (the parent and the new record).

> > => Sync Now on your device

This should download and merge.

> > => Sync Now on desktop

This should do nothing.

> > => Modify the page title on desktop

This should upload a new version of the new record.

> > => Sync Now on desktop

This should do nothing.

> > => Sync Now on your device

This should download the single modified record, which will only be value-different from a known merged tree record, with no structural changes. That should be fine.


One of these things might be happening:

* The initial addition/merge is not resulting in a sane mirror state, and so indeed the newly changed record isn't overlaying on the borked mirror -- the bug is earlier in the flow.

* There's a bug in the tree extractor or overlayer. This bug is later in the flow.

* The changed server record has actually moved, and the server is now inconsistent. This would happen if you picked a new parent folder for it during a sync (Bug 1235269). This is a desktop bug.

It should be pretty easy to see what's happening if this repros.
Flags: needinfo?(rnewman)
Failing test:

https://github.com/mozilla/firefox-ios/pull/1927

Working on this today.
Attached file Pull req.
Assignee: etoop → rnewman
Status: NEW → ASSIGNED
Flags: needinfo?(rnewman)
Attachment #8764179 - Flags: review?(sleroux)
Attachment #8764179 - Flags: review?(etoop)
From the PR:



The issue here is that a value-only change doesn't result in a remote (or local) tree. There was a sanity check in the merger to make sure that we weren't called with nothing to do, because upstream callers should short-circuit in that case. That check turns out to be too aggressive.

This PR adds a test and makes it work by removing that check.

We also need to remove an observational test elsewhere that verified the sanity check itself, and thus would now fail.
Summary: Synchronization failing for users on v5.0 (Beta) → Synchronization fails if all incoming bookmark records are value-only changes, resulting in no tree to merge
Comment on attachment 8764179 [details] [review]
Pull req.

Nice catch! Simple patch and test passes. LGTM!
Attachment #8764179 - Flags: review?(sleroux) → review+
Attachment #8764179 - Flags: review?(etoop) → review+
master: d4eb0e9
v5.x: 0cb44c3
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: