Describe the bug
A few of our MacOS Catalina users that are running the Zulip desktop are seeing frequent crashes in the app. But only the MacOS users. After a while the window just has the toolbar with the rest of the window just grey (screenshot below). When I click on the reload icon, the desktop app closes.
To Reproduce
Just open the app and leave it running. Notifications are turned on.
Expected behavior
That the app not crash and work as before.
Screenshots

Desktop (please complete the following information):
Additional context
Seems to happen more frequently when usage on unfoldingword.zulipchat.com is heaviest.
For the record: Upstream issue - electron/24920
Not sure it's very helpful but here is the console error raised when this bug occurs.

@Thomas-lhuillier thanks, that's likely quite helpful.
Can you confirm you're seeing this with the latest 5.4.3 release?
(I believe this was likely fixed in 5.4.2).
Unfortunately I experience this bug on both v5.4.2 and v5.4.3.
One thing I noted: it seems to happen when receiving private messages.
I am also still seeing in v5.4.3. Forgot that this was an electron app. I do see the same error message in the screenshot above.
I am also still seeing this in 5.4.3, MacOS 10.15.6.
I can consistently reproduce this when I am private messaged by one particular person in our organization.
This is on a self-hosted Zulip server.
I would like to help but I don't know what information I can provide (and whether it's safe to share publicly!)
If you can capture the exception from the developer tools (available in the app's menus), that'd be very helpful.
I hope this is helpful! Please let me know if there's further information I can share.
This is immediately after receiving a private message causing my screen to go gray (or grey):
electron/js2c/renderer_init.js:142 Uncaught TypeError: Cannot read property 'forEach' of undefined
at dispatchEvent (electron/js2c/renderer_init.js:142)
at EventEmitter.<anonymous> (electron/js2c/renderer_init.js:142)
at EventEmitter.emit (events.js:223)
at Object.onMessage (electron/js2c/renderer_init.js:114)
dispatchEvent @ electron/js2c/renderer_init.js:142
(anonymous) @ electron/js2c/renderer_init.js:142
emit @ events.js:223
onMessage @ electron/js2c/renderer_init.js:114
It appears to be the same that @Thomas-lhuillier showed. Is there more info I can share?

@manavmehta @akashnimare can you try to investigate this exception?
I'm guessing this is a notifications library issue is some sort, and we should probably start with doing a build with Electron 10 to see if it's resolved upstream like the previous iteration was.
Any action on this? I too have been experiencing this for the last month. I dont even use the desktop app anymore because it crashes so frequently.
The best solution we have found is for Mac users to install the older v5.2.0 of desktop app and turn off auto updates.
I've faced the same problem with v5.2.0 & v5.3.0.
Here is the error message

The same issue with v5.4.3 after update MacOS Big Sur. It happens at different times, usually after the application has been minimized.


Same here. Just upgraded to Big Sur, and just started getting this problem. v5.4.3. Usually happens when receiving a private message.
@akashnimare Sorry for being AFK for too long. I don't think it is a macOS bug now. As Big Sur is a big change, they must have tested the reported bugs, which again, 'might' have included the cause of this. Nor does the error pointed out by @sipshowpeers seem to be 'directly' coming from our codebase but some electron-ish library/API we use.
Update: I am one of the people who saw this bug very very rarely.
Just witnessed this on Big Sur - Prod always. Never Dev.

I believe this error is originating from here - WebView.
One solution I can think of is completing #1018
There have been recent discussions on upstream thread.
We have several users in our organisation that experience this problem ONLY after updatating to MacOs Big Sur.
We have several users in our organisation that experience this problem ONLY after updatating to MacOs Big Sur.
Same issue after updating to MacOs Big Sur. Zulip version 5.4.3

Can someone figure out, either via a debugger or by patching console.log statements into Electron, what eventKey is when this WEB_VIEW_EVENTS[eventKey].forEach expression is undefined?
I have a wild guess… This would explain why that TypeError would be triggered by the render process crashing, but not why the render process crashes in the first place.
Same here. I only started experiencing this bug after updating to Big Sur.
We’ve received a trace from a user that seemingly matches this to CharlieHess/node-mac-notifier#33.
Adding another one. Like @timabbott & @andersk noticed, this may definitely be a problem with the notifications. The app crashes for my colleagues when I send them a PM.
This line may be a lead:
Granted permissions request for notifications from null
I also tried to navigate them to Settings -> Notifications -> Send test notification and the app crashed then.

I get the same issue with grey-screen-of-death multiple times a day - but only after upgrading to OSX Big Sur. v5.4.3 of the Desktop app.
Seems to be happing randomly - sometimes multiple times within a minute. Sometimes when I write a message, sometimes it just happens when the app has been out-of-focus for some time. Other times hours go by without problems.
When I press the refresh button it works again for a while - until the next "crash". Really annoying and makes the desktop app almost unusable for mig.
I'm cheering for you, hoping you'll figure it out soon! ;-)
I just thought I would chime in and say that this is happening to me also. I thought it might have been an issue with my under powered self hosted Zulip server, but then I found this thread. I have only two active users on my server. My logs are likely very lean. If there is something that you would like tested and have logs sent your way, let me know. I'm also on chat.zulip.org if that helps.
I have rolled back to 5.2.0 of the client for now. It seems to be stable.
My entire team and I have been getting this crash on v5.4.3 and a few before, way before the Big Sur OSX update. Only happens on the macOS app, the browser version is fine. Crashes on every notification popup.
We believe this has been resolved by removing node-mac-notifier (#1046) in 5.5.0, just released. Can anyone confirm?
@andersk I can confirm after couple of hours of using master branch that I no longer get the 'gray screen of death'. Thanks for the fix!
Works for me, too, using v5.5.0
Great, thanks all. Closing as fixed. If anyone does see this again with v5.5.0, please let us know.
Works for me as well (so far ;) )
Can also confirm it works. Thanks guys.
Same for me. Has been working flawlessly since the upgrade to 5.5.0. 🚀 Much appreciated 🙏
Just for the record, hopefully the grey screen wasn't just replaced by white screen I found in Zulip this morning after nightly suspend and morning resume. This time however it was solvable by #+R, so a different issue.

@rhusar Yeah, that’s almost certainly different. If it happens to you again, file a new issue and include any errors you might find in Tools → Toggle DevTools for Zulip App → Console and/or Tools → Toggle DevTools for Active Tab → Console.
Worked for me! Thank you folks 🎉
Most helpful comment
We believe this has been resolved by removing
node-mac-notifier(#1046) in 5.5.0, just released. Can anyone confirm?