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

Fix reconnection errors in some multi-window workflows #5817

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

jmcphers
Copy link
Collaborator

Addresses #5750.

The underlying issue is somewhat complicated. Basically:

  • The list of running sessions is stored in ephemeral storage, scoped to the workspace.
  • Ephemeral storage is shared among all active windows.
  • We rely on the fact that ephemeral storage goes away when the app quits in order to prevent reconnection to old sessions.
  • It is possible however in multi-window scenarios to close and reopen a window in a workspace without ever quitting Positron itself. In this scenario, we can try to reconnect to non-existent sessions.

The fix is to manually clear out the sessions from ephemeral storage on close/quit.

This is not related to the 1.95 merge.

QA Notes

This does not reproduce reliably with the steps in #5750. Here are steps that will cause it to reproduce every time in builds prior to this change.

  1. Open a workspace (Workspace 1).
  2. Using the Open in New Window gesture on the Project drop down in the upper right, open a different workspace (Workspace 2) in a new window.
  3. Start Python and/or R in Workspace 2 and run a few commands.
  4. Close Workspace 2, but leave the Workspace 1 window open.
  5. In Workspace 1, once again use Open in New Window to open Workspace 2.

In Step 5, you will see the window attempt to connect to the sessions that you started in Step 3, but get HTTP 404 since those sessions are not running any more.

Also note that the purpose of this machinery is to reconnect to sessions on reload/re-navigate, so double check that that still works.

Copy link

E2E Tests 🚀  ?
This PR will run tests tagged with: @critical

Copy link
Contributor

@juliasilge juliasilge left a comment

Choose a reason for hiding this comment

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

Working now! 🙌

@jmcphers jmcphers merged commit 69a2e14 into main Dec 18, 2024
6 checks passed
@jmcphers jmcphers deleted the bugfix/reconnect-in-new-window branch December 18, 2024 23:28
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants