Skip to content

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Sep 15, 2022

When receiving multiple change events for a single file id where the last change is a delete the server panics, as it tries to access the file contents of a deleted file. This occurs due to the VFS changes and the in memory file contents being updated immediately, while process_changes processes the events afterwards in sequence which no longer works as it will only observe the final file contents. By folding these events together, we will no longer try to process these intermediate changes, as they aren't relevant anyways.

Potentially fixes #13236

When receiving multiple change events for a single file id where the
last change is a delete the server panics, as it tries to access the
file contents of a deleted file. This occurs due to the VFS changes and
the in memory file contents being updated immediately, while
`process_changes` processes the events afterwards in sequence which no
longer works as it will only observe the final file contents. By
folding these events together, we will no longer try to process these
intermediate changes, as they aren't relevant anyways.

Potentially fixes rust-lang#13236
@Veykril Veykril marked this pull request as ready for review September 27, 2022 14:41
@Veykril
Copy link
Member Author

Veykril commented Sep 27, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Sep 27, 2022

📌 Commit c3a6c96 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Sep 27, 2022

⌛ Testing commit c3a6c96 with merge 093de32...

@bors
Copy link
Contributor

bors commented Sep 27, 2022

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 093de32 to master...

@bors bors merged commit 093de32 into rust-lang:master Sep 27, 2022
@Veykril Veykril deleted the process-changes branch October 28, 2022 18:52
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.

thread 'LspServer' panicked at 'called Option::unwrap() on a None value', crates/vfs/src/lib.rs:143:38
2 participants