Skip to content
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

Blazor Web App on IIS: Safari iOS 18.2.1 Rejoins Slowly (10-30s Delay) #60086

Open
1 task done
nieuwveen opened this issue Jan 29, 2025 · 6 comments
Open
1 task done
Labels
area-blazor Includes: Blazor, Razor Components Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue.

Comments

@nieuwveen
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When running a Blazor Web App with Interactive Render (Global mode) on a Windows Server 2022 (IIS, WebSockets enabled, SSL configured), the app experiences a slow rejoining process (10-30 seconds) when switching back to Safari on an iPhone 15 Pro (iOS 18.2.1) after the browser has been in the background for a few seconds.

This delay occurs when Safari suspends the WebSocket connection while the app is in the background. Upon returning, Blazor attempts to restore the connection and rejoin the same session, but the process is unexpectedly slow. Instead of an instant reconnection (expected within 1-2 seconds), the app takes anywhere from 10 to 30 seconds to rejoin, making the user experience sluggish and unresponsive.

Expected Behavior

The expected behavior is that the session should reconnect instantly or within 1-2 seconds. However, it takes 10-30 seconds, making the app feel unresponsive.

This issue does not seem to occur on other browsers (IOS Edge, or using a webview (PWAbuilder.com))

Steps To Reproduce

Video ->
https://github.com/user-attachments/assets/8e13ca3f-98d7-4275-97f2-6cf0a8b43964

Steps to Reproduce
Create a new Blazor Web App .Net9 (dotnet new blazor -n MyApp)
Choose interactive render, global
Modify the Main Page
Add an field to track session state
Publish the App to IIS on a Windows Server 2022
Ensure WebSockets is enabled in IIS
Add an SSL certificate
Open the app in Safari on iPhone 15 Pro (iOS 18.2.1)
Enter some text in the input box
Switch to another app for ~10 seconds
Switch back to Safari
Notice "Rejoining server…" appears and takes 10-30 seconds
Check if the same circuit/session is used

Exceptions (if any)

No response

.NET Version

9.0.102

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Jan 29, 2025
@javiercn
Copy link
Member

@nieuwveen thanks for contacting us.

Is the session able to resume after the disconnection or does the page refresh and a new session gets started?

@javiercn javiercn added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Jan 29, 2025
@nieuwveen
Copy link
Author

nieuwveen commented Jan 29, 2025

@javiercn Yes, the session resumes after disconnect
(its visible in the video, @ sec 30, the same text input is still there)

@dotnet-policy-service dotnet-policy-service bot added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Jan 29, 2025
@nieuwveen
Copy link
Author

@javiercn
I created a screenshot of the safari dev tools on my mac, the negotiate process takes 47 secondes, then it resumes the same session.
Image

@danroth27
Copy link
Member

@nieuwveen Did this only start happening recently? Or has this behavior always been this way for your app?

@danroth27
Copy link
Member

Potentially related to #48724

@danroth27 danroth27 added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Jan 30, 2025
Copy link
Contributor

Hi @nieuwveen. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@danroth27 danroth27 marked this as a duplicate of #40764 Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue.
Projects
None yet
Development

No branches or pull requests

3 participants