Closed Bug 629515 Opened 13 years ago Closed 13 years ago

Notifications: De-duplicate across multiple events

Categories

(support.mozilla.org :: General, defect, P1)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: erik, Unassigned)

Details

Brain dump of a possible "union" operator for firing multiple events together
and de-duplicating the results:

union(ThreadEvent(post), ForumEvent(post)).fire()  # Fire the first arg,
passing to it the union of .users_watching() on all args. Use this when the
content of each arg's template is essentially the same, e.g. "This new post was
made. Enjoy."—when the receipt of a mail from the 2nd template as well would
add no value. (The fact that there's an unsubscribe link to only the first
event's watch is acceptable. It's a convenience only, and they can always visit
their user dashboard.) If the 2nd one would add value, you should probably fire
both events independently and let both mails be delivered. {Or is
fire_union(...) better?) (To implement, have union return an instance of a
special class which has state which can hold the args, which can get pickled.)
This just got really nice to have, because we have to do it in the forums app when someone is watching both the Forum and a Thread within it.
Priority: P3 → P1
And when you finish this, replace the call to the set() constructor in the forum views with it.
Remember to un-skip the forums test for this, found in forums/tests/test_notifications.py:NotificationsTests.test_watch_both_then_new_post
Done in https://github.com/jsocol/kitsune/commit/3970e691cbaa90e3b1976e6e17137b58d7aa8935.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Verified user signed up to watch both the forum and the thread only receives one notification for an update to either.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.