Closed
Bug 1217463
Opened 9 years ago
Closed 9 years ago
Deal with case where 'places' bookmark is missing.
Categories
(Firefox OS Graveyard :: Sync, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
FxOS-S10 (30Oct)
People
(Reporter: mbdejong, Assigned: danhuang)
References
Details
Attachments
(1 file)
The test account sync2dot5@mailinator has no bookmarks folder with id 'places' (even though the parentId of the 'unfiled' folder is set to 'places').
Reporter | ||
Updated•9 years ago
|
Priority: -- → P1
Target Milestone: --- → FxOS-S10 (30Oct)
Reporter | ||
Comment 1•9 years ago
|
||
It seems this happens when you create a new account, but don't go into the Bookmarks manager to create any folders.
Comment 2•9 years ago
|
||
https://github.com/ferjm/gaia/commit/1fa877f130100aee48d3823c7d3cb521a876343a#diff-ed4ae19263bf74556f7542b37c38dbefR64 I think that line needs to be SyncBrowserDB.getBookmark({ parentid: 'places' }, bookmark => {...});
Updated•9 years ago
|
Flags: needinfo?(selee)
Comment 3•9 years ago
|
||
Here is the sample code to fix the case: SyncBrowserDB.getBookmark({ parentid: 'places' }, bookmark => { // make sure if firefox synced data saved in indexdDB if(bookmark) { this.cache.push({ id: 'places', // XXX we need UX's suggestion to have a folder name for root folder // and don't forget to handle l10n case. title: 'Synced Bookmarks', type: 'folder', readOnly: true }); } // get bookmark data from origin indexdDB BrowserDB.getBookmarks(bookmarks => { this.cache = this.cache.concat(bookmarks); resolve(); }); });
Flags: needinfo?(selee)
Comment 4•9 years ago
|
||
Hey Dan, Could you give your comments here for this case? Thank you.
Flags: needinfo?(dhuang)
Assignee | ||
Comment 5•9 years ago
|
||
Fernando and Sean's sample code looks good to me. I will fix this.
Flags: needinfo?(dhuang)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → dhuang
Comment 6•9 years ago
|
||
Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8678730 [details] [review] [gaia] danhuang1202:1217463_deal_places_not_exist > mozilla-b2g:master Please help me to review. This patch update the way to check if the synced bookmark data is saved in indexedDB. Thanks.
Attachment #8678730 -
Flags: review?(selee)
Comment 8•9 years ago
|
||
Comment on attachment 8678730 [details] [review] [gaia] danhuang1202:1217463_deal_places_not_exist > mozilla-b2g:master LGTM. Thanks :)
Attachment #8678730 -
Flags: review?(selee) → review+
Comment 9•9 years ago
|
||
Dan, please see my comments and fix them. Thank you!
Assignee | ||
Comment 10•9 years ago
|
||
Thank for the review. merge in master: https://github.com/mozilla-b2g/gaia/commit/f847caf6826baca3d31543c9e2593abfff0d8b70
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•