Closed Bug 1416577 Opened 2 years ago Closed 2 years ago

bookmarks.removeTree() can remove special Bookmarks (other bookmarks...)

Categories

(WebExtensions :: General, defect)

57 Branch
defect
Not set

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1347386

People

(Reporter: rico.masseran, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20171106144225

Steps to reproduce:

I did a search with an empty string. It returned all the ids of all the bookmarks, and next I removed them.

browser.bookmarks.search({
  title: ""
}).then((searchResults) => {
  searchResults.map((searchResult) => {
    console.log(searchResult.id);
    browser.bookmarks.removeTree(searchResult.id);
  });
}).catch((reason) => {
  reject("StorageManager.Bookmark.cleanGroups failed: " + reason);
});


Actual results:

It removed all the folders even the special ones you can't remove from the UI.

- Bookmarks Toolbar
- Bookmarks Menu
- Other Bookmarks

After that, you can't use the bookmarks any more until you restart Firefox. Then, the special bookmarks reappear but are empty.


Expected results:

Raise an error when someone try to delete a special bookmark folder.
Updated code for reproducing the bug:


browser.bookmarks.search({
  title: ""
}).then((searchResults) => {
  searchResults.map((searchResult) => {
    console.log(searchResult.id);
    browser.bookmarks.removeTree(searchResult.id);
  });
}).catch((reason) => {

});
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1347386
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.