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

Rename browser state IndexedDB database names #4864

Closed
Tracked by #1617
sharon-wang opened this issue Oct 1, 2024 · 2 comments
Closed
Tracked by #1617

Rename browser state IndexedDB database names #4864

sharon-wang opened this issue Oct 1, 2024 · 2 comments
Assignees
Labels
area: workbench Issues related to Workbench category.

Comments

@sharon-wang
Copy link
Member

Background

Positron saves browser state in several IndexedDBs, each named vscode-web-{DB_NAME}, which may result in unexpected behaviour if a user opens a folder in Positron and then later opens the same folder in VS Code, or vice versa.

To avoid such collisions, we should rename positron's IndexedDBs, perhaps something like positron-web-{DB_NAME}.

Possible Solution

In particular, we may want to rename

indexedDB = await IndexedDB.create('vscode-web-db', 3, [userDataStore, logsStore, handlesStore]);

to positron-web-db; and

private static readonly STORAGE_DATABASE_PREFIX = 'vscode-web-state-db-';

to positron-web-state-db.

There are other databases which have the prefix vscode that we may want to rename to positron as well.

Considerations

Currently, since our databases are the same name as VS Code, there may be some convenient state sharing that we would lose after renaming the databases to be specific to Positron. At the same time, not renaming the databases may result in unexpected behaviour due to the shared state.

@sharon-wang sharon-wang added the area: workbench Issues related to Workbench category. label Oct 1, 2024
@sharon-wang sharon-wang added this to the 2024.11.0 Pre-Release milestone Oct 1, 2024
sharon-wang added a commit that referenced this issue Oct 16, 2024
- Addresses: #4864
- updates the prefixes for web IndexedDB databases and stores to use
`positron` instead of `vscode`
- we don't delete the existing stores that are prefixed with `vscode`

I've done some testing on a dev build of Server Web on Mac and a local
release build of Positron on Workbench on Ubuntu 24.

### QA Notes

- this change impacts Positron Web / Server Web only
- the data stores are working if:
- you're seeing the renamed databases and stores in Developer Tools >
Application > Storage > IndexedDB
- the layout state is being persisted when you close and reopen Positron
in the same browser; for example:
        1. Open up a folder in Positron Web / Server Web
        2. Command Prompt > View: Toggle Zen Mode
        3. Close the browser
4. Open up the same folder in the same browser in Positron Web / Server
Web
        5. You should still be in Zen Mode
@sharon-wang
Copy link
Member Author

Implemented in #5035

@jonvanausdeln
Copy link
Contributor

IndexDB now has positron prefix names

isabelizimm pushed a commit that referenced this issue Oct 18, 2024
- Addresses: #4864
- updates the prefixes for web IndexedDB databases and stores to use
`positron` instead of `vscode`
- we don't delete the existing stores that are prefixed with `vscode`

I've done some testing on a dev build of Server Web on Mac and a local
release build of Positron on Workbench on Ubuntu 24.

### QA Notes

- this change impacts Positron Web / Server Web only
- the data stores are working if:
- you're seeing the renamed databases and stores in Developer Tools >
Application > Storage > IndexedDB
- the layout state is being persisted when you close and reopen Positron
in the same browser; for example:
        1. Open up a folder in Positron Web / Server Web
        2. Command Prompt > View: Toggle Zen Mode
        3. Close the browser
4. Open up the same folder in the same browser in Positron Web / Server
Web
        5. You should still be in Zen Mode
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: workbench Issues related to Workbench category.
Projects
None yet
Development

No branches or pull requests

2 participants