Closed Bug 1352931 Opened 7 years ago Closed 5 years ago

First sync on Android uploads mobile bookmarks but not the mobile root

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P5)

defect

Tracking

(fennec+)

RESOLVED INACTIVE
Tracking Status
fennec + ---

People

(Reporter: markh, Unassigned)

References

(Blocks 1 open bug)

Details

* Create an account on desktop, sync.
* Connect a freshly installed Fennec to the same account, sync.
* Android writes its default bookmarks as being parented in the "mobile" root.
* Android does *not* write the mobile folder itself, causing desktop to report validation errors.

If I restart the desktop profile after Fennec has synced I see:

> 1491194627116	Sync.Engine.Bookmarks	TRACE	Incoming: { id: 2f2k4Tm9Eg1t  index: 0  modified: 1491193904.35  ttl: undefined  payload: {"tags":[],"id":"2f2k4Tm9Eg1t","parentid":"mobile","title":"Firefox: Customize with add-ons","type":"bookmark","bmkUri":"https://addons.mozilla.org/android?utm_source=inproduct&utm_medium=default-bookmarks&utm_campaign=mobileandroid","parentName":"mobile"}  collection: bookmarks }
> 1491194627178	Sync.Engine.Bookmarks	TRACE	Incoming: { id: T4U8WLG94Qqn  index: 0  modified: 1491193904.35  ttl: undefined  payload: {"tags":[],"id":"T4U8WLG94Qqn","parentid":"mobile","title":"Firefox: Support","type":"bookmark","bmkUri":"https://support.mozilla.org/products/mobile?utm_source=inproduct&utm_medium=default-bookmarks&utm_campaign=mobileandroid","parentName":"mobile"}  collection: bookmarks }
> 1491194627213	Sync.Engine.Bookmarks	TRACE	Incoming: { id: XrWwfvFe2YpU  index: 0  modified: 1491193904.35  ttl: undefined  payload: {"tags":[],"id":"XrWwfvFe2YpU","parentid":"mobile","title":"Firefox: About your browser","type":"bookmark","bmkUri":"about:firefox","parentName":"mobile"}  collection: bookmarks }
> 1491194627242	Sync.Engine.Bookmarks	INFO	Records: 3 applied, 3 successfully, 0 failed to apply, 0 newly failed to apply, 0 reconciled.

So note that the 3 bookmarks correctly referencing the parent "mobile" are uploaded, but mobile itself isn't. If you look at the mobile record on the server, it has no children.

Note also that although desktop correctly applies the records, it doesn't consider "mobile" as being changed, so desktop doesn't attempt to re-upload it's local version of the mobile folder.

A further note: If I then add a new bookmark to Fennec, then we *do* get the "mobile" folder updated (but for some reason I also see updates to "menu" and "toolbar", even though I only hit the "star" button on Android, but I think that's a different bug I'm still trying to narrow down)
tracking-fennec: --- → ?
Assignee: nobody → gkruglov
Priority: -- → P1
Blocks: 1353641
tracking-fennec: ? → +
Hi Mark
May I know how to get above error messages using the profiler? 
Since I can't access the server, I'm trying to reproduce the issue from my end..
Flags: needinfo?(markh)
There's no profiler involved - by "profile" I mean a Firefox profile. The messages above were all from Desktop's sync logging - you'll need to ensure you have "trace" logging enabled for the bookmarks engine - probably the easiest way to do that is to install https://addons.mozilla.org/en-US/firefox/addon/about-sync/ and use the UI it offers to arrange for all engines to log at "trace". You'll also need to enable "log on success" as these syncs don't fail and so don't write a log file by default.
Flags: needinfo?(markh)
Starting to look into this.

One thing that stands out is that we do not bump mobile roots l-m timestamp when adding default or distribution bookmarks. So we end up with a small discrepancy (mobile root's l-m is older than its newly added children), but this shouldn't produce this behaviour.

My current theory is that's we're tracking the mobile root folder for exclusion during upload. We do that be default for all folders and items that are newer on the server than locally (according to l-m timestamps...), and untrack items if we determine that list of children is different between server and client, or that positioning of local children changed. Perhaps something is going wrong in that logic.
Assignee: gkruglov → nobody
Priority: P1 → P2
Bookmark version tracking made this bug very easy to observe - syncVersions for folders aren't bumped on a first sync.
Assignee: nobody → gkruglov
Status: NEW → ASSIGNED
Priority: P2 → P1
Product: Android Background Services → Firefox for Android
Priority: P1 → P2
P1, since IIUC this can cause data corruption on all clients. (Unassigning Grisha, although feel free to reassign yourself if I made a mistake)
Assignee: gkruglov → nobody
Status: ASSIGNED → NEW
Priority: P2 → P1
Re-triaging per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195

Needinfo :susheel if you think this bug should be re-triaged.
Priority: P1 → P5

Hello, I tried to reproduce your issue on the latest version of Nightly 68.0a1 (2019-03-27) and Release 66.0.2 but I wasn't able to reproduce it.
Mark can you please re-check this issue with the latest Firefox versions(android and desktop) and let us know if you manage to still reproduce the issue?

Thanks,
Andrei

Flags: needinfo?(markh)

I think this is still an issue, IIUC—although one we aren't likely to fix in Fennec. 😕 Andrei, when you tried to repro, did you see validation errors in about:sync on Desktop after adding bookmarks on Android?

Flags: needinfo?(markh) → needinfo?(andrei.bodea)

Hello Lina, I tried to reproduce again and I found a error.
I this the validation error? I'm asking because is not really called like that in about:sync.

Thanks,
Andrei

Flags: needinfo?(andrei.bodea)

(In reply to Andrei Bodea[:andrei] from comment #9)

Hello Lina, I tried to reproduce again and I found a error.
I this the validation error? I'm asking because is not really called like that in about:sync.

That's a strange log - it almost looks like the browser is shutting down, but other evidence of a shutdown isn't there when it should be.

However, as Lina mentioned, there's probably no good reason to investigate this further as Fenix will be using a completely new bookmarks engine and it's unlikely anyone will get to fix Fennec sync issues before then.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INACTIVE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.