-
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
[electron] Backend processes are already terminated before 'will-prevent-unload' is called #8186
Comments
I can confirm, it is not an electron 9.x regression. The app has the same issue. If I terminate the app with
|
Confirm, it is not a macOS issue. I can see an offline app on Windows too. |
This seems to be related. So I did the following to verify. Went back to the parent commit of #6285 and tried that version. It worked. Steps:
The prepare-travis script is not backward compatible with latest diff --git a/package.json b/package.json
index f31d68165..1a1b610d1 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"scripts": {
"postinstall": "node scripts/post-install.js",
"prepare": "node scripts/skip-prepare || ( yarn prepare:travis && yarn rebuild:clean && yarn build:clean && yarn prepare:hoisting )",
- "prepare:travis": "node scripts/prepare-travis",
+ "prepare:travis": "echo foo",
"prepare:hoisting": "theia check:hoisted -s",
"preinstall": "node-gyp install",
"build": "run build", Or you downgrade your
Can someone else also verify it? @vince-fugnitto, @lmcbout, do you happen to have time to check it? I think we have to handle both cases when we close the browser window and it unloads, and when we quit the app with @mcgordonite, do you have time to figure out a solution for all platforms together? I can take care of the macOS part and can verify it on Windows. |
@kittaakos I verified that the bug occurs on Linux as well (escaping the dialog results in an offline application), do you want me to perform any additional checks? |
No, thank you! It is just a guess, but I think we need to cover two different cases:
Back when I verified this PR, I could not reproduce the bug in the first place. See my screencast, I closed the app with |
Hi @kittaakos, I've investigated this a bit on Windows:
|
Thanks a lot for your time, @mcgordonite 🙏
That's a good idea, let me try the same on macOS.
So we broke it somewhere else. Apologies for pulling you into this issue. I'll try to find the breaking change. |
Putting this back to I think there would be consequences to making that change though. |
Hello @kittaakos, is there any new progress on this question now? I temporarily circumvented it with the following configuration:
|
No, there aren't any updates 😕 Feel free to help us; your most recent contribution was super valuable. |
@kittaakos I tried to comment out the beforeunload event in the FrontendApplication class. At this time, if the modified file is not saved and clicked to exit, the front end will not be disconnected. I guess this problem is related to the code here.
In addition, clicking the yes button did not exit normally, and I feel that the logic is not right.Looks like a bug in electron, please see here: electron/electron#24994 |
Possible related: #8595 |
@zhaomenghuan, could you please give it a try with this change? |
@zhaomenghuan OK,I' will have a try and give you feedback then. |
Hi, sorry to open up a closed issue, however on To reproduce (I'm running this on RHEL7):
The odd part about this is if you open the DevTools and then do the above steps, everything works as expected (this might be why when testing it slipped through the cracks). Any thoughts @kittaakos @marechal-p ? I'd be happy to open up a new ticket if you'd prefer that instead. |
@danieltomasku thank you for reporting the issue 👍 I've confirmed the following:
|
I cannot reproduce on Windows either. It must be specific to Linux. |
Ok thanks for confirming @vince-fugnitto @marechal-p. Good to know that it is only happening on Linux. Still puzzled why having the DevTools open makes the functionality work correctly 🤔 it certainly makes it hard to debug the issue! I tried a few things on my end to get it to work but was unsuccessful. The handling of the |
We have tried so many ways so far; we can try this too. It's a gamble, though and I do not know if it works at all. 😅 At least we have not tried with the window Update: with the |
Bug Description:
Start the app, make an editor dirty or set the
application.confirmExit
totrue
. Terminate the app withCtrl/Cmd+Q
on macOS, you get theAny unsaved changes will not be saved.
dialog, but the BE has already terminated so hittingNo
in the dialog will result in anoffline
app.We need to figure out the followings:
is it a macOS issue only?It is not a macOS only problem. Same bug on Windows when quitting the app withAlt+F4
. See here.was there a change in electron 9.x?It is not related to electron 9.x. See hereMaybe; see here.Most likely not: [electron] Backend processes are already terminated before 'will-prevent-unload' is called #8186 (comment)Mentioning @marechal-p, @mcgordonite here. If you have any idea what's causing it, please let me know.
Steps to Reproduce:
Additional Information
The text was updated successfully, but these errors were encountered: