-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
feat: Windows implementation of powerMonitor "shutdown" event #15620
Conversation
b796546
to
9acf27c
Compare
9c0f7e7
to
d4a4a26
Compare
This is an excellent effort, thank you! We should add that apps only get five seconds to the docs (right?). I'd also 😍 love to see some specs! |
@felixrieseberg I'm not sure how this could be tested considering it is mostly system interaction code. With the Linux version I was able to do some limited testing through the dbus-mock interface, but I'm not aware of anything similar to Windows. In any case it seems this change is causing problems on some of the specs (even though our users have been using this code without issues for a few months now) so I still need to do some work. |
VSCode would be very interested in a way to do a proper shutdown during OS restart, so 👍 |
@tarruda can you rebase on latest master? |
@tarruda please address latest comments or this PR will be closed in 10 days due to inactivity. |
@codebytere In a few days I might have some work time allocated on this, and would like to keep this PR open. Is rebasing on latest master enough for now? |
@tarruda yes, thanks! |
@codebytere I no longer have write access to electron repository, so I can't push to this PR. Should I open another PR with the rebased branch in my electron copy (https://github.com/tarruda/electron/tree/windows-powermonitor-shutdown-event), or is there a way to edit this PR to use my fork? |
@tarruda Yeah the only way seems to be opening a new PR, and please do. |
@tarruda would you be opposed to me trying to pick this up? i'll ensure you have author credit in git! |
@codebytere I don't mind at all, please go ahead 😄 |
Description of Change
The powerMonitor "shutdown" event is only handled on Linux/Mac, this PR adds the Windows implementation.
Handling shutdown correctly on Windows is more complex than Linux/Mac, since any process can be killed during shutdown. That means renderer processes can be killed first (and usually are) , which could result in loss of data even if the event is handled in the browser process.
Checklist
npm test
passesRelease Notes
Notes: Add Windows implementation of powerMonitor "shutdown" event