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
-
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.)
Related to #337741 (closed)