Blazor is NOT loosing SignalR connection. Browser is! (original) (raw)
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Those who work with Blazor are fully aware of the SignalR connection failed issue and the adorable "Reload" message. In a recent project, I noticed something very interesting that I never saw mentioned by anyone.
Expected Behavior
No response
Steps To Reproduce
Test 1
- Opened two tabs in Edge browser, latest version, Windows 11, each with different websites using Blazor.
- Waited for 10 minutes. Both tabs went into "sleep" mode.
- Went back to each of the tabs and there it was, the no connection message with the reload option.
Test 2
- Opened two tabs in Edge browser, latest version, Windows 11, each with different websites using Blazor.
- For the second tab I opened Developer Tools (f12) and made sure the no cache option was on.
- Waited for 10 minutes. Tabs 1 went into "sleep" mode. Tab 2 did not because of the Developer Window being open.
- Went back to each of the tabs. Tab 1 had the "no connection/reload message". Tab 2 still had the website working perfectly.
- Tested again, but now leaving the browser untouched for more that 2h and tab 1 failed once again while tab 2 resisted and worked perfectly.
Test 3
Just did the same tests but reversed the websites in tab 1 and 2. Now the website in tab 1 is working fine every time and the one in tab 2, consistently fails after awhile.
Tested this more than 5 times and the result is exactly the same every time. Opening Developer Tools with the no cache option on, is somehow preventing SignalR connection to fail or at least is allowing it to reconnect every single time without a glitch. Are you aware of this?
Exceptions (if any)
No response
.NET Version
.NET 6 latest version
Anything else?
No response