Editing the same file simultaneously causes race condition #152904
Replies: 6 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
I can confirm that this is happening to me as well, and it is very annoying. Concurrent modifications to the same source should be serialised. |
Beta Was this translation helpful? Give feedback.
-
|
I can confirm this too and it happens about 20% of the time. Because of this, I run out of tokens faster. |
Beta Was this translation helpful? Give feedback.
-
|
For me this was one of the first things I learned about cloud APIs when I had to work with them, that there is no concurrent access, it is just not possible to implement. Either you do your changes all at once, or in multiple steps with committing changes in between. This bug is a very good example of what happens if this is not followed. The edited file changes because of one thread editing it, but on the server the changes are generated based on its original state. The other thread will also think that the file it edits is the original, but it is not, thread 1 has changed it in the meantime. The only way to do such multiple changes is making one change, letting the user accept it, then making another one. Alternatívely you can work on a temporary file, that would allow you to synchronise with the server without the user accepting the changes, but this way you would lose the ability to show the user the diffs in the end. You would need to show them as two or more separate steps. I hope this will be fixed soon because it is a very annoying and also kind of a trivial issue. |
Beta Was this translation helpful? Give feedback.
-
|
I seem to face this consistently, > 30% of the time, if I am working on a component that is over about 1100 lines. For me, I see a significant drop in the frequency that this happens if I refactor the component into smaller components. And this may be completely random, but at least in my experience, it has seemed to help if I close the open window of the file being edited and not reopen it until after the edit completes. |
Beta Was this translation helpful? Give feedback.
-
|
I seem to have found a way around this. By prompting the AI to first summarize the intended changes to each component, with each individual component being a step, and then in the next prompt asking it to please continue with the implementation, it will then apply the summarized changes to each component in the steps provided, rather than having Step 1 and Step 6 simultaneously editing the same component. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
Hello Community,
I'd like to report a bug where Copilot Chat can edit the same file simultaneously, causing a race condition. In the same conversation, it is possible that the Copilot Chat modify the file at the same time, conflicts arise, leading to overwritten changes, corrupted code. The situation I encountered is when Copilot Chat wants to apply changes to file A, B, A in one response, the these three modification tasks are running simultaneously which causes file to corrupt.
Expected behavior:
Copilot Chat should detect concurrent modifications and handle conflicts properly.
Actual behavior:
Edits are overwritten unpredictably, leading to potential data loss.
Hope this gets addressed soon. Thanks!
Example image
Beta Was this translation helpful? Give feedback.
All reactions