Editing labels in sidebar after adding one with slash command can revert changes
In gitlab-ce!31023 I performed the following actions:
- Add Label A via a slash command in the discussion
- Add Label B and remove Label C using the label selector in the MR sidebar
- Noticed that Label A had been removed after step 2
It appears that using the sidebar to edit labels will use the state of the labels at the time the page was rendered, and submit the entire set of labels to the backend when changes are made, rather than just specifying what was added or removed.
I imagine this means that the bug will also occur if you make changes to the labels in two different tabs, or if two users edit the labels concurrently.
We should probably change this behavior to either:
- only send the "changes" (labels added and labels removed), or
- ensure the sidebar state is updated in real time when labels are altered
(or both)