Open
Bug 1332702
Opened 7 years ago
Updated 1 year ago
Ignore keyword insertion failures when importing bookmarks
Categories
(Firefox :: Bookmarks & History, defect, P3)
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox53 | --- | affected |
People
(Reporter: StefanG_QA, Unassigned)
References
Details
(Keywords: papercut, Whiteboard: [snt-scrubbed][places-papercut])
Attachments
(2 files)
Mozilla/5.0(Macintosh; Intel Mac OS X 10.11; rv:53.0)Gecko/20100101 Firefox/53.0 Precondition: Download AboutSync addon: https://addons.mozilla.org/en-US/firefox/addon/about-sync/ Step 1. Launch firefox with an existing sync account 2. Go to Menu Bar > Bookmarks > Show all bookmarks 3. Click on Backup from "Import and Backup" drop down list 4. Save Bookmarks as Json file 5. Add, Edit, Delete bookmarks from the account profile, trigger sync and wait for finish 6. In About Sync, verify that there are no bookmarks missing from the server 7. Close and reopen Firefox with the same profile 8. Go to Menu Bar > Bookmarks > Show all bookmarks 9. Click on "Import and Backup" and select Restore -> Choose file 10. Select backed up file from step 4 to restore 11. Click Ok 12. Trigger Sync and wait for it to finish 13. In About Sync, verify that there are no bookmarks missing from the server AR: About:Sync shows wrong message "Unable to process backup file" while the bookmarks are imported correctly (see the attached screenshot) ER: The backup file is imported correctly, About:Sync show successful message
Comment 1•7 years ago
|
||
I encountered this issue too one time on Windows 10. When I tried second time to restore same bookmarks json file, it got imported without any issue. Note: Backup json file is from some other old profile.
Updated•7 years ago
|
Flags: needinfo?(mark.page)
Comment 2•7 years ago
|
||
It's not clear to me what About Sync has to do with this. From the screenshot, it looks like that's the Library UI, and About Sync isn't involved at all? The code that shows the error is at http://searchfox.org/mozilla-central/rev/30fcf167af036aeddf322de44a2fadd370acfd2f/browser/components/places/content/places.js#515-521, but we don't log why `BookmarkJSONUtils.importFromFile` threw. Mak, do you think it's worth adding a `Cu.reportError` call here? It's also interesting that Stefan and Kanchan's bookmarks were imported successfully, despite the error, and that importing again makes the error go away.
Component: WebExtensions: General → Bookmarks & History
Flags: needinfo?(mark.page) → needinfo?(mak77)
Product: Toolkit → Firefox
Summary: About Sync shows "Unable to process the backup file" message when importing bookmarks from JSON backup file while the file is imported correctly → "Unable to process the backup file" when importing bookmarks from JSON backup, but the bookmarks are imported correctly
Comment 3•7 years ago
|
||
(In reply to Kit Cambridge [:kitcambridge] from comment #2) > involved at all? The code that shows the error is at > http://searchfox.org/mozilla-central/rev/ > 30fcf167af036aeddf322de44a2fadd370acfd2f/browser/components/places/content/ > places.js#515-521, but we don't log why `BookmarkJSONUtils.importFromFile` > threw. > > Mak, do you think it's worth adding a `Cu.reportError` call here? That method uses importFromFile that already has a reportError: Cu.reportError("Failed to restore bookmarks from " + aFilePath + ": " + ex); It would be useful to know what it printed to the console. > It's also > interesting that Stefan and Kanchan's bookmarks were imported successfully, > despite the error, and that importing again makes the error go away. It depends on what we mean by imported successfully, it's possible the process worked 99%, but missed something that may not be easily detectable through the ui. For example, it may have failed to create a keyword? OR maybe something was just busy and the first time it threw? Many things may go wrong without being clearly visible in the UI.
Flags: needinfo?(mak77)
Comment 4•7 years ago
|
||
stefan, could you please report the Browser console output?
Flags: needinfo?(stefan.georgiev)
Reporter | ||
Comment 5•7 years ago
|
||
Please find the requested Browser Console output as an attached txt file
Flags: needinfo?(stefan.georgiev)
Comment 6•7 years ago
|
||
UNIQUE constraint failed: moz_keywords.keyword BookmarkJSONUtils.jsm:111
Comment 7•7 years ago
|
||
Looks like the restore tries to recreate an already existing keyword. I think we may want to ignore keyword insertion errors, regardless "Unable to process backup file" is not a good error to show to the user for this case. We should probably differentiate a complete failure (invalid file) from a partial failure ("We were unable to import some of the items"). This bug could cover figuring out a better error message. That said, there is probably a race condition here. We remove all the bookmarks to start restoring, keywords observe bookmarks removal and start their removal. The restore process may begin before the keywords work is done, and then effectively we could miss restoring a keyword because the insertion fails and there's a pending removal. We could: 1. find a way to wait for pending keywords work, but that sounds hackish. 2. explicitly remove all the keywords before starting removing bookmarks. The problem is that once keywords are decoupled from bookmarks (bug 648398), this may end up removing too much. 3. in the keywords bookmarks observer abort a keyword deletion if in the meanwhile someone tries to insert the same keyword OR if there are pending observer operations yield on those before doing the insertion. Solution 3 looks like the best one, so far.
Priority: -- → P2
Updated•6 years ago
|
Whiteboard: [fxsearch]
Comment 9•5 years ago
|
||
Stefan, are you still able to reproduce this?
If you can, would you be able to share the bookmarks file?
I think Marco's comments in comment 7 aren't quite right, because he was assuming we're not waiting for the keywords removal to happen, when in fact we are.
Flags: needinfo?(stefan.georgiev)
Updated•4 years ago
|
Flags: needinfo?(stefan.georgiev)
Updated•2 years ago
|
Severity: normal → S3
Comment 10•1 year ago
|
||
The main issue we should look at is ignore keyword insertion failures for existing keywords whilst restoring the bookmark.
Keywords: papercut
Priority: P2 → P3
Summary: "Unable to process the backup file" when importing bookmarks from JSON backup, but the bookmarks are imported correctly → Ignore keyword insertion failures when importing bookmarks
Whiteboard: [fxsearch] → [snt-scrubbed][places-papercut]
Updated•1 year ago
|
See Also: → https://mozilla-hub.atlassian.net/browse/SNT-393
You need to log in
before you can comment on or make changes to this bug.
Description
•