Avoid crashing on JS exceptions when app is exiting#5
Conversation
|
Proposed changes will cause errors to be silently ignored. I'm actually confused why this happens, env is in napi_pending_exception state but when flow returns to js it's gone. Test snippet: const { uIOhook } = require('./dist')
uIOhook.on('mousemove', (e) => {
console.log(`moved ${e.x} ${e.y}`)
uIOhook.emit('error', new Error('test'))
})
uIOhook.start() |
|
I'm also seeing this |
|
Still encountering the @hsource I know this thread is old and this might have left your headspace long ago, but I was wondering what your fix here actually does on the |
|
I wonder if this recent commit to libuiohook 1.2 that changes memory allocation handling in |
|
Sorry, I haven't touched this library in a while and don't think I'll have time to look into it more deeply. I'm not sure if it's related, and never really found the root cause. Your hint does seem possible! My guess is that there's some race condition or a thrown error in native code that makes it get stuck. I haven't looked into it more deeply though. |
|
Thanks for the reply @hsource, understood. If I get a chance I will try building uiohook-napi using latest libuiohook 1.2 and see if that change made a difference. Hopefully the next release of uiohook-napi will incorporate the change anyway. It's really hard to test for this issue as it's hard to trigger the conditions that lead to |
|
I am also often troubled by this problem. The program stops working properly after a while. I hope this issue will be resolved soon.😵💫 |
Have this issue fixed, im facing this issue my app goes in not responding state in mac. |
|
I noticed the recent release of uiohook-napi (v1.5.1) incorporates the above-mentioned fix in libuiohook (thanks @SnosMe!) but I haven't tested it on Mac yet. @mushan0x0 @komSh I wonder if you're still seeing this issue even in latest v1.5.1? |
Thank you for your efforts. After testing, the issue still exists in v1.5.1. |
|
Confirming that I also still get the occasional |
|
same question,When running on a mac for a while exit software will not respond |
|
The CGEventTap timeout error is fixed by #37 or kwhat/libuiohook#184 This does not fix that issue, so I'll close this. |
Motivation
Crashes
While testing awakened-poe-trade on Mac, I noticed that quitting Awakened POE Trade would cause a crash instead of exiting gracefully.
To reproduce:
yarn electron:servein awakened-poe-tradeIt'll give a stacktrace like this and an unexpected closing error:
Hang when exiting
Sometimes, when I close Awakened POE Trade via the dock, it fails to exit. It seems to do this only after the error message:
Fix
Testing
yarn prebuildon local versionyarn add ../uiohook-napito install local version