Remove onBeforeDeleteURI and onBeforeItemRemoved notifications

RESOLVED FIXED in mozilla21

Status

()

defect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: mak, Assigned: mak)

Tracking

({addon-compat, dev-doc-needed})

Trunk
mozilla21
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sync:bookmarks][sync:history])

Attachments

(1 attachment)

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
Status: NEW → ASSIGNED
Blocks: 834457
Summary: Deprecate onBeforeDeleteURI and onBeforeItemRemoved notifications → Remove onBeforeDeleteURI and onBeforeItemRemoved notifications
Posted 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?(gavin.sharp)
Attachment #710373 - Flags: superreview?(gavin.sharp) → superreview+
Thanks, this has also been notified through mozilla.dev.extensions, 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.
fixed a minor typo in test_placesTxn and landed:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e913428a6628
Target Milestone: --- → mozilla21
https://hg.mozilla.org/mozilla-central/rev/e913428a6628
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.