Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 12:08:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 12:08:42 +0300
commitb76ae638462ab0f673e5915986070518dd3f9ad3 (patch)
treebdab0533383b52873be0ec0eb4d3c66598ff8b91 /app/models/discussion.rb
parent434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff)
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'app/models/discussion.rb')
-rw-r--r--app/models/discussion.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/models/discussion.rb b/app/models/discussion.rb
index 076d8cc280c..203e14f1227 100644
--- a/app/models/discussion.rb
+++ b/app/models/discussion.rb
@@ -163,16 +163,15 @@ class Discussion
end
def cache_key
- # Need this so cache will be invalidated when note within a discussion
- # has been deleted.
- notes_sha = Digest::SHA1.hexdigest(notes.map(&:id).join(':'))
+ # Need to use the notes' cache key so cache will be invalidated when note
+ # within a discussion has been deleted or has different data after post
+ # processing of content.
+ notes_sha = Digest::SHA1.hexdigest(notes.map(&:post_processed_cache_key).join(':'))
[
CACHE_VERSION,
- notes.last.latest_cached_markdown_version,
id,
notes_sha,
- notes.max_by(&:updated_at).updated_at,
resolved_at
].join(':')
end