Comment 5 for bug 720147

Revision history for this message
Gavin Panella (allenap) wrote :

I created my subscription filter in the long dark days before the
overlay. Psh, kids of today, they don't know how easy they have it!

I think the problem lies in FileBugViewBase.submit_bug_action:

        self.added_bug = bug = context.createBug(params)

        # Apply any extra options given by a bug supervisor.
        bugtask = self.added_bug.default_bugtask
        if 'assignee' in data:
            bugtask.transitionToAssignee(data['assignee'])
        if 'status' in data:
            bugtask.transitionToStatus(data['status'], self.user)
        if 'importance' in data:
            bugtask.transitionToImportance(data['importance'], self.user)

The call to context.createBug(...) fires an ObjectCreatedEvent, which
is probably where notifications to subscribers are sent... *before*
the status is updated.

Now, status can be set on the CreateBugParams object that is passed
into createBug(), but not importance for example, so a general fix is
not possible down that road without adding more to CreateBugParams.

A general fix might involve delaying the notification of the
ObjectCreatedEvent within createBug(). createBugWithoutTarget() is an
example of how a similar problem has been solved in the past.