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

Dispose ydocs provider when closing app #8990

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

farmaazon
Copy link
Contributor

@farmaazon farmaazon commented Feb 7, 2024

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.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • [ ] Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@farmaazon farmaazon added CI: No changelog needed Do not require a changelog entry for this PR. --bug Type: bug -gui labels Feb 7, 2024
@farmaazon farmaazon self-assigned this Feb 7, 2024
Copy link
Contributor

@kazcw kazcw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely an improvement.

I'm concerned we might have other issues, currently or in the future, when changing projects. We mainly test the GUI by opening a project starting from a clean state. When we switch projects and all the Pinia stores have to be transition from one initialized state to another, we could easily have other problems. If we were to reset our Pinia stores (some approaches here: vuejs/pinia#911) when closing a project, store setup would only need to correctly handle starting from an uninitialized state, and we would not have any risk of observing data from a previously-opened project.

@vitvakatu
Copy link
Contributor

Let’s merge this one.

@vitvakatu vitvakatu merged commit 1c46eec into develop Feb 8, 2024
31 checks passed
@vitvakatu vitvakatu deleted the wip/farmaazon/fix-old-nodes branch February 8, 2024 14:39
@AdRiley AdRiley mentioned this pull request Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -gui CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants