Last Comment Bug 826409 - Remove onBeforeDeleteURI and onBeforeItemRemoved notifications
: Remove onBeforeDeleteURI and onBeforeItemRemoved notifications
: addon-compat, dev-doc-needed
Product: Toolkit
Classification: Components
Component: Places (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla21
Assigned To: Marco Bonardo [::mak]
: Marco Bonardo [::mak]
Depends on: 826421
Blocks: 834457 838333
  Show dependency treegraph
Reported: 2013-01-03 12:09 PST by Marco Bonardo [::mak]
Modified: 2013-02-06 18:08 PST (History)
8 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch v1.0 (82.41 KB, patch)
2013-02-05 14:03 PST, Marco Bonardo [::mak]
asaf: review+ superreview+
Details | Diff | Splinter Review

Description User image Marco Bonardo [::mak] 2013-01-03 12:09:44 PST
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.
Comment 1 User image Richard Newman [:rnewman] 2013-01-15 23:22:57 PST
This is ready for you, mak!
Comment 2 User image Marco Bonardo [::mak] 2013-02-05 14:03:38 PST
Created attachment 710373 [details] [diff] [review]
patch v1.0

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.
Comment 3 User image Mano (::mano, needinfo? for any questions; not reading general bugmail) 2013-02-06 04:56:07 PST
Comment on attachment 710373 [details] [diff] [review]
patch v1.0

This one was easy.
Comment 4 User image Marco Bonardo [::mak] 2013-02-06 05:49:37 PST
Comment on attachment 710373 [details] [diff] [review]
patch v1.0

Asking SR for the removal of the 2 notifications
Comment 6 User image Marco Bonardo [::mak] 2013-02-06 11:34:37 PST
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.
Comment 7 User image Marco Bonardo [::mak] 2013-02-06 11:37:59 PST
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.
Comment 8 User image Marco Bonardo [::mak] 2013-02-06 11:58:02 PST
fixed a minor typo in test_placesTxn and landed:
Comment 9 User image Ryan VanderMeulen [:RyanVM] 2013-02-06 18:08:59 PST

Note You need to log in before you can comment on or make changes to this bug.