Race condition in editing question

I have noticed this problem. Let's say when I first see a question, it is in version $A$. It is badly formatted, so I click edit. However, it takes a long time for me to edit. Before I finish, someone click edit and submit a version $B$. However, at that moment, I do not know about it, so I submit my version $C$.

The end result is that I am not doing the edit that I intend. I intend to edit version $A$, not version $B$. I think this is analogous to race condition in a multi-process system (each user is analogous to a process). Is this a bug?

EDIT: This happens when I am reviewing first posts. Also, I have unstable internet connection. After I finish editing, is it possible to have an option to show the diff (like in Wikipedia)?

• What the system really should do is lock the post while an edit is pending (with the lock being released for a predetermined period of inactivity, in which case the first editing user is "kicked" from the edit). – Deepak Dec 22 '17 at 4:42
• @Deepak Your solution sounds good, but it completely disallows concurrent editing. Can anyone think of a situation where concurrent editing would be useful? – Alex Vong Dec 22 '17 at 9:34
• The system will not accept your version C if your edits are "less substantial" (I think that's the phrase) than the version B edits. Sometimes I've had edits rejected for this reason, so if my concurrent edits end up being accepted then I don't fret over it. I so rarely concurrently edit, so when it does happen and if I have time I'll go back and look at the conflicting edit and see if there's a good way to mix it with mine. – tilper Dec 22 '17 at 18:33
• While editing, I sometimes see a notice coming up above the editing window saying someone else has edited the posting. I then sometimes right-click on the notice to see what edits were done. In some cases, I then incorporate those edits into the editing window I've already got open, in addition to my own edits, and then save it. – Michael Hardy Dec 22 '17 at 20:41
• @MichaelHardy I think due to my poor internet connection, I have never seen that notice, even though I've faced the same problem two-three times which the OP has described . – Gaurang Tandon Dec 23 '17 at 2:03
• @MichaelHardy This sounds like a genuine use case. So I think instead of disallowing concurrent editing, we should still allow it, but disallow submission of that edit before the first editor has finished or time-out. – Alex Vong Dec 23 '17 at 16:01
• @AlexVong : As far as I know, there is no way to know that this is happening until the first editor has finshed. – Michael Hardy Dec 23 '17 at 16:46
• @MichaelHardy You're right. I think I will support the diff-showing solution instead. – Alex Vong Dec 23 '17 at 17:38
• I suspect this is not a significant enough problem to get addressed? – copper.hat Dec 30 '17 at 20:27
• @copper.hat I hope this is not the case. Maybe they need time to fix it? – Alex Vong Dec 31 '17 at 7:29
• @AlexVong: Purely my opinion. They might not consider it a bug as such. It may be prohibitive to fix (time, complexity, maintainability, typical user impact & improvement) in an intellectually satisfactory manner. The cost of not fixing is fairly small & manageable. – copper.hat Dec 31 '17 at 7:33