Open Bug 1419674 Opened 7 years ago Updated 2 years ago

Firefox duplicate bookmarks from distribution.ini on version upgrade

Categories

(Firefox :: General, defect, P5)

defect

Tracking

()

People

(Reporter: murznn, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build ID: 20171009090302 Steps to reproduce: I already have large list of bookmarks in distribution.ini file and want to add only one new bookmark to all users, together with already exists. So I add new BookmarksToolbar item (with new numeric id) to distribution.ini file as new element, upgrade distribution version and reset distribution.mydistributionid.bookmarksProcessed value to false Actual results: Users got duplicates of each old bookmark, already created earlier in bookmarks toolbar! Expected results: Firefox must create only one new bookmark, added in new version. For do this - Firefox must check if each bookmark is already exists in current user bookmarks list, and create new element only if it not already exists, for prevent adding clones each time when distribution version is updated.
And will be good to provide some unique identifier like "guid" to bookmarks items in distribution.ini file, for allow updating previous bookmark items (renaming, changing url, deleting).
Component: Untriaged → Places
Product: Firefox → Toolkit
distribution.js could probably annotate the bookmarks with an item annotation, and on upgrade remove the annotated bookmarks before inserting the new ones. I'm not sure it would be 100% fine with Sync though, but it would be a start. Another alternative, as suggested, could be to use special numbered guids like "distr_ini-NN", then loop the counter until remove throws because it can't find the given bookmark (untested but may do). The only downside of a plain removal is that the position of the original bookmarks would be lost (if the user moved them around). Both solutions are feasible with the current Places APIs and it seems just matter of implementing them in distribution.js I honestly think this may need someone from the community to contribute a fix, I doubt it could be considered a priority with all the things already ongoing in Firefox.
Status: UNCONFIRMED → NEW
Component: Places → General
Ever confirmed: true
Product: Toolkit → Firefox
Maybe related is bug 1177516, where we'd like default bookmarks to have guids, so we can store tombstones and not have then resurrect when a new device is added.
The distribution.ini mechanism wasn't really intended for this, and we're not enhancing this part of the product. FYI the CCK2 supports something like this
Will consider a patch from the community with this enhancement, per ::mak in comment #2.
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.