Skip to content
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

Use version from didOpen, use text from editor as source of truth #1279

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

robertoaloi
Copy link
Member

Without this change, the server could read an outdated version of the text from disk and
try to apply changes to it. This was a very common scenario in case a file was already opened
in the editor with pending changes, not yet saved to disk. A reload of the server would cause
the server to incorrectly rely on the version on disk.

The version is also used now, so that eventual background jobs on outdated versions of the code
would abort.

Description

Enter a description of your changes here.

Fixes # .

Without this change, the server could read an outdated version of the text from disk and
try to apply changes to it. This was a very common scenario in case a file was already opened
in the editor with pending changes, not yet saved to disk. A reload of the server would cause
the server to incorrectly rely on the version on disk.

The version is also used now, so that eventual background jobs on outdated versions of the code
would abort.
@robertoaloi robertoaloi merged commit de0fb74 into main Apr 25, 2022
@robertoaloi robertoaloi deleted the solve-race-conditions branch April 25, 2022 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants