Merge lp:~deryck/launchpad/not-notified-someone-else-subscribed-494257 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Deryck Hodge |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~deryck/launchpad/not-notified-someone-else-subscribed-494257 |
Merge into: | lp:launchpad |
Diff against target: |
177 lines (+31/-13) 6 files modified
lib/canonical/launchpad/javascript/bugs/bugtask-index.js (+4/-2) lib/lp/bugs/browser/bugsubscription.py (+1/-4) lib/lp/bugs/doc/bugsubscription.txt (+15/-3) lib/lp/bugs/interfaces/bug.py (+2/-1) lib/lp/bugs/model/bug.py (+5/-3) lib/lp/bugs/stories/webservice/xx-bug.txt (+4/-0) |
To merge this branch: | bzr merge lp:~deryck/launchpad/not-notified-someone-else-subscribed-494257 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | Approve | ||
Review via email: mp+23044@code.launchpad.net |
Commit message
Notify users when subscribed by someone else, even when subscribed via the JavaScript subscription widget.
Description of the change
This branch fixes bug 494257. Users are not being notified when subscribed by someone else. This is because a notify call is required, which should be passed an ObjectCreatedEvent. This has been happening in browser code before now. The JavaScript inline subscription code calls Bug.subscribe via the API, which hits the model code not the browser code. So no notify calls were made.
I discussed various approached to fixing this with BjornT. I settled on the approach taken here, which is to add a parameter to the model method. There are certain instances were a subscription is added but we don't want to create an additional notification. This happens when bugs are created, for example, when subscriptions are created for structural subscribers.
The doc test is updated to show how to use this additional parameter to create notifications.
./bin/test -cvvt doc/bugsubscrip
The webservice doc test is updated to include the new parameter as an example. The functionality is tested in the previous test, though.
./bin/test -cvvt xx-bug.txt
Finally, the JavaScript is updated to send notifications now.
I want to get this portion of the change reviewed, but I won't land it until I fix Bug #516781, which notes that the inline subscriber test is currently disabled. This shouldn't affect that code at all, but I want to take the chance to re-enable the test and be sure as part of work around this fix.
There are also some minor lint cleanups here, too.
(12:49:34) adeuring: deryck: overall, you branch looks good. I just wondered if it makes sense to explicitly test that bug.subscribe(..., send_notificati ons=False) does indeed not send notifications.
(12:50:01) deryck: adeuring, ah, good point.
(12:50:22) adeuring: deryck: OK, so r=me
(12:50:38) deryck: adeuring, thanks! I'll add the test here in a moment.