coder / code-server

VS Code in the browser
https://coder.com
MIT License
66.67k stars 5.46k forks source link

[Bug]: Several refreshes in code-server #6591

Closed Neyos1997 closed 6 days ago

Neyos1997 commented 7 months ago

Is there an existing issue for this?

OS/Web Information

Steps to Reproduce

I am having issues with this image : linuxserver/code-server:4.12.0 I am using it to access my application and modify my code for my project the issue is in case i have multiple projects and i try to change directories between them going from project to project to check them up , the code-server still caches the last accessed project like i would go to a folder that has my project named with an id such as 789 from project with the id 123 it shows that is pointed to 123 even though i am on 789 then it suddenly refreshes and correct the issue disappears ,

Expected

expected to have no random refreshes or non coherent folder accessing.

Actual

uncoherent switch between folders

Logs

[2023-12-18T10:16:16.559Z] error Failed to get latest version {"error":"read ECONNRESET"} [10:16:20] [127.0.0.6][bc0cb013][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed. [10:16:20] [127.0.0.6][4204b3dc][ExtensionHostConnection] <8495> Extension Host Process exited with code: 0, signal: null. [10:16:21] [127.0.0.6][b67c7e93][ManagementConnection] New connection established. [10:16:23] [127.0.0.6][d30dace9][ExtensionHostConnection] New connection established. [10:16:23] [127.0.0.6][d30dace9][ExtensionHostConnection] <8578> Launched Extension Host Process. File not found: /app/code-server/lib/vscode/node_modules/vscode-regexp-languagedetection/dist/index.js [2023-12-18T10:16:32.910Z] error Failed to get latest version {"error":"read ECONNRESET"} [10:16:33] [127.0.0.6][b67c7e93][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed. [10:16:33] [127.0.0.6][d30dace9][ExtensionHostConnection] <8578> Extension Host Process exited with code: 0, signal: null. [10:16:35] [127.0.0.6][15636570][ManagementConnection] New connection established. [10:16:37] [127.0.0.6][b339b060][ExtensionHostConnection] New connection established. [10:16:37] [127.0.0.6][b339b060][ExtensionHostConnection] <8733> Launched Extension Host Process. [10:16:43] [127.0.0.6][15636570][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed. [10:16:43] [127.0.0.6][b339b060][ExtensionHostConnection] <8733> Extension Host Process exited with code: 0, signal: null. [10:16:45] [127.0.0.6][e17151a9][ManagementConnection] New connection established. [2023-12-18T10:16:46.311Z] error Failed to get latest version {"error":"read ECONNRESET"} [10:16:47] [127.0.0.6][b3712a7f][ExtensionHostConnection] New connection established. [10:16:47] [127.0.0.6][b3712a7f][ExtensionHostConnection] <8830> Launched Extension Host Process. File not found: /app/code-server/lib/vscode/node_modules/vscode-regexp-languagedetection/dist/index.js [2023-12-18T10:16:56.327Z] error Failed to get latest version {"error":"read ECONNRESET"}

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

Are you accessing code-server over a secure context?

Notes

No response

code-asher commented 7 months ago

I am a little unclear, is the problem that when you use File > Open Folder it opens the wrong folder? If you could write out a series of exact steps I can take to reproduce the problem that would be much appreciated.

Neyos1997 commented 7 months ago

Greetings @code-asher! I've organized my directory structure for projects under '/projects,' specifically utilizing the Spring Boot framework. Within this structure, the front end provides access to these projects. Upon accessing a project, such as '/projects/id/springboot,' where 'id' represents the project's unique identifier, I encounter an issue. For instance, if I switch from the project with the path '/projects/01111/' to '/projects/12345,' the file display erroneously shows the contents of the '01111' project initially. However, the code server promptly recognizes the discrepancy, triggering an automatic refresh to correctly point to the '12345' project.

code-asher commented 7 months ago

When you say you access a project, do you mean File > Open Folder or something else? Here is what I tried to do but it all worked for me:

  1. Make project directories with mkdir -p ~/projects/{01111,12345}/springboot.
  2. Make a test file in each project (echo "01111" > ~/projects/01111/springboot/test for example)
  3. File > Open Folder and open ~/projects/01111/springboot.
  4. I see the right project and files on the first load.
  5. File > Open Folder and open ~/projects/12345/springboot.
  6. I see the right project and files on the first load again.
Neyos1997 commented 7 months ago

Hello @code-asher Thanks for your response no what mean by accessing a project is that i have a front emplate in which i have the list of my project with their names , each project exists under a folder with it's id . as an example have a project let's say springboot , i exists under /home/project/12345678/theproject , from my front template i can access the project called "myproject" i have a button open to go directly to myproject directory . no when i switch from different projects the issue mentioned above happens . please note that code-server is running as pod in k8s cluster , when a the pod of code-server is initiliazed , i would have two containers to start , one for code-server and the other for istio . just for more clearance . Best Regards .

code-asher commented 6 months ago

I see, that sounds considerably more complex. Are you able to reproduce with code-server alone? Or are you able to provide a full reproduction I can run to debug this? Thanks.

benz0li commented 4 months ago

@code-asher This is also reproducible with code-server alone.

The problem: File not found: /app/code-server/lib/vscode/node_modules/vscode-regexp-languagedetection/dist/index.js
👉 Node module vscode-regexp-languagedetection simply does not exist.


It is mentioned here in the source code:

https://github.com/microsoft/vscode/blob/8aca9a53311890fa54f0459c6ef2e8994d4d8ae4/src/vs/workbench/services/languageDetection/browser/languageDetectionWorkerServiceImpl.ts#L30-L31

benz0li commented 4 months ago

https://security.snyk.io/vuln/SNYK-JS-VSCODEREGEXPLANGUAGEDETECTION-3021662

code-asher commented 4 months ago

The language detection is causing the refreshes?

Apparently this module is not open source so I guess we cannot include it: https://github.com/microsoft/vscode/issues/137104#issuecomment-1055821026

benz0li commented 4 months ago

The language detection is causing the refreshes?

No. The way I see it now, my problem actually has nothing to do with this issue...

In my case a Jupyter Notebook caused an indefinite loop of websocket connection [ManagementConnection].

code-asher commented 6 days ago

Closing as stale, @Neyos1997 if you are able to come up with a reproduction with code-server alone let me know and I will take another look!