Skip to content

Conversation

karrtikr
Copy link

@karrtikr karrtikr commented Apr 7, 2021

@karrtikr karrtikr added no-changelog No news entry required skip tests Updates to tests unnecessary labels Apr 7, 2021
@karrtikr karrtikr added skip package*.json package.json and package-lock.json don't both need updating and removed skip tests Updates to tests unnecessary labels Apr 7, 2021
@karrtikr karrtikr removed the no-changelog No news entry required label Apr 8, 2021
@karrtikr karrtikr marked this pull request as ready for review April 8, 2021 00:50
@karrtikr karrtikr closed this Apr 8, 2021
@karrtikr karrtikr reopened this Apr 8, 2021
Copy link

@kimadeline kimadeline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm the following: On the first run of the command, only the values that will be rewritten after this code gets in will get cleared? Do you have an example of such code that writes to persistent storage rarely, and would be missed on the first run of this command?

@karrtikr
Copy link
Author

karrtikr commented Apr 8, 2021

@kimadeline,

On the first run of the command, only the values that will be rewritten after this code gets in will get cleared?

You're correct, only the values that will be rewritten, or that are read will be tracked.

There can be such key values which are used (written to/read) rarely, or atleast not automatically on startup unless user triggers something. For eg. every prompt which has a "Do not show again" option, like the new workspace env prompt:

const notificationPromptEnabled = this.persistentStateFactory.createWorkspacePersistentState(
doNotDisplayPromptStateKey,
true,
);

But unless we track these individually, unfortunately there's no way to clear them (help VSCode!). We're assuming this is mainly for dev purposes, and we'll probably only want to clear the cache we're interacting with, in which case this command should be useful.

@karrtikr karrtikr merged commit 8661ba7 into microsoft:main Apr 8, 2021
@karrtikr karrtikr deleted the persistent branch April 8, 2021 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip package*.json package.json and package-lock.json don't both need updating

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants