Delay with Electron Angular App after switching from WebSocket to Socket.IO

78 views Asked by At

We have a multi-services solution that uses Electron to run an Angular app on Windows which receives events from a Node/NestJS application.

Until recently we used WebSocket to send those events to the client but we now switched to Socket.IO. After this change, we are now experiencing delays with logic that is kicked of by some of those events in the client app. The events are received by the client promptly, the rendering looks efficient but something seems to be blocking and the elements are displayed with a delay (of up to ~3 seconds).

We experience this delay only with the client embedded in Electron. If we run the Angular app from the command-line directly everything is working as expected.

We've updated all relevant libraries to troubleshoot, to no avail.

"socket.io-client": "^4.7.2", // client/ Angular
"ngx-socket-io": "^3.3.0", // client/ Angular
"@angular/core": "^15.0.2", // client/ Angular
"electron": "^22.0.0",
"electron-rebuild": "^2.3.4",
"@nestjs/platform-socket.io": "^9.3.12", // server/ NestJS 

We've tried alternating socket.io-client options, such as setting explicit transports, autoConnect, reconnectionDelay, etc.

We have compared Chrome DevTools Performance Analysis (doesn't help us understand better) socket.io with delays websocket without delay

Any pointers that could help us better understand and solve this problem are highly appreciated!

0

There are 0 answers