Closed
Bug 1116446
Opened 10 years ago
Closed 10 years ago
Cannot restore bookmarks from backup JSON file.
Categories
(SeaMonkey :: Bookmarks & History, defect)
SeaMonkey
Bookmarks & History
Tracking
(seamonkey2.30 wontfix, seamonkey2.31 wontfix, seamonkey2.32+ fixed, seamonkey2.33+ fixed, seamonkey2.34+ fixed)
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(3 files, 2 obsolete files)
|
4.35 KB,
patch
|
neil
:
review+
iannbugzilla
:
approval-comm-aurora+
iannbugzilla
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
|
1.21 KB,
patch
|
neil
:
review+
iannbugzilla
:
approval-comm-aurora+
iannbugzilla
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
|
2.18 KB,
patch
|
neil
:
review+
iannbugzilla
:
approval-comm-aurora+
iannbugzilla
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
bug 852034 replaces PlacesUtils.restoreBookmarksFromJSONFile with BookmarkJSONUtils.importFromFile,
then bug 854288 removes PlacesUtils.restoreBookmarksFromJSONFile.
it breaks the SeaMonkey's bookmark restoration feature, which still uses PlacesUtils.restoreBookmarksFromJSONFile.
http://dxr.mozilla.org/comm-central/source/suite/common/bookmarks/bookmarksManager.js#436
Need to port some of bug 852034's patch to comm-central.
it's also reproducible on SeaMonkey 2.31.
| Assignee | ||
Comment 1•10 years ago
|
||
Also, may need to port some of bug 852041's patch to make _initPlaces asynchronous.
| Assignee | ||
Comment 2•10 years ago
|
||
currently jsonlz4 is used for bookmark backup format,
so this patch is needed to support restore from in-profile backup.
Attachment #8542532 -
Flags: review?(iann_bugzilla)
| Assignee | ||
Comment 3•10 years ago
|
||
This patch fixes Restore menu in bookmark manager.
Attachment #8542533 -
Flags: review?(iann_bugzilla)
| Assignee | ||
Comment 4•10 years ago
|
||
This patch fixes the automated bookmark restoration when database is corrupted.
Tested on Mac OS X 10.9.5 with following steps:
1. run SeaMonkey with clean profile
2. restore from JSON file which is exported from other profile (Part 2)
3. backup to some file, to make backup in bookmarkbakcups folder
4. remove some bookmark items
5. restore from today's backup (Part 1)
6. shutdown SeaMonkey
7. remove places.sqlite
8. run SeaMonkey, and confirm bookmark is restored (Part 3)
Attachment #8542535 -
Flags: review?(iann_bugzilla)
See also, Bug 1061672 - Import json-file from Firefox (or even from SeaMonkey) do not work.
Comment 6•10 years ago
|
||
Comment on attachment 8542532 [details] [diff] [review]
Bug 1116446 Part 1: Support jsonlz4 format for restore in_bookmarksManager_js.patch
Neil may be a better reviewer.
Attachment #8542532 -
Attachment description: 1-Bug_1116446___Part_1__Support_jsonlz4_format_for_restore_in_bookmarksManager_js.patch → 1 Bug_1116446 Part_1 Support jsonlz4 format for restore in_bookmarksManager_js.patch
Attachment #8542532 -
Flags: review?(neil)
Updated•10 years ago
|
Attachment #8542533 -
Flags: review?(neil)
Updated•10 years ago
|
Attachment #8542535 -
Flags: review?(neil)
Updated•10 years ago
|
Attachment #8542532 -
Attachment description: 1 Bug_1116446 Part_1 Support jsonlz4 format for restore in_bookmarksManager_js.patch → Bug 1116446 Part 1: Support jsonlz4 format for restore in_bookmarksManager_js.patch
Comment 7•10 years ago
|
||
Comment on attachment 8542532 [details] [diff] [review]
Bug 1116446 Part 1: Support jsonlz4 format for restore in_bookmarksManager_js.patch
Notwithstanding that the old code used match to test a string against a regexp when it should have used test instead, but not only did you compound the error by adding an endsWidth test instead of extending the existing regexp but you also copied Firefox's error of not testing for the . in the extension.
Attachment #8542532 -
Flags: review?(neil) → review-
Comment 8•10 years ago
|
||
Comment on attachment 8542533 [details] [diff] [review]
Part 2: Use BookmarkJSONUtils.importFromFile instead of PlacesUtils.restoreBookmarksFromJSONFile in bookmarksManager.js.
>+ Task.spawn(function() {
Aren't generators supposed to use function*()?
>+ yield BookmarkJSONUtils.importFromFile(aFile, true);
This wants a path, not an nsIFile object.
>+ }.bind(this));
Rather than bind a generator to a task, might it be easier to catch the rejection on the returned Promise?
Updated•10 years ago
|
Attachment #8542535 -
Flags: review?(neil) → review+
Comment 9•10 years ago
|
||
(In reply to comment #7)
> Notwithstanding that the old code used match to test a string against a
> regexp when it should have used test instead, but not only did you compound
> the error by adding an endsWidth test instead of extending the existing
> regexp but you also copied Firefox's error of not testing for the . in the
> extension.
PlacesBackups.getMostRecentBackup almost has the right regexp, but they still slipped up. Oops!
| Assignee | ||
Comment 10•10 years ago
|
||
Thank you for reviewing :D
merged two tests, and use .test() method.
Attachment #8542532 -
Attachment is obsolete: true
Attachment #8542532 -
Flags: review?(iann_bugzilla)
Attachment #8542597 -
Flags: review?(neil)
| Assignee | ||
Comment 11•10 years ago
|
||
Fixed aFile to aFile.path, and use .catch().
(In reply to neil@parkwaycc.co.uk from comment #8)
> Comment on attachment 8542533 [details] [diff] [review]
> Part 2: Use BookmarkJSONUtils.importFromFile instead of
> PlacesUtils.restoreBookmarksFromJSONFile in bookmarksManager.js.
>
> >+ Task.spawn(function() {
> Aren't generators supposed to use function*()?
Yeah, it also should be addressed in Firefox's side,
we should remove all legacy generator (bug 1083482).
Attachment #8542533 -
Attachment is obsolete: true
Attachment #8542533 -
Flags: review?(neil)
Attachment #8542533 -
Flags: review?(iann_bugzilla)
Attachment #8542598 -
Flags: review?(neil)
Updated•10 years ago
|
Attachment #8542597 -
Flags: review?(neil) → review+
Updated•10 years ago
|
Attachment #8542598 -
Flags: review?(neil) → review+
| Assignee | ||
Updated•10 years ago
|
Attachment #8542535 -
Flags: review?(iann_bugzilla)
Comment 12•10 years ago
|
||
Comment on attachment 8542598 [details] [diff] [review]
Part 2: Use BookmarkJSONUtils.importFromFile instead of PlacesUtils.restoreBookmarksFromJSONFile in bookmarksManager.js.
[Approval Request Comment]
Regression caused by (bug #): bug 852034 bug 854288
User impact if declined: Cannot restore bookmark from backup JSON file
Testing completed (on m-c, etc.): Port of bug 852034 bug 854288
Risk to taking this patch (and alternatives if risky): none bustage fix
String changes made by this patch: None.
Attachment #8542598 -
Flags: approval-comm-beta?
Attachment #8542598 -
Flags: approval-comm-aurora?
Comment 13•10 years ago
|
||
Comment on attachment 8542597 [details] [diff] [review]
Part 1: Support jsonlz4 format for restore in bookmarksManager.js
[Approval Request Comment]
Regression caused by (bug #): bug 852034 bug 854288
User impact if declined: Cannot restore bookmark from backup JSON file
Testing completed (on m-c, etc.): Port of bug 852034 bug 854288
Risk to taking this patch (and alternatives if risky): none bustage fix
String changes made by this patch: None.
Attachment #8542597 -
Flags: approval-comm-beta?
Attachment #8542597 -
Flags: approval-comm-aurora?
Comment 14•10 years ago
|
||
Comment on attachment 8542535 [details] [diff] [review]
Part 3: Use BookmarkJSONUtils.importFromFile instead of PlacesUtils.restoreBookmarksFromJSONFile in nsSuiteGlue.js.
[Approval Request Comment]
Regression caused by (bug #): bug 852034 bug 854288
User impact if declined: Cannot restore bookmark from backup JSON file
Testing completed (on m-c, etc.): Port of bug 852034 bug 854288
Risk to taking this patch (and alternatives if risky): none bustage fix
String changes made by this patch: None.
Attachment #8542535 -
Flags: approval-comm-beta?
Attachment #8542535 -
Flags: approval-comm-aurora?
Updated•10 years ago
|
Assignee: nobody → arai_a
Attachment #8542535 -
Flags: approval-comm-beta?
Attachment #8542535 -
Flags: approval-comm-beta+
Attachment #8542535 -
Flags: approval-comm-aurora?
Attachment #8542535 -
Flags: approval-comm-aurora+
Attachment #8542597 -
Flags: approval-comm-beta?
Attachment #8542597 -
Flags: approval-comm-beta+
Attachment #8542597 -
Flags: approval-comm-aurora?
Attachment #8542597 -
Flags: approval-comm-aurora+
Attachment #8542598 -
Flags: approval-comm-beta?
Attachment #8542598 -
Flags: approval-comm-beta+
Attachment #8542598 -
Flags: approval-comm-aurora?
Attachment #8542598 -
Flags: approval-comm-aurora+
Comment 16•10 years ago
|
||
Pushed to comm-central:
Part 1 http://hg.mozilla.org/comm-central/rev/2781ce3e4d00
Part 2 http://hg.mozilla.org/comm-central/rev/d49fb2508139
Part 3 http://hg.mozilla.org/comm-central/rev/6b1776a1a2f6
Pushed to comm-aurora:
Part 1 http://hg.mozilla.org/releases/comm-aurora/rev/5b15f41fa855
Part 2 http://hg.mozilla.org/releases/comm-aurora/rev/f611e79f87d6
Part 3 http://hg.mozilla.org/releases/comm-aurora/rev/3e14df96f855
Pushed to comm-beta:
Part 1 http://hg.mozilla.org/releases/comm-beta/rev/ba17d6278eee
Part 2 http://hg.mozilla.org/releases/comm-beta/rev/d4bc15898eeb
Part 3 http://hg.mozilla.org/releases/comm-beta/rev/0c59a68dbe20
Status: NEW → RESOLVED
Closed: 10 years ago
status-seamonkey2.30:
--- → wontfix
status-seamonkey2.31:
--- → wontfix
status-seamonkey2.32:
--- → fixed
status-seamonkey2.33:
--- → fixed
status-seamonkey2.34:
--- → fixed
tracking-seamonkey2.32:
--- → +
tracking-seamonkey2.33:
--- → +
tracking-seamonkey2.34:
--- → +
Keywords: checkin-needed
Resolution: --- → FIXED
Summary: Cannot restore bookmark from backup JSON file. → Cannot restore bookmarks from backup JSON file.
Target Milestone: --- → seamonkey2.34
You need to log in
before you can comment on or make changes to this bug.
Description
•