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

Don't veto shutdown in web mode #6091

Merged
merged 2 commits into from
Jan 23, 2025
Merged

Don't veto shutdown in web mode #6091

merged 2 commits into from
Jan 23, 2025

Conversation

jmcphers
Copy link
Collaborator

This change fixes an issue in which Positron prompts to save changes whenever you try to navigate away from the page in web mode.

It turns out that in web mode (specifically), async shutdown operations aren't supported, and trying to use them results in this behavior. The fix is simply to not clear the session list in web mode, which should be fine as the reason we need to do this has to do with multiple Electron windows.

Addresses #6062.

QA Notes

As noted in the issue it's very easy to hit this, so should be easy to verify as well!

@jmcphers jmcphers requested a review from sharon-wang January 22, 2025 22:38
Copy link

github-actions bot commented Jan 22, 2025

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

readme  valid tags

sharon-wang
sharon-wang previously approved these changes Jan 23, 2025
Copy link
Member

@sharon-wang sharon-wang left a comment

Choose a reason for hiding this comment

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

LGTM!

Tested in Positron Server Web dev build on Mac and I didn't get the popup in any of these cases:

  • reload tab
  • close tab
  • open Recent folder from Welcome page
  • open folder

Comment on lines +324 to +326
if (!isWeb) {
e.veto(this.clearWorkspaceSessions(), 'positron.runtimeStartup.clearWorkspaceSessions');
}
Copy link
Member

Choose a reason for hiding this comment

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

One more thought! Maybe a comment here noting that async operations are not supported in Web, and that's why we only veto on Desktop

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh that's a good idea! c4d22dd

@jmcphers jmcphers merged commit 843bee4 into main Jan 23, 2025
8 checks passed
@jmcphers jmcphers deleted the bugfix/web-unload-dialog branch January 23, 2025 19:04
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2025
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