Webservice occasionally breaks lp.bugs.subscribers.what_changed

Bug #705955 reported by Graham Binns
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

What happens:
IObjectModifiedEvent is a little ambiguous. The definition of its edited_fields attribute is:

    edited_fields = Attribute(
        "The list of fields that were edited. A field name may appear in "
        "this list if it were shown on an edit form, but not actually "
        "changed.")

This doesn't clarify whether the list should be a list of field instances or of field names (though it implies the latter).

In lp.bugs.subscribers.bugactivity.what_changed, edited_fields is expected to be a list of field names (which makes sense in the context of dealing with web forms). However, the WebService appears, under certain circumstances, to create ObjectModifiedEvents where the edited_fields list is a list of field instances rather than fieldnames. This causes what_changed to break in an hilarious fashion.

To reproduce:
Remove the "if IField.providedBy(fieldname):..." block on on line 80 of lib/lp/bugs/subscribers/bugactivity.py and run `bin/test -cvvt webservice/xx-bugs.txt` to exercise the webservice code that causes the problem.

Tags: easy tech-debt
tags: added: easy tech-debt
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.