Only update the sidebar count caches when needed
What does this MR do?
This changes the cache invalidation for the sidebar counters so the counters are only updated when the state/confidential flag changes, instead of doing so for every update.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Tests added for this feature/bug - Review
-
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together