Handle post processed content scenario for MR discussions cache
What does this MR do?
We cache MR discussions after post processing. Before this fix, we aren't considering the post processing result (e.g. reference state change) which results to stale cache.
This fix adds a Note#post_processed_cache_key
that is also added to Discussion#cache_key
. This way, when the post processing changes the note's content for a certain user, we will be able to show updated content.
MR discussions cache is still behind a disabled by default feature flag called merge_request_discussion_cache
.
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.)
Security
Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related to #336204
Edited by Dominic Couture