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

ASSIGNED
Assigned to

Status

()

Firefox for Android
Android Sync
P2
normal
ASSIGNED
a year ago
5 months ago

People

(Reporter: markh, Assigned: Grisha)

Tracking

(Blocks: 1 bug)

unspecified
Points:
---

Firefox Tracking Flags

(fennec+)

Details

(Reporter)

Description

a year ago
* 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
(Reporter)

Updated

a year ago
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)
(Reporter)

Comment 2

a year ago
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)

Updated

11 months ago
Assignee: gkruglov → nobody
(Assignee)

Updated

11 months ago
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

Updated

6 months ago
Product: Android Background Services → Firefox for Android
(Assignee)

Updated

5 months ago
Priority: P1 → P2
You need to log in before you can comment on or make changes to this bug.