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

Store recently opened workspaces in global storage #138072

Closed
roblourens opened this issue Nov 29, 2021 · 4 comments · Fixed by #139632
Closed

Store recently opened workspaces in global storage #138072

roblourens opened this issue Nov 29, 2021 · 4 comments · Fixed by #139632
Assignees
Labels
debt Code quality issues insiders-released Patch has been released in VS Code Insiders workbench-history History item issues
Milestone

Comments

@roblourens
Copy link
Member

This morning, my Recently Opened folders are missing in Insiders. Not sure whether this happened right after updating, or earlier, or what the order of events was because I was looking at a different issue.

image

"Open Recent" shows this list

image

The top two I opened manually, the others I guess have unsaved changes.

I don't think other global data has been lost. It seems like the window size and position was restored and I'm not getting notifications that I clicked "don't show again" on.

@bpasero
Copy link
Member

bpasero commented Nov 29, 2021

The list of recently opened workspaces is actually one of the few things we store in <user data dir>/storage.json because the main process needs early access and does not want to await the SQLite DB (besides - previously we didn't even have our own SQLite DB when state was still stored in localStorage).

Other things stored in that file are the window sizes and position, so you probably lost those too?

Anything in the logs from the past days that could hint to maybe a corrupted storage.json file?

@bpasero bpasero added the info-needed Issue requires more information from poster label Nov 29, 2021
@bpasero bpasero added the workbench-history History item issues label Nov 29, 2021
@roblourens
Copy link
Member Author

I should have mentioned something else relevant: like I mentioned in Slack I was having issues with not being able to close vscode, the main process was stuck in a busy loop, and I force quit it this morning. Could that have led to this?

I'm not sure I lost window size and position though - it opens maximized on the right monitor. When I start vscode with a fresh user data dir, the window is smaller.

openedPathsList in storage.json indeed only includes the couple folders I've opened manually today.

@bpasero
Copy link
Member

bpasero commented Nov 30, 2021

and I force quit it this morning

Yes, might be related. Possibly the file got truncated but wasn't able to write to disk then. If this reproduces reliably for you, let me know.

I will add a debt item for me to investigate whether we could possibly migrate this data into the SQLite DB.

@bpasero bpasero added debt Code quality issues and removed info-needed Issue requires more information from poster labels Dec 6, 2021
@bpasero bpasero changed the title Recently Opened folders missing Store recently opened workspaces in global storage Dec 6, 2021
@bpasero bpasero added this to the December 2021 milestone Dec 6, 2021
@bpasero
Copy link
Member

bpasero commented Dec 22, 2021

The list of opened workspaces and files is now migrated into global storage. A couple of interesting changes came a long:

  • a new IGlobalStorageMainService (extends IStorageService) that allows to actually use storage from main process with the same API as from a window
  • we store with StorageTarget.MACHINE to not sync recently opened paths assuming that the paths are very machine specific (as opposed to web where we set StorageTarget.USER because we assume access from different browsers)
  • we no longer need the weird storage service stub in resolveMarketplaceHeaders because we have a real IStorageService in hand now

//cc @sandy081

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues insiders-released Patch has been released in VS Code Insiders workbench-history History item issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@roblourens @bpasero @sbatten and others