Closed busslina closed 4 months ago
https://stackoverflow.com/a/76068658/4681977
Tabs running code that uses real-time network connections (WebSockets and WebRTC) are not slowed down to prevent these connections from being closed unexpectedly.
My bad 97%
Firstable I'm explaining my Warm-up logic so if you can see a better way to do it I will appreciate any advice. Secondly I will expose an only web (I believe) fatal issue that is related to the Warm-up.
My Warm-up master driven:
This way I proceed to warm-up different pieces at the moment/state I want it to load.
For data capsules, I created two side effects wrappers that help to cache, update and reset the wrapped data:
asManagedData
andasManagedAsyncData
.This logic works like a charm.... Except for a very weird web issue:
Web Weird Issue
In the past I have seen that a web browser (in my case Edge) is like in a sleep mode when minimized. It was not big deal because when I put back in front you just see a few milliseconds the old screen (maybe it was connected to websocket 10 seconds before, but until you put in front it gets stuck with the loading widget, but not big deal).
But what is happening now? I'm testing WS connection lost and reconnection. If I do this with the web page in the front of the screen everything is good. But If the web page is minimezed I got this error:
You can see where it is thrown in the code I shared.
So it is crazy because it means that when the web page is in the background some of the code is running and some other code isn't (maybe the one related with the visuals...).
Any thoughts on this?
Info
Web renderer: html (I have to check with canvaskit) Updated: Checked with canvaskit: Same error
Updated I: Video demo
https://streamable.com/ftmvtw
Updated II
Tested with Firefox in production: Same error Tested with Chrome in production: Same error (or worst)
Sources
When I minimize the browser window, the script stops. How fix it? How to prevent JavaScript from running slow on minimized browser window?