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

[vscode-server-web] Enable storing user state/settings in remote instead of in IndexedDB #210775

Closed
SonoSooS opened this issue Apr 19, 2024 · 2 comments
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code

Comments

@SonoSooS
Copy link

SonoSooS commented Apr 19, 2024

tl;dr: I need a default User/settings.json on the remote, as not all clients connecting to the code-server have nonvolatile storage for that file.
Settings Sync is not an option due to many limitations, and by the time I could enable Settings Sync, it's already too late, the remote code-server state gets completely destroyed by the connecting client.

Actually, an entire global remote profile or so would be better, so I could close my session on one device, then continue where I left off on the other. This is actually what I really need, but it feels like that's not possible (yet?), considering my limited experience with code-server.


I'm running a (VS)Code-server-web on my main computer, so I can use VSCode on devices where installing VSCode is not possible (Windows thin client, Android thin client, non-Linux device with web browser. etc.), or from some other device if I'm bed-bound due to health reasons.

My very big problem, is that if I join from a device (always only one session is open!), then it will have default config. And the default config is bad. It auto-updates important extensions, so I have to disable extension auto-update, then crawl out of bed, close code-server, overwrite the extension with the version-locked version, then restart code-server, and crawl back into bed, and then I can keep manually restoring the User/settings.json file from a template, as not all devices have writable nonvolatile storage.

This is bad, especially because not all of my devices have writable nonvolatile storage, so this will happen over and over again. Sometimes almost every hour, if I happen to use a device with a read-only storage, and it happens to crash the browser frequently due to running out of RAM for example.

Since I plan to use code-server in "single user mode", and I've read that code-server is intended to be used by a single user, why not make a remote setting, so that all of the user state is actually stored on the remote, and only use User/settings.json to store local overrides instead (if any, for example font size or font change, to accomodate for different screen size across the devices, for example)?

I've tried to be clever, and copypasted the template settings.json to Machine/settings.json, but then some settings get grayed out, and they show a message on hover:

This setting has an application scope and can be set only in the user settings file.

That's kind of infuriating, as exactly the settings I'd want to configure globally (like window.menuBarVisibility and extensions.autoUpdate for example) are locked to User/settings.json for some reason.

How do I make these settings global to all clients?
How do I switch between two clients while keeping global state (settings, open files, etc.) ?

It doesn't seem like this is possible at the moment. I've looked through docs, and many issues in this repo, and I found nothing. Is this even supported in code-server?


VSCode type: vscode-server-web

Version: 1.89.0-insider
Commit: 063d715
Date: 2024-04-19T05:03:56.125Z (12 hrs ago)

Tried older 32bit version as well:
Version: 1.84.0-insider
Commit: 0c36b92
Date: 2023-10-16T05:47:07.428Z

Operating System running code-server: Windows 10 (tried both 32bit and 64bit)
Extensions: any/none (happens with completely empty .vscode-server-insiders folder as well)

I am the sole user of this code-server, always, with only up to 1 instance connected. I'm hosting it locally, on a partially isolated network. No VPN or tunnel or Tunnel, I'm using direct connection from browser.

Commandline: code-server-insiders serve-local --host 0.0.0.0 --without-connection-token --accept-server-license-terms


Edit: I'm using code-server-web, so I'm always just opening a browser. Fixed some wording mistakes.


Edit 2: I've did some digging, and it seems like this is not implemented yet, but feels like it should be easy-ish to implement, considering how modular and abstracted the code is.

I found this line of code [permalink to code][permalink to struct element], where I could possibly overwrite the default profile.
However, it sems like it's not being passed in in the Javascript object [permalink], and there is no implementation to actually pass that in.

That doesn't quite matter anymore, as I found what I was looking for.

It seems like that the userdata path is hardcoded to use IndexedDB [permalink], which is not great, as I need remote permanent storage.
Some lines up [permalink] the remote storage is initialized, which is really asking to be used by being there.
Sure enough, it gets mapped to an URI schema [permalink], which could be potentially used to map the userdata URI scheme to the remote URI scheme, kind of like how the standalone Electron client does it [permalink], except with the remote URI scheme instead of the file URI scheme.

I am extremely "uncomfortable" with TypeScript though, so I can't make a PR out of this myself.


Edit 3: crossed out not-so-relevant parts, and updated the title to be more focused and less generic

@SonoSooS SonoSooS changed the title [code-server] Override default remote global user settings / remote global user state [vscode-server-web] Override default remote global user settings / remote global user state Apr 19, 2024
@SonoSooS SonoSooS changed the title [vscode-server-web] Override default remote global user settings / remote global user state [vscode-server-web] Enable storing user state/settings in remote instead of in IndexedDB Apr 21, 2024
@sandy081 sandy081 removed their assignment Apr 22, 2024
@sandy081 sandy081 added the feature-request Request for new features or functionality label Apr 22, 2024
@sandy081 sandy081 added this to the Backlog Candidates milestone Apr 22, 2024
@sandy081 sandy081 added the *out-of-scope Posted issue is not in scope of VS Code label Apr 22, 2024
@VSCodeTriageBot
Copy link
Collaborator

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@VSCodeTriageBot
Copy link
Collaborator

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

3 participants