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

Information

Review Board
release-6.x

Reviewers

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 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
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.

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
    that last_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 of timezone.now() to make sure that we don't
    overwrite any manually set values.
Summary ID
Make sure the last_updated review request draft field is properly set after updating the draft.
3f335c363cc5227e513db36b5963ed37c7310dd4
maubin
chipx86
  1. Ship It!
  2. 
      
maubin
david
  1. Ship It!
  2. 
      
chipx86
  1. Ship It!
  2. 
      
maubin
Review request changed
Status:
Completed
Change Summary:
Pushed to release-6.x (3e20832)