You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Store recently opened workspaces in global storage #138072
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.
"Open Recent" shows this list
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.
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?
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.
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
Activity
bpasero commentedon Nov 29, 2021
The list of recently opened workspaces is actually one of the few things we store in
<user data dir>/storage.jsonbecause 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 inlocalStorage).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.jsonfile?roblourens commentedon Nov 29, 2021
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.
openedPathsListin storage.json indeed only includes the couple folders I've opened manually today.bpasero commentedon Nov 30, 2021
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.
[-]Recently Opened folders missing[/-][+]Store recently opened workspaces in global storage[/+]bpasero commentedon Dec 22, 2021
The list of opened workspaces and files is now migrated into global storage. A couple of interesting changes came a long:
IGlobalStorageMainService(extendsIStorageService) that allows to actually use storage from main process with the same API as from a windowStorageTarget.MACHINEto not sync recently opened paths assuming that the paths are very machine specific (as opposed to web where we setStorageTarget.USERbecause we assume access from different browsers)resolveMarketplaceHeadersbecause we have a realIStorageServicein hand now//cc Sandeep Somavarapu (@sandy081)