Comment 3 for bug 365092

Revision history for this message
Abel Deuring (adeuring) wrote :

We should consider to add constraints ensuring that each message
has at least one MessageChunk, but I am not 100% sure about bad
side effects. Aside form the OOPS described here we also have
bug 674759. While this bug is not as serious as this one, it is
at least annoying for the LOSAs.

Note that including the empty message causing this OOPS in
the result returned by
lp.bugs.browser.bugcomment.build_comments_from_chunks() would
have another bad side effect: The comment index, as used in
the last path element of bug comment URLs like
https://bugs.launchpad.net/ubuntu/+source/compiz-fusion-plugins-main/+bug/183685/comments/497
is the index of a comment in the list returned by
build_comments_from_chunks(). If the function would include
empty comments/messages, we might change a considerable number
of URLs.

Attached is a DB patch that should ensure that each bug message
has at least one MessageChunk.

Adding this constraint would not fix this bug, but it would help us
figure out how/where the empty messages are created.

A possible candidate is lp.bugs.browser.bugmessage.BugMessageAddFormView:
The method save_action() _can_ create messages that reference
a bug watch but are otherwise empty. But the template containing
the HTML form used by this class does not contain a field for
bug watches...