Comment 36 for bug 336866

Revision history for this message
James Westby (james-w) wrote :

Right, I can still reproduce by doing

  bug = lp.bugs[12345]
  bug.newMessage(content="foo", subject="bar)
  bug.tags = ["foo"]
  bug.lp_save()

because date_last_updated and date_last_message change when we call the
newMessage method, but we don't update the representation.

The original fix for this bug was server side. Leonard, is there something we can
change server side for this?

On the client side, we could fix this problem by changing NamedOpearation.__call__
which currently does

        if response.status == 201:
            return self._handle_201_response(url, response, content)
        else:
            if http_method == 'post':
                # The method call probably modified this resource in
                # an unknown way. Refresh its representation.
                self.resource.lp_refresh()
            return self._handle_200_response(url, response, content)

where we could move the the if http_method block outside the other if block, so that
we refresh when we create the new message.

What's the best approach?

Thanks,

James