-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error 32603: Document version mismatch detected #122
Comments
Thank you, yeah, I think there was a bug in previous versions that just applied formatting anyway even if there was a mismatch. And just to clarify, this is not happening everytime right? It is able to format for you most of the time and then recover when this happens? I think this error mostly happens if a format request is made too quickly after the last change was processed. To recover: make a small change by adding a space or something and just save/format again. I will see if I can bake in recovering gracefully/retrying so these won't be popping up except in the weird circumstances where they are supposed to. |
@spence-s Thanks for the comment. This actually happened after every save. Even after restarting VSCode, clearing cache, restarting linter and reinstalling the extension. Not sure if and how I can provide more debug info. |
Ah ok - Sorry for the inconvenience. If you still need to use the extension in the mean time, vscode allows you to install previous versions of an extension. In recent changes (3.14 and 3.14.1) 2 major things changed. We added support for range formatting requests and we changed a code action type, to apply a fix to a specific lint problem, to "quickfix" instead of "refactor". We also solved a bug where previously a lot of fixes were not getting correctly returned in code actions. The error you experience is this: right before we format we, 1) check the document version. 2) calculate the fixes needed 3) check the document version again and throw if it doesn't match the original (this is your error and it means your document changed in the time it took to compute fixes and they are now stale). 4) send the fixes to vscode for applying to your document. So my best guess is that you have another setting, or another extension, that is making conflicting changes on save using either code action quick fixes OR range formatting. I have not been able to reproduce this so it would be helpful if you could:
Would love to figure out what is causing this so we can prevent in the future. All of your help here is appreciated. |
@spence-s Indeed I am currently using an older version. Thanks again for the comment. After debugging some more, disabled all extensions expect VSCode, I think I found the culprit. On the older versions, I already noticed very buggy import formatting, where it sometimes would totally screw up the import code-lines. I think this is one of the scenarios you speak of, and which you actually protect against in the newer version. The Document Format task was conflicting with the task of Organizing Imports. Both were touching the order of imports, XO for ordering for example To first let VSCode do everything, and after everything let XO run, you can use
However, the actions of After removing this, everything seems to work in the new version :) |
I get a standard error while formatting my file since 3.14.x. Everything worked correctly in 3.13.x.
The dist line it is referring to is the following:
if(l!==o.version) throw new Error("Document version mismatch detected")
Let me know if more information is needed.
The text was updated successfully, but these errors were encountered: