Include position in the cache key of DiffDiscussion
What does this MR do?
In #332967 (closed), we introduced caching on discussions endpoint.
Upon testing it further while rolling it out, found a bug wherein the diff note that should still be displayed won't display anymore because position changed. The position stored in cache no longer applies as it's outdated.
With this fix, we include the position of the first note in diff discussion (as sha) in the cache_key. This way, when the position changes, the cache key will be updated and will result to a cache miss and will return updated data.
No changelog trailer as the feature utilizing the cache key is behind a feature flag.
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. -
This change is backwards compatible across updates, or this does not apply.
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 #336054 (closed)
Edited by Patrick Bajao