-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Theia creates 2 web-sockets if we override the WebSocketConnectionProvider class #13094
Comments
@safisa You probably need to rebind the local websocket connection provider then as well: rebind(LocalWebSocketConnectionProvider).toService(CustomWebSocketConnectionProvider); See also our own messaging module. |
@msujew I already tried this but didn't help, same issue. |
@msujew I think it is related to the PR from 1.42 and not the one above: 12590 But, I don't know how to make my custom binding work at the preload level. src/browser/preload/custom-preload-module.ts:
package.json:
but this also not working, the custom preload file is not loaded at all. Maybe this is not how we can contribute to preload step! Can you help? Thanks |
Right, it's likely more related to #12590
It should work though. Can you see whether your Note that you need to rebind the |
@msujew Thanks a lot. |
Alright, that's good to know. Closing the issue :) |
Hi @msujew I see that there is an error message on the browser console log regarding the rebind above:
My custom class works as expected, but does the error above affect anything? I tried to do just bind not rebind in the preload module, in this case, there is no error message in the log, but I see 2 web socket connections in the network (dev tools), one is active (all the messages go through it) and the other one has several messages only... Thanks |
Yes, it will prevent all preload scripts from running (as indicated in the error message), i.e. identifying backend OS and loading translations. Instead of calling |
@msujew but once I tried to do only bind, I see 2 web sockets in the network tab in dev tools: In the image above the selected one is the inactive one. |
@msujew as mentioned here, localizations are still not loading. I have created a preload-module where I have only one customization which is websocket one:
so here is my setting:
The frontend is pointing to all other customizations. Even then, language translations are not loading. In addition, I see errors in the console logs:
|
@msujew any thoughts ? |
@msujew I have tried the following in the preload module after which localizations were loading but websocket connection was not getting established.
One thing to mention here is that we have the following code in our custom-frontend-application-module where we have all rebindings and this module is pointed by the frontend mentioned in the package.json file NOTE - WebSocketConnectionProvider is getting rebinded twice. One occurrence is in the preload module and other one is in the frontend module
|
@msujew could you please try rebind something(preferrably websocket connection provider) in frontendPreload ? I think frontendPreload is not able to unbind and rebind. Without unbinding and rebinding, custom WS connection providers cannot be loaded. |
@msujew Thank you for fixing the issue. I have added your fix manually on my local machine after which I am seeing a new error in the console logs. Not sure if it is some kind of regression or I am missing something. My environement:
Here is the code to reproduce it: From the root of the above directory, run the following command:
and open "http://localhost:4444/". In the console logs, you will see the below error:
|
@hyddel Since we now use the same DI container for both the preload and the runtime of the app, you're not allowed to call |
got it, thanks. |
Bug Description:
Hi,
It could be difficult to explain the issue I am facing on the latest Theia (1.43.1), but I will try:
I have a class that extends the WebSocketConnectionProvider:
And here is the binding code:
It was working correctly until I upgraded to 1.43.1 (from 1.40). I see now in the dev-tools on the network tab that there are two web sockets, and only one is actually working (before that there was only one).
If I debug the code from dev-tools and put a breakpoint inside the createWebSocket method in both classes (CustomWebSocketConnectionProvider and the base WebSocketConnectionProvider class), and reload the page, the break point breaks in both of them! this should not be the case, since I override this class and rebind it to the new one.
I think this issue is caused by the Remote SSH PR from 1.43: #12618
Steps to Reproduce:
Additional Information
The text was updated successfully, but these errors were encountered: