Bug 1158020 - Allow deleting bookmarks from the UI #374
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Argh. This turns out to be more complex than it should be. The crux of the problem is a tiny little bug. When we query for the "root" bookmarks right now, we query for those with a parentGuid = nil (although I don't think we quite even do that). We then store them in a folder with guid = PLACES_FOLDER_GUID. Later, if you try to reload that cursor, we query for those with parentGuid = BookmarkRoots.PLACES_FOLDER_GUID, which returns nothing (because we don't actually store parents right now).
Some of these issues are just things that aren't hooked up (storing parents) but a bunch of them just stem from us conflating ids and guids. Neither of those need to actually ever be exposed anywhere anyway. This fixes that. i.e.
1.) Guids and IDs aren't exposed outside storage. You don't need to know about them.
2.) All the API's using guids are done away with. Guids are for sync AFAIK. We have stable ids in our DB, so we don't need 'em.
3.) We create a default "folder" for Places when the db is created. We needs it id so that everything that gets added (right now) can be put inside it. Parent can now never be null (even Places points to 0, which is a non-bookmark).
4.) We actually store the parent id when we add a bookmark.