Closed Bug 826409 Opened 8 years ago Closed 8 years ago

Remove onBeforeDeleteURI and onBeforeItemRemoved notifications


(Toolkit :: Places, defect)

Not set





(Reporter: mak, Assigned: mak)



(Keywords: addon-compat, dev-doc-needed, Whiteboard: [sync:bookmarks][sync:history])


(1 file)

These notifications were added originally to allow Sync to collect information before a place is gone, but currently all of the information is provided already in onDeleteURI and onItemRemoved, so the Before notifications may likely go.

Though, the actual reason for the removal is that with off main-thread removals they complicate things too much, since we must collect places to remove off main-thread, notify onBefore on main-thread, proceed with removal off main-thread, notify removal on main-thread.
This adds lot of complication to properly synchronize all of the runnables, once we enter the "other" thread, we'd like to stay there until we're done.

We should verify if Sync and Places code can live without onBefore notifications, deprecate them, and finally remove them.
Depends on: 826421
This is ready for you, mak!
Whiteboard: [sync:bookmarks][sync:history]
Assignee: nobody → mak77
Blocks: 834457
Summary: Deprecate onBeforeDeleteURI and onBeforeItemRemoved notifications → Remove onBeforeDeleteURI and onBeforeItemRemoved notifications
Attached patch patch v1.0Splinter Review
it's a big patch, but basically just removals.

I'm now going to file a bug for Seamonkey, but it's not blocking since even if js consumers have these methods defined nothing bad happens.
Attachment #710373 - Flags: review?(mano)
Blocks: 838333
Comment on attachment 710373 [details] [diff] [review]
patch v1.0

This one was easy.
Attachment #710373 - Flags: review?(mano) → review+
Comment on attachment 710373 [details] [diff] [review]
patch v1.0

Asking SR for the removal of the 2 notifications
Attachment #710373 - Flags: superreview?(
Keywords: addon-compat
Attachment #710373 - Flags: superreview?( → superreview+
Thanks, this has also been notified through, on planet firefox and planet mozilla.
I also brefly discussed (right now) with TheOne who had an add-on using this notification and looks like he doesn't really need it, onItemRemoved covers most cases we thought about.
for authors, notice onItemRemoved you get the parentId, this is valid and you can use it without any problem (items are notified before their containing folders), for example to check if an item is a tag.
onItemRemoved has also many new information compared to what it was when the Before version was introduced.
Keywords: dev-doc-needed
fixed a minor typo in test_placesTxn and landed:
Target Milestone: --- → mozilla21
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.