Make sure the last_updated review request draft field is properly set after updating the draft.
Review Request #13260 — Created Sept. 6, 2023 and submitted
We've had a longstanding bug where a review request draft would be updated, but
we would still display old cached data for the draft upon page reloads. While
we rely on theReviewRequestDraft.last_updated
field when generating ETags
for a review request page, this field wasn't being properly updated when a
draft gets updated, so we wouldn't catch that the ETag was stale.In conjuction with /r/13261, this fixes the caching issue by making sure that
thelast_updated
field gets updated whenever a field is modified in a draft,
or when an associated file attachment is created/deleted/updated.This change also updates some file attachment unit tests to take into account
the one extra query that is being performed when saving thelast_updated
field on review reuqest drafts.
Tested with the /r/13261 change.
- Ran unit tests.
- Tested updating a review request draft by updating each of the fields,
information (bugs, depends on, etc) and updating file attachments, saw
thatlast_updated
was updated correctly. - Tested updating the change description, saw that it didn't update
last_updated
. - Tested manually setting
last_updated
to a value during saving, saw that
value being used instead oftimezone.now()
to make sure that we don't
overwrite any manually set values.
Summary | ID |
---|---|
3f335c363cc5227e513db36b5963ed37c7310dd4 |
- Change Summary:
-
- Rebased onto the new file attachment changes that were merged into
release-6.x
- Added the extra query to the appropriate unit tests.
- Rebased onto the new file attachment changes that were merged into
- Description:
-
We've had a longstanding bug where a review request draft would be updated, but
we would still display old cached data for the draft upon page reloads. While we rely on the ReviewRequestDraft.last_updated
field when generating ETagsfor a review request page, this field wasn't being properly updated when a draft gets updated, so we wouldn't catch that the ETag was stale. In conjuction with /r/13261, this fixes the caching issue by making sure that
the last_updated
field gets updated whenever a field is modified in a draft,or when an associated file attachment is created/deleted/updated. + + This change also updates some file attachment unit tests to take into account
+ the one extra query that is being performed when saving the last_updated
+ field on review reuqest drafts. - Commits:
-
Summary ID 6db5f94b321d1308dfcce93441d99d1042941b3a 3f335c363cc5227e513db36b5963ed37c7310dd4 - Diff:
-
Revision 2 (+262 -54)