Race condition in merge train removal toast notification
Problem to solve
The following discussion from !155692 (merged) should be addressed:
-
@hfyngvason started a discussion: @mrincon @pburdette We just got a report on slack that this problem is still occurring.
I suspect the problem is that a notification may fire
- before the MR transitions to merged
- but while the car is still in
mergingstate
In this case, the MR will have a merge train car, but not an index. We delete cars on removal, so I think it would be better to watch the car's presence (regardless of its state): If the car was present before, and is no longer present, then the MR has been removed from the train.
Proposal
- Add a connection from merge requests to the new merge train car type backend. But note that the type is still under active development, so please mark the field as alpha
‼ (it's stable enough for internal use, but we don't want to commit to its structure just yet) - Decide whether to display the toast based on the presence of the car frontend
Edited by Hordur Freyr Yngvason