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

Auto-store edit sessions on window close #158409

Closed
joyceerhl opened this issue Aug 17, 2022 · 1 comment · Fixed by #158428
Closed

Auto-store edit sessions on window close #158409

joyceerhl opened this issue Aug 17, 2022 · 1 comment · Fixed by #158428
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@joyceerhl
Copy link
Contributor

joyceerhl commented Aug 17, 2022

#157733 introduces workbench.experimental.editSessions.autoResume which controls when we attempt to restore an edit session for the current workspace. The user still has to remember to store their edit session or use the explicit Continue Working On trigger.

In order to make it harder to lose edit sessions across github.dev, insiders.vscode.dev, vscode.dev, and RemoteHub on desktop, we should introduce a setting workbench.experimental.editSessions.autoStore with initial setting values off and onClose. When set to onClose, we'll attempt to store the current edit session (if any) before a workbench unload.

This will only really reliably work in desktop because in web we cannot run long running tasks in the onbeforeunload handler (MicrosoftEdge/MSEdgeExplainers#147, tracked in #150744). To mitigate this we should also explore introducing an afterDelay option to continuously sync edit sessions. That first requires tolerance of edit sessions originating from multiple VS Code clients concurrently.

@joyceerhl joyceerhl added the feature-request Request for new features or functionality label Aug 17, 2022
@joyceerhl joyceerhl added this to the August 2022 milestone Aug 17, 2022
@joyceerhl joyceerhl self-assigned this Aug 17, 2022
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Aug 18, 2022
@rzhao271 rzhao271 added the verification-needed Verification of issue is requested label Aug 23, 2022
@connor4312 connor4312 added the verified Verification succeeded label Aug 23, 2022
@connor4312
Copy link
Member

On vscode.dev, we do have a service worker which is used primarily for caching. Service workers can outlive their associated pages, and can be synchronously postMessage'd to like other workers. Perhaps we can use that service worker (or a new one) to allow the workbench to send information to save before it unloads.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants