-
Notifications
You must be signed in to change notification settings - Fork 5.9k
globalState is not persisted across extension updates #2021
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
Comments
cc @code-asher |
I can replicate with:
I think that (in the web version of VS Code at least) the storage file isn't written to immediately but rather after a delay and reloading for some reason interrupts that delay causing it to never write (further supported by the fact that adding a 1s timeout around the reload makes it work). Hopefully will be able to track down why the write gets canceled and get it fixed today. |
VS Code has a short delay before writing storage (probably to queue up rapid changes). In the web version of VS Code this happens on the client which means if the page is reloaded before the delay expires the write never happens. Storage updates are already promises so this simply returns the promise returned by the delayer so it won't resolve until the write actually happens. Fixes #2021.
VS Code has a short delay before writing storage (probably to queue up rapid changes). In the web version of VS Code this happens on the client which means if the page is reloaded before the delay expires the write never happens. Storage updates are already promises so this simply returns the promise returned by the delayer so it won't resolve until the write actually happens. Fixes #2021.
VS Code has a short delay before writing storage (probably to queue up rapid changes). In the web version of VS Code this happens on the client which means if the page is reloaded before the delay expires the write never happens. Storage updates are already promises so this simply returns the promise returned by the delayer so it won't resolve until the write actually happens. Fixes #2021.
VS Code has a short delay before writing storage (probably to queue up rapid changes). In the web version of VS Code this happens on the client which means if the page is reloaded before the delay expires the write never happens. Storage updates are already promises so this simply returns the promise returned by the delayer so it won't resolve until the write actually happens. Fixes #2021.
VS Code has a short delay before writing storage (probably to queue up rapid changes). In the web version of VS Code this happens on the client which means if the page is reloaded before the delay expires the write never happens. Storage updates are already promises so this simply returns the promise returned by the delayer so it won't resolve until the write actually happens. Fixes #2021.
Should we close this? |
Recently we've switched to closing the issues once a release with the fix goes out so let's leave it open for now! |
We recently started using milestones so we can close this now and track whether it's released using the milestone. |
Our extension fails to work on code-server (rust-lang/rust-analyzer#5892).
The problem is that we use
globalState
. We expect the contents ofglobalState
to persist across the extension version updates. Even though this is not mentioned invscode
API docs, but originalvscode
does persist it, butcode-server
doesn't.For example we check for new nightly extension release and record it in
globalState
like this.But when we programmatically install the extension from VSIX and reload the window, code-server clears the persistent storage.
Meta
Google Chrome Version 84.0.4147.125 (Official Build) (64-bit)
Ubuntu 20.04.1 LTS
code-server
on my local PC, so probably same as Local OS)x86_64
my PCcode-server --version
:3.4.1
48f7c27The text was updated successfully, but these errors were encountered: