Skip to content
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

Merged
merged 6 commits into from Feb 1, 2022
Merged

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Jan 10, 2022

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 hacdias@gmail.com

@hacdias hacdias requested a review from lidel January 10, 2022 12:33
@hacdias hacdias added this to In Review in Maintenance Priorities - JS via automation Jan 10, 2022
Copy link
Member

@lidel lidel left a 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')
Copy link
Member

@lidel lidel Jan 21, 2022

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()
  }
})

@lidel lidel changed the title refactor: replace deprecated 'crashed' event feat: better handling of 'unresponsive' event Jan 21, 2022
hacdias and others added 5 commits January 21, 2022 14:07
electron/electron#23096

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
Copy link
Member

@lidel lidel left a 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
@lidel lidel merged commit 908c972 into main Feb 1, 2022
@lidel lidel deleted the rm-deprecated-crashed branch February 1, 2022 00:38
Maintenance Priorities - JS automation moved this from In Review to Done Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants