diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-23 09:08:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-23 09:08:47 +0300 |
commit | d950ea420a77bc6b27037bd00484f2463e79b4fd (patch) | |
tree | ec93e370d6543321bb725e06f331b602e06873ac /app/models/discussion.rb | |
parent | 9d9c8fc2ec2fdfa0bae2f77a5c2bde52a5bf45e2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/discussion.rb')
-rw-r--r-- | app/models/discussion.rb | 9 |
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 |