Follow-up from "Create a system note for new design discussions"
The following discussion from !19990 (merged) should be addressed:
-
@engwan started a discussion: (+1 comment) I looked at
Discussion#new_discussion?
and I think there can be a race condition here that would lead to no system note being created.- A new discussion is created
- A reply to the discussion is quickly posted
- When
NewNoteWorker
is runnew_discussion?
and would now returnfalse
because the discussion has 2 notes.
I think we should remove
Discussion#new_discussion?
and instead have something likeNote#start_of_discussion?
which checks if the current note is the first note of a discussion.We can do this in a separate MR though and fix it together with the other usage of
new_discussion?
.