New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 861691 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Feature



Sign in to add a comment

Provide cross devices consistent id for BookmarkTreeNode

Reported by han.guo...@gmail.com, Jul 9

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

Steps to reproduce the problem:
In chrome extensions api for Bookmarks, The id of BookmarkTreeNode is not consistent in different device for the same profile. For example, the id bookmark A on device X is 456, but it's 789 on device Y for the same user.

API reference: https://developer.chrome.com/extensions/bookmarks#type-BookmarkTreeNode

What is the expected behavior?
Hope Chrome supply another property, that is a consistent id on different devices for extension developer.

What went wrong?
I can see BookmarkTreeNode's id is called "External ID" at chrome://sync-internals/ . The same bookmark on different devices has different External ID. That is ok for local machine bookmarks management, But If a developer need to save the bookmark id in chrome.storage.sync or cloud and use it to get that bookmark, the id need to be consistent, otherwise it can't find the bookmark on other device.

WebStore page: 

Did this work before? N/A 

Chrome version: 67.0.3396.99  Channel: stable
OS Version: OS X 10.13.5
Flash Version:
 
Labels: Needs-Triage-M67
Labels: -Type-Bug Triaged-ET M-69 Target-69 FoundIn-69 OS-Linux OS-Windows Type-Feature
Status: Untriaged (was: Unconfirmed)
As per comment#0 it seems to a feature request.

Hence, making it as untriaged and asking dev team to kindly look  into it.

Thanks...!!
Components: UI>Browser>Bookmarks Services>Sync
Status: Available (was: Untriaged)
This would be pretty cool, but might require a significant change to the bookmarks code.  I don't think this is something we'll get to in the immediate future, but if someone wanted to investigate this, we'd be happy to offer guidance!
Labels: -Pri-2 -M-69 -FoundIn-69 -Target-69 -Needs-Triage-M67 OS-Chrome Pri-3
TBH I don't think this is feasible. Sync has to support merging two bookmarks trees, and at that point we'd have to re-assign IDs  (when two identical bookmarks have different IDs, or when the same ID is used for different bookmarks), basically breaking the current promise.
Owner: mamir@chromium.org
Status: Assigned (was: Available)
mamir@: Do you think this is feasible with the new bookmarks Sync design? If not, it's probably fair to close this as WontFix/infeasible.
Introducing stable ids for bookmarks is something that we considered and thoroughly investigated.
The new bookmarks sync design doesn't necessarily make it easier or harder.

I think the issue of merging two bookmark trees isn't the show stopper.
We could at least try to keep this promise across all sync'ing devices. (after the initial sync)

The least intrusive solution that comes to my mind is to store the sync_server_id in the bookmark model itself, such that the bookmark API can provide this id as a stable id for this bookmark across devices.

It's worth noting though that this approach won't benefit sync merge logic, because such id will only be available after the initial sync is finished.

I think if there is a clear use case for that, this could be something we can move forward.

My initial use case is to display a list of user-customized websites(title and link), like many new tab extensions did. 

To implement this, one way is to save a list of user selected bookmarks(an array of bookmark id) in chrome.storage.sync/local . That is ok if only used on the same device. But it is not feasible for cross devices, for example, saving bookmark ids in chrome.storage.sync. Although chrome.storage.sync is cross devices synced, but bookmark id has changed on other devices. 

If don't use build-in bookmarks for websites, use chrome.storage.local to save [[title, link], ... ] directly. It also works locally, but doesn't work cross devices. Because chrome.storage.sync is very limited size(102KB) for storage, it is not suitable for storing lots of titles and links.

So it’s hard to implement this if only use chrome extensions internal mechanisms.

Another possible way is to implement a backend service that can auth user and provide cloud storage. This way bypasses chrome internal restrictions, but need to implement a backend service. Implementing a backend service(or using firebase) is not easy compared with using chrome internal mechanisms. PS: I have implemented this using firebase.

This is why I originally wanted bookmarks id is consistent on different devices.

Sign in to add a comment