Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f1f9578f
Commit
f1f9578f
authored
Apr 11, 2017
by
mhasbini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue's note cache expiration after delete
parent
9c576cc7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
app/models/note.rb
app/models/note.rb
+1
-0
changelogs/unreleased/30457-expire-note-destroy.yml
changelogs/unreleased/30457-expire-note-destroy.yml
+4
-0
spec/models/note_spec.rb
spec/models/note_spec.rb
+11
-1
No files found.
app/models/note.rb
View file @
f1f9578f
...
...
@@ -96,6 +96,7 @@ class Note < ActiveRecord::Base
before_validation
:set_discussion_id
,
on: :create
after_save
:keep_around_commit
,
unless: :for_personal_snippet?
after_save
:expire_etag_cache
after_destroy
:expire_etag_cache
class
<<
self
def
model_name
...
...
changelogs/unreleased/30457-expire-note-destroy.yml
0 → 100644
View file @
f1f9578f
---
title
:
Fix issue's note cache expiration after delete
merge_request
:
author
:
mhasbini
spec/models/note_spec.rb
View file @
f1f9578f
...
...
@@ -622,12 +622,22 @@ describe Note, models: true do
describe
'expiring ETag cache'
do
let
(
:note
)
{
build
(
:note_on_issue
)
}
it
"expires cache for note's issue when note is saved"
do
def
expect_expiration
(
note
)
expect_any_instance_of
(
Gitlab
::
EtagCaching
::
Store
)
.
to
receive
(
:touch
)
.
with
(
"/
#{
note
.
project
.
namespace
.
to_param
}
/
#{
note
.
project
.
to_param
}
/noteable/issue/
#{
note
.
noteable
.
id
}
/notes"
)
end
it
"expires cache for note's issue when note is saved"
do
expect_expiration
(
note
)
note
.
save!
end
it
"expires cache for note's issue when note is destroyed"
do
expect_expiration
(
note
)
note
.
destroy!
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment