Closed digitarald closed 8 months ago
I think blowing up the user data dir would would do most of the things we want (1 and 3)
Regarding 2. there are always some critical security updates. And it can as well happen that the next monthly release has some security fix even if the user updates regularly. So I would think about this problem unrelated to the long period of inactivity.
@bpasero what do you think about user data blowup after some period of inactivity?
Related to / duplicate of:
We cannot "blow up user data dir" because it may contain backups of unsaved changes.
@bpasero I think we can blow up user data dir because:
So we should just make sure that the dialog when we ask the user makes it clear that unsaved changes in files will be lost.
I am not entirely sure we can technically delete the user data dir via a restart of the app, because we would basically have to delete it on startup before the ready
event. @deepak1556 can maybe chime in if it is save to do so.
To be honest, I have not heard of an application that would behave like this, so I am not sure this makes sense. What is the motivation?
@bpasero Firefox does this. And I actually got that dialog - it gave me a feeling of being offered to cleanse my previous sins and start fresh.
Motivation: user tried out vscode couple of years ago and left it in a bad state (broken settings.json
, hid the activity bar and has no clue how to bring it back...). In a user study it happened that a user had created a chrome launch configuration in his user settings, and now he was trying to setup PHP debug which was impossible due to his old user configuration which is shared across workspaces and does not allow our "let us help you start debugging" experience.
I think we will see more and more users coming back to VS Code after some time as they give us a 2nd chance.
Though let's first see if it is possible at all from @deepak1556
Downside of this is that it would be another dialog. Since I hate dialogs in general, I am not 100% convinced we need this.
User data dir not only contains vscode application data but also lot of configurations for the runtime which get processed before the ready event. So I would strongly advice against nuking the directory while the application runs, the application is always free to touch files that it owns inside that directory, so maybe focus on deleting only those data ? But if you really want to start fresh, then try this flow
1) Confirm with user about starting with fresh state
2) Launch the app and set a new user data path via app.setPath
https://github.com/electron/electron/blob/main/docs/api/app.md#appsetpathname-path
3) Delete the old directory in any of the successive runs
Yeah we do have situations where we change the user data dir dynamically even after starting but before ready
event. Mainly to support the portable
mode:
To simplify, we could break down this work into 1. Don't restore the last-opened folder. (reasonably uncontroversial) and 3. Offer to reset VS Code's user-data (will require some tweaking and experimentation) entry.
Duplicate of https://github.com/microsoft/vscode/issues/130510
What if: Many users that open VS Code after many years of not using it could have a better experience when they started with a fresh install.
The reasons for bad experience amplify each other, and we can't expect that a user re-evaluates each of these when re-opening an old install:
We saw this frequently in usertesting: A participant who self-reported as not using VS Code downloads the most recent version and after launch, defaults to the last opened workspace. There is usually have little or no recollection of the project they are looking at. Even worse, VS Code is set up in unexpected ways, binary paths changed, and some of the extensions are legacy or deprecated.
We expect this to be common, as it is easy to download and install VS Code just to try it out. It takes little space, so keeping it around afterwards doesn't hurt.
What could reset mean:
Related, Firefox does something similar for similar reasons (old extensions, performance issues, etc).