successful write with If-Match can return stale values

Bug #871944 reported by Gary Poster on 2011-10-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Critical
Gary Poster
lazr.restful
Critical
Gary Poster

Bug Description

If you include an If-Match header when writing, such as with a PATCH, the cache can be populated with values that are not correctly cleared when changed.

This is because the FieldUnmarshallerMixin handles the _unmarshalled_field_cache in a naive way: it assumes that attribute names on an entry will be the same as on the context that it wraps. This assumption breaks with, for instance, a user's display name, which is display_name on the Entry but displayname on the user object itself. When the assumption breaks, changes are not noticed within the request, and return values are stale.

I have a fix locally that passes a Launchpad integration test where I discovered the problem. I will add a lazr.restful test and see if the tests pass with my change.

Related branches

Gary Poster (gary) wrote :

Lines 368-382 of http://bazaar.launchpad.net/~launchpad-pqm/launchpad/stable/view/12450/lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js show that this is a regression, at least for a user's display_name. It was working when this Windmill test was part of Launchpad's suite. (I am in the process of rewriting these tests with our new YUI integration test machinery: see bug 724609.)

Changed in lazr.restful:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Gary Poster (gary)
tags: added: regression
Gary Poster (gary) on 2011-10-11
Changed in lazr.restful:
status: Triaged → In Progress
Gary Poster (gary) on 2011-10-12
Changed in lazr.restful:
status: In Progress → Fix Released
Changed in launchpad:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Gary Poster (gary)
status: Triaged → In Progress
Gary Poster (gary) on 2011-10-12
Changed in launchpad:
status: In Progress → Fix Committed
William Grant (wgrant) on 2011-10-17
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers