There are edge-cases where an edit on a talk page that should be detected as a valid "talk page special case" (i.e. both users did nothing but adding a response at the same position) is not detected as such.
A :Response B
A :Conflicting response B
The reason is that the diff algorithm we use detects the first edit as copy–change–copy. But we are looking for two copy–add–copy changes, so we don't detect this. The first user's addition is not detected as an addition but as a "change" from an empty line into the user's response. That's even correct as it is exactly what the user did.
It might be possible to add this edge-case to our detection algorithm. Specifically: We could check if the left side of a "change" is empty, and act as if it an addition.
This is split from T248668: Edge case: newlines can break talk page use case.
- Add this edge case to the detection algorithm.
- Make sure the view is able to render the result of this detection.
- Check if the merge works as expected (see below).
- Should we also create a browser test for this?
A :Response :Conflicting response B