-
Notifications
You must be signed in to change notification settings - Fork 864
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: better handling of 'unresponsive' event #1952
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM, but small ask inline that improves UX
window.webContents.on('unresponsive', event => { | ||
logger.error(`[web ui] unresponsive: ${event.toString()}`) | ||
window.webContents.on('unresponsive', () => { | ||
logger.error('[web ui] the webui became unresponsive') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to add a dialog here, where user can decide if they want to kill a rogue webui process before it slows everything down to a crawl for some reason?
Found a poc here (just needs i18n strings):
contents.on('unresponsive', async () => {
const { response } = await dialog.showMessageBox({
message: 'App X has become unresponsive',
title: 'Do you want to try forcefully reloading the app?',
buttons: ['OK', 'Cancel'],
cancelId: 1
})
if (response === 0) {
contents.forcefullyCrashRenderer()
contents.reload()
}
})
d124ca0
to
ee273c5
Compare
electron/electron#23096 License: MIT Signed-off-by: Henrique Dias <[email protected]>
License: MIT Signed-off-by: Henrique Dias <[email protected]>
License: MIT Signed-off-by: Henrique Dias <[email protected]>
License: MIT Signed-off-by: Henrique Dias <[email protected]>
ee273c5
to
c51823e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌, thank you!
dedicated button labels remove any ambiguity
d7f9ea7
to
9561bc4
Compare
Replaces the deprecated event 'crashed' by 'render-process-gone' and actually use the information correctly. In addition, I removed the
event.toString()
from the 'unresponsive' event because it does not contain additional info.References:
Noticed this because on #1951, the logs just say
[object Object]
...License: MIT
Signed-off-by: Henrique Dias [email protected]