vladimiry / ElectronMail

Unofficial ProtonMail Desktop App
GNU General Public License v3.0
1.48k stars 96 forks source link

Crash on Notification (macOS) #633

Open ylluminarious opened 10 months ago

ylluminarious commented 10 months ago

I have an issue where new notifications of unread emails is crashing ElectronMail, or at least generating some very odd errors if the app doesn't actually crash. This is my operating system version: macOS 13.5.1 arm64

I've been struggling with this issue for many months now. Due to time constraints, I've simply been working around it by simply opening Protonmail in a browser and marking unread emails as read, but this is getting tiresome.

I would like to know why this issue is occurring and help get it fixed. It only ever occurs when I receive a notification for an unread email, and only for one account. I've tried it with other accounts which do not trigger this error. I can't understand why that would be the case.

Sometimes, the application does not actually crash, but instead displays red notification bubbles which contain something like the following:

Invocation timeout of calling "updateOverlayIcon" method on "electron-mail:ipcMain-api" channel with 25000ms timeout
Uncaught (in promise): Error: Invocation timeout of calling "resolveUnreadNotificationMessage" method on "electron-mail:ipcMain-api" channel with 25000ms timeout
Error: Invocation timeout of calling "resolveUnreadNotificationMessage" method on "electron-mail:ipcMain-api" channel with 25000ms timeout
at <anonymous>:965:24
at Observable.init [as _subscribe] (<anonymous>:5192:35)
at Observable._trySubscribe (<anonymous>:3207:25)
at <anonymous>:3201:121
at Object.errorContext (<anonymous>:10325:16)
at Observable.subscribe (<anonymous>:3199:26)
at doInnerSub (<anonymous>:6915:58)
at outerNext (<anonymous>:6909:40)
at OperatorSubscriber._this._next (<anonymous>:5367:15)
at Subscriber.next (<anonymous>:3613:123)

Sometimes, I also see native OS popups which contain these:

Unhandled Error
RuntimeError: abort(Error: Failed index emails in 30000ms (mails portions size: 1000)) at Error
    at /Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:704:23
    at process.z (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:714:14)
    at process.emit (node:events:525:35)
    at process.processEmit [as emit] (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:69848:45)
    at emit (node:internal/process/promises:149:20)
    at processPromiseRejections (node:internal/process/promises:294:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)
    at process.z (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:719:21)
    at process.emit (node:events:525:35)
    at process.processEmit [as emit] (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:69848:45)
    at emit (node:internal/process/promises:149:20)
    at processPromiseRejections (node:internal/process/promises:294:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)
Unhandled Promise Rejection
Error: Failed index emails in 30000ms (mails portions size: 1000)
    at /Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:76441:50
    at doInnerSub (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:64550:33)
    at outerNext (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:64544:40)
    at OperatorSubscriber._this._next (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:63002:15)
    at Subscriber.next (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:61248:123)
    at AsyncAction.<anonymous> (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:62856:26)
    at AsyncAction._execute (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:67121:18)
    at AsyncAction.execute (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:67114:28)
    at AsyncScheduler.flush (/Applications/ElectronMail.app/Contents/Resources/app.asar/app/electron-main/index.cjs:67192:32)
    at listOnTimeout (node:internal/timers:569:17)

I can attach much larger macOS crash reports as well if necessary.

vladimiry commented 10 months ago

From the first glance, a quick workaround might in making sure that toggles located in the "desktop notification" block are disabled for the account. See animated screenshot in v4.14.0 release description. I'm aware that this feature has to be improved in terms of performance.

ylluminarious commented 10 months ago

@vladimiry Thank you for your suggestion. You're correct that this functions as an effective workaround for the time being. I disabled Custom notification content and the crash / errors stopped occurring. I will go ahead and leave this setting disabled for now to keep the issue from reappearing, but am willing to help diagnose the issue further if you need any feedback from me.