Dispose ydocs provider when closing app #8990
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
This fixes an effect of an old project's node being displayed when opening another one. I discovered those old nodes were read from YDocs server. I suppose this is some process from old project still interfering with ydocs (but I don't know how exactly - we're supposed to have different docs for each language server, aren't we?). Anyway, disposing ydocs provider on app unmount looks like good idea, and it fixed the issue.
It does not resolve problem with connection retries after closing project (#8964)
Screencast.from.2024-02-07.14-53-00.webm
Important Notes
Perhaps the better way would be to assume the pinia (or maybe entire gui2's
App
) persists between projects and just have configuration updated (and on update reconnect with different LS + change used ydocs server endpoint). But this is a harder task. Any discussions here are welcome.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
[ ] The documentation has been updated, if necessary.Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
[ ] Unit tests have been written where possible../run ide build
.