[COMPASS-6029] Electron ipc broadcast error on `compass:loading:change-status` event Created: 17/Aug/22  Updated: 30/Oct/23

Status: Open
Project: Compass
Component/s: Electron
Affects Version/s: 1.32.6
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Rhys Howell Assignee: Julia Oppenheim
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to COMPASS-5606 Failure to set theme are crashing Com... Open
Story Points: 3

 Description   

User on Compass 1.32.6 with Mac Big Sur 11.1 encountered an error with electron message sending:

MongoDB Compass has encountered an unexpected error
Error: Render frame was disposed before WebFrameMain could be accessed
at Object.n.send (electron/js2c/browser_init.js:165:413)
at Object.b.send (electron/js2c/browser_init.js:161:2494)
at /Applications/MongoDB Compass.app/Contents/Resources/app.asar/build/main.js:1:3808
at Array.forEach (<anonymous>)
at IpcMainImpl.t.broadcast (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/build/main.js:1:3766)
at compass:loading:change-status (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/build/520.js:1:17267)
at IpcMainImpl.<anonymous> (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/build/main.js:1:3656)
at Object.<anonymous> (electron/js2c/browser_init.js:161:9492)

From slack: https://mongodb.slack.com/archives/C0U7K0MC3/p1660668631951739

I think what’s happening is that our main application which spawns the Compass windows isn’t able to send a message to one or all of the windows it thinks exists because that window doesn’t actually exist (maybe a recently closed window or one that’s just starting up and hasn’t fully initialized). It may be a bug in our window management or in electron’s message sending. This ticket involves investigating the bug and fixing or providing a workaround so that users don't encounter this message.

Suggestion from the triage call was to handle all errors from sending ipc messages from the main process and e.g. log them. We could do this by wrapping methods in hadron-ipc with a try/catch.


Generated at Wed Feb 07 22:41:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.