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
74f6b50a
Commit
74f6b50a
authored
Feb 06, 2021
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update discussions after note is saved
This still updates both notes in the same transaction.
parent
5a160b7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
app/services/notes/create_service.rb
app/services/notes/create_service.rb
+4
-3
No files found.
app/services/notes/create_service.rb
View file @
74f6b50a
...
...
@@ -29,8 +29,9 @@ module Notes
note_saved
=
note
.
with_transaction_returning_status
do
break
false
if
only_commands
before_save
(
note
)
note
.
save
note
.
save
.
tap
do
update_discussions
(
note
)
end
end
when_saved
(
note
)
if
note_saved
...
...
@@ -57,7 +58,7 @@ module Notes
@quick_actions_service
||=
QuickActionsService
.
new
(
project
,
current_user
)
end
def
before_save
(
note
)
def
update_discussions
(
note
)
# Ensure that individual notes that are promoted into discussions are
# updated in a transaction with the note creation to avoid inconsistencies:
# https://gitlab.com/gitlab-org/gitlab/-/issues/301237
...
...
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