Skip to content

SignalR - Chrome/Edge new Freeze Tabs is dropping client connections #33970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
drbergeron opened this issue Jun 30, 2021 · 4 comments
Closed
Assignees
Labels
area-signalr Includes: SignalR clients and servers
Milestone

Comments

@drbergeron
Copy link

Is your feature request related to a problem? Please describe.

I've created a SignalR application and it's been working well for a while now, but as the newest versions of chrome have been rolling out I've noticed that when I'm not actively using the web app, the app loses connection to the SignalR server because it's taking too long to handshake. I've done some digging into this and I believe this is due to the javascript throttling that occurs in a tab/window running in the background and/or being frozen with the new grouped tab freezing logic.

Describe the solution you'd like

Would like to see at minimum some doc around this at the links below in the SignalR area so developers are aware of it, and a suggested withAutomaticReconnect and ServerTimeout settings to alleviate the issue if possible (I'll be messing with this myself to see if I can get something that doesn't end up dropping the connection via the various properties).

https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.signalr.client.hubconnection.servertimeout?view=aspnetcore-5.0

https://docs.microsoft.com/en-us/aspnet/core/signalr/javascript-client?view=aspnetcore-5.0

Ideally SignalR should "just handle it" but I'm not sure of a programmatic workaround at the moment for this.

Additional context

Chrome Release notes on these two features:
https://chromeenterprise.google/policies/?policy=IntensiveWakeUpThrottlingEnabled

From chrome 91 release notes:

Chrome allows users to organize tabs into collapsible groups, helping them stay productive. For some users, Chrome 91 pauses those tabs when the user collapses them, to reduce CPU and power consumption. Chrome does not pause tabs if they are playing audio, holding a web lock, holding an IndexedDB lock, connected to a USB device, capturing video or audio, being mirrored, or capturing a window or display.

While not currently an issue with firefox or edge, if this is the beginning of some sort of new energy-smart paradigm in browser behavior it could have much wider reaching implications for SignalR and polling across the web in general. Might be worthwhile to get in front of it.

@BrennanConroy
Copy link
Member

Dupe of #31079

This is already fixed in the latest patches for the Javascript client.

@BrennanConroy BrennanConroy added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Jun 30, 2021
@ghost ghost added the Status: Resolved label Jun 30, 2021
@BrennanConroy BrennanConroy changed the title SignalR - Chrome's new Freeze Tabs and JS throttling is dropping client connections SignalR - Chrome/Edge new Freeze Tabs is dropping client connections Jun 30, 2021
@BrennanConroy BrennanConroy removed ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved labels Jun 30, 2021
@BrennanConroy
Copy link
Member

Actually, taking over this issue for the freeze tabs browser feature, that isn't handled yet because it's new.

@javiercn javiercn added the area-signalr Includes: SignalR clients and servers label Jun 30, 2021
@BrennanConroy BrennanConroy added this to the Next sprint planning milestone Jun 30, 2021
@ghost
Copy link

ghost commented Jun 30, 2021

Thanks for contacting us.

We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@BrennanConroy
Copy link
Member

We aren't adding anything to the library to workaround the Tab Freezing feature in browsers for now. Instead we log in the browser when we detect that a tab is frozen and point to a doc that explains what is going on and a potential solution application developers can do to workaround the issue if it's important for them.

See #34008 for the client change and https://github.com/dotnet/AspNetCore.Docs/pull/22773/files for the docs (docs will be live on docs.asp.net soon)

@ghost ghost locked as resolved and limited conversation to collaborators Aug 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

No branches or pull requests

4 participants