On Mon, Mar 19, 2012 at 7:22 PM, Guilherme Salgado
<[email protected]> wrote:
> Unfortunately, I don't think this actually fixes the bug. AIUI, the email 
> notifications were not being sent because nothing emits an 
> ObjectModifiedEvent(spec) after the spec's work items are changed (which is 
> expected because there are no changes to the spec itself, only to things 
> related to it) and your changes doesn't seem to cause that event to be fired 
> either.  You have the notify(ObjectModifiedEvent(...)) call in your tests, 
> but in production that event is not going to be fired anywhere since the 
> Specification object itself is not changed.  My suggestion was to have 
> updateWorkItems() fire the event, in the same way that Product._setLicenses() 
> (which is very similar to our case in that it changes objects related to the 
> Product but not the Product itself) does.

That's the mystery here. ;) Since I started writing the tests, I ended
up with a call to notify() in updateWorkItems(). Later when I tried to
run the test Launchpad locally I got two notifications for each change
so I removed my call to notify(). Something else is actually seeing
the change on a Specification property and fires the notification in
the running system.

The reason for not getting emails seems to be that nothing in
notify_specification_modified() added appropriate lines for the
workitems delta.

The automagical notify does not happen when running the tests though,
so I followed the example in
lp.bugs.mail.tests.test_assignee_notification_message() which changes
a bugtask property and then fires it's own notification.

> --
> https://code.launchpad.net/~linaro-infrastructure/launchpad/notify-workitems-changes/+merge/98231
> Your team Linaro Infrastructure is subscribed to branch 
> lp:~linaro-infrastructure/launchpad/notify-workitems-changes.

-- 
https://code.launchpad.net/~linaro-infrastructure/launchpad/notify-workitems-changes/+merge/98231
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~linaro-infrastructure/launchpad/notify-workitems-changes into lp:launchpad.

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to