API named operations that modify an object don't always return the modified object

Bug #369293 reported by Deryck Hodge
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned
lazr.restful
Triaged
Low
Unassigned
lazr.restfulclient
Triaged
Low
Unassigned

Bug Description

I ran into an issue with the JavaScript client where a named operation that modified a bugtask object didn't return the modified object; then subsequent calls to lp_save would generate a 412 Precondition failed error (like bug #336866).

In talking about this with leonardr on IRC, it seems named operations really should return the modified object with a 209 response code. The Python and JavaScript clients should handle this correctly then.

Tags: tech-debt
affects: launchpad → lazr.restful
Curtis Hovey (sinzui)
tags: added: tech-debt
Changed in lazr.restful:
status: New → Triaged
Changed in lazr.restfulclient:
status: New → Triaged
Changed in lazr.restful:
importance: Undecided → Medium
Changed in lazr.restfulclient:
importance: Undecided → Medium
Ian Booth (wallyworld)
Changed in launchpad:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Robert Collins (lifeless) wrote :

How would we tell a-priori whether a given named operation mutates the object or not?

Changed in launchpad:
importance: Medium → High
Changed in lazr.restfulclient:
importance: Medium → High
Changed in lazr.restful:
importance: Medium → High
Revision history for this message
Aaron Bentley (abentley) wrote :

@lifeless: ObjectModifiedEvents? :-)

Revision history for this message
Gary Poster (gary) wrote :

unfortunately we do not fire events reliably at all.

I don't know of an a priori way with Launchpad named operations.

I suspect Leonard would have wanted the proposed generic collection-based REST api to normalize these sorts of questions, drastically reducing the number of named operations needed, and thus the amount of analysis we would need to determine whether a given named operation were a modifier. That sounds good to me. I'm sure we could come with other conventions/constraints. None of these solutions are trivial, afaik.

summary: - API named operations that modify an object should return the modified
- object
+ API named operations that modify an object don't always return the
+ modified object
Changed in lazr.restfulclient:
importance: High → Low
Changed in lazr.restful:
importance: High → Low
Changed in launchpad:
importance: High → Low
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.