• 
      

    Fix caching bugs with comments in inline review UIs.

    Review Request #14555 — Created Aug. 5, 2025 and submitted — Latest diff uploaded

    Information

    Review Board
    release-7.1.x

    Reviewers

    When review UIs for binary files are rendered in "inline" mode as part
    of the diff viewer, the serialized comments are included in the rendered
    fragment (as opposed to comments on regular diff files, which are all
    included as part of the main diff viewer page). Our ETag calculation
    wasn't taking this into account, which meant that after making changes
    to comments (adding, removing, editing), reloading the diff viewer could
    show outdated comments coming from the browser cache.

    This change reworks the fragment view to include all comment timestamps
    in the ETag when the filediff in question is binary. We had an existing,
    similar example in CommentDiffFragmentsView that included the latest
    timestamp in the ETag, but this is broken in the case where comments are
    deleted or edited on a pending review. I've changed that to include the
    same behavior of including all comment timestamps rather than just the
    latest.

    A couple new tests have been added to verify the cache response
    behavior.

    • Ran unit tests.
    • Verified that comments on binary files in the diff viewer no longer
      presented with outdated browser cache bugs.

    Commits

    Files