Skip to content

Handle cache busting scenario where DiffNotePosition changes

What does this MR do?

We create/update the DiffNotePosition of a discussion (via the first note ID), whenever a MR has been updated and we check for mergeability of a MR. This means that when a merge request changes the DiffNotePosition can possibly change.

Previously, when that happens, the cache will be stale and the positions property we return in discussions.json will be outdated and won't match anything on the new HEAD diff so discussions that supposed to be still displayed won't be displayed.

This fix adds the SHA of DiffNotePosition#position records of each DiffDiscussion to the cache key. This way, if they change, the cache for the corresponding discussion will be invalidated.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #337741 (closed)

Merge request reports

Loading