-
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
WebView of the same vscode plugin not loading in second electron instances #13107
Comments
Just to be sure: "a second instance" is a whole new process, not just a new window, right? |
yes, it should be as I e.g open blueprint in a new folder calling |
Since this only happens when starting the application multiple times, this is related to #10890. |
From all I'm reading I get that running multiple process on the same data directory (containing indexdb and other files) is not supported in electron. Note that VS Code does not seem to support this either: if you do |
Yeah, but you'd have to use a different app data path. Just using the same app data area in two different processes is a recipe for disaster. It's never going to work because it's not supposed to work 🤷 |
If the idea is just to let the user open more windows via |
I think this discussion is more appropriate in #10890. We should be able to fix both issues with a single change though. |
Seems to be a long standing issue: #10693. Would be interested in "why" the registering fails. This issue can sometimes be encountered in VS Code as well, as seen here: microsoft/vscode#125993. However, with multiple instances in Theia, we can reproduce it consistently. |
At least in some instance in the linked issue it seems to be zombie instances of the |
@sdirix I don't think we're doing anything wrong in setting up the service workers. We can try to debug the chromium source code to understand why exactly this error occurs, but since this is not something we as a group are competent in, this might easily take a week (or more), and we would be debugging a use case that is documented as not supported. Also, there is no guarantee that we will find out what the problem is, and if we might find out that this does not work because it's not supposed to. I'm not sure going down this rabbit hole is a good investment if we're not sure we need it. |
More evidence that running more than one electron main process is a bad idea: you get race conditions from the IDB API:
Also, there is an oldish issue against electron with an explanation: electron/electron#2493 |
My recommendation would be to implement three new behaviors in Theia:
|
Part of eclipse-theia#13107 Contributed on behalf of STMicroelectronics Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
…ata' path Part of #13107 Contributed on behalf of STMicroelectronics Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
Bug Description:
Running Theia in Electron (e.g as Blueprint) twice and trying to open the same WebView in both instances fails. The first instances opens the WebView the second one fails with:
The error is thrown in:
host.js
navigator.serviceWorker.register("service-worker.js").then((async a=>{
Steps to Reproduce:
Instead of Theia Blueprint you can also just use the Theia Electron example app to reproduce the issue.
The same does not happen in VSCode.
Additional Information
The text was updated successfully, but these errors were encountered: