-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Fix streaming SSR timing issue #51333
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
Conversation
Hi @SteveSandersonMS. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge. To learn more about how to prepare a servicing PR click here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Steve.
Good idea to also include the comment in the SendStreamingUpdateAsync
method.
Hi @SteveSandersonMS. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed. |
@SteveSandersonMS I think I've messed up my local git repo, so here how I ended up updating the blazor.web.js file.
I believe it's good, but wanted to get confirmation from you before merging. By the way, do we have tests that would fail if this file is generated incorrectly? |
76038c1
to
3b36db8
Compare
That sounds a bit suspicious as it should not have a merge conflict at all if it's been rebased. So just in case, I've regenerated it and force-pushed an update. This should be OK to merge now.
We used to but they got disabled. I filed an issue last September asking for those tests to be re-enabled but it doesn't look like that's yet been done: #43715 |
Fix streaming SSR timing issue
On certain rare occasions, streaming SSR could produce a blank page due to a timing issue.
Description
If a page component:
@attribute [StreamRendering]
OnInitializedAsync
whose returned task is not pre-completed but does complete very quickly (e.g.,await Task.Yield()
)... then there was a race condition. On rare occasions (seems to be about 1 in 20 page loads), the result would be a blank page. This didn't show up in our E2E tests because they always wait for fairly long async tasks so that the browser automation had time to observe the loading states. This PR adds a new E2E test that does recreate the issue and reliably fails - it does many, many page loads and basically always hits the problem at least once without the fix included here.
Fixes #51345
Customer Impact
Without this fix, a particular combination of features would be unreliable.
Regression?
[If yes, specify the version the behavior has regressed from]
Risk
The only change is to fix what is definitely a bug. It's hard to see how this would have a negative effect, as no other code is built on top of this. It's not a public API - it's just part of how the Razor Components endpoint works.
Verification
Packaging changes reviewed?