eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.55k stars 2.46k forks source link

Some files can not be saved when losing and restoring network connection #13702

Closed zhuanshenlikai closed 2 months ago

zhuanshenlikai commented 2 months ago

Bug Description: In the recent version of Theia, a frontendConnectionTimeout parameter has been provided in the backend socket keep-alive mechanism. This parameter is used to set the timeout period for the backend socket to wait for a connection after the frontend socket is disconnected. I have set this timeout period to 5 seconds.When the network connection was interrupted, I started editing a file. When the network was restored, I found that I was unable to close and save that file.

Steps to Reproduce: 1.Opened a file called demo.js. 2.Disconnected the network and made some changes to demo.js. At this point, the file couldn't be saved because the network was disconnected, which is expected. 3.Reconnected the network and noticed that the unsaved changes in demo.js couldn't be saved anymore.

After multiple attempts, it seems that this is because the time taken to reconnect after the network was disconnected was less than 5 seconds. As a result, the backend continued to reuse the old socket, which caused the inability to save the file.

Additional Information:

zhuanshenlikai commented 2 months ago

@msujew Could you help to resolve it,thank you.

msujew commented 2 months ago

I actually just noticed that the issue is a duplicate of https://github.com/eclipse-theia/theia/issues/12195. Please continue the discussion there.