Closed Bug 385771 Opened 17 years ago Closed 17 years ago

disallow item-annotations for invalid item ids

Categories

(Firefox :: Bookmarks & History, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3 alpha6

People

(Reporter: moco, Assigned: asaf)

References

Details

Attachments

(2 files)

assertion when you bookmark a page and you've got stale annotations

mano fixed bug #375629, so we should be deleting annotations.

but with older profiles before his fix (or not sure how?) people can end up in a state with bookmarkPropertiesDialog/lastUsed annotations that point to folders that don't exist.

Additionally (in the case of one user, :stephend), one bookmarkPropertiesDialog/lastUsed annotation pointed to item_id of 0.

We should not gracefully handle this, but in debug and nightly builds users like stephend will see an assert (see screen shot #1).

One idea:  on detecting this (or other?) stale annotations, remove them.
what we really should do is validate aItemId in SetItemAnnotation*
Assignee: nobody → mano
Summary: assertion when you bookmark a page and you've got stale annotations, should we remove them? → disallow item-annoations for invalid item ids
Summary: disallow item-annoations for invalid item ids → disallow item-annotations for invalid item ids
Attached patch patchSplinter Review
Attachment #269756 - Flags: review?(dietrich)
Comment on attachment 269756 [details] [diff] [review]
patch

r=me, thanks.
Attachment #269756 - Flags: review?(dietrich) → review+
mozilla/toolkit/components/places/src/nsAnnotationService.cpp 1.25
mozilla/toolkit/components/places/src/nsNavBookmarks.cpp 1.104
mozilla/toolkit/components/places/src/nsNavBookmarks.h 1.44
mozilla/toolkit/components/places/tests/unit/test_annotations.js 1.9
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3 alpha6
Am I right to infer this change doesn't remove already-written invalid item IDs, it just prevents them from being written incorrectly in the future?  (If not, I still see https://bugzilla.mozilla.org/attachment.cgi?id=269681 in today's trunk build.)
Right.
asaf:  based on stephen's question and your response, I think we should spin up another bug about the assertion, and about "on detecting this (or other?) stale annotations, remove them".
I don't think it's worth it given that
 1. JS-Assertions will be turned off post-beta
 2. You cannot get into this state starting with a6.
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".

In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body   contains   places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.

Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.

Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: