Skip to content

Store recently opened workspaces in global storage #138072

Closed

Description

@roblourens

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.

Activity

  1. bpasero commented on Nov 29, 2021

    @bpasero
    Contributor

    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?

  2. added
    info-needed
    on Nov 29, 2021
  3. roblourens commented on Nov 29, 2021

    @roblourens
    MemberAuthor

    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.

  4. bpasero commented on Nov 30, 2021

    @bpasero
    Contributor

    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.

  5. added
    debt
    and removed
    info-needed
    on Dec 6, 2021
  6. changed the title [-]Recently Opened folders missing[/-] [+]Store recently opened workspaces in global storage[/+] on Dec 6, 2021
  7. added
    unreleased
    on Dec 22, 2021
  8. bpasero commented on Dec 22, 2021

    @bpasero
    Contributor

    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 Sandeep Somavarapu (@sandy081)

  9. added
    insiders-released
    and removed
    unreleased
    on Jan 3, 2022
  10. locked and limited conversation to collaborators on Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debtinsiders-releasedworkbench-history

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions