-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[release/8.0] [Blazor] Fix misdetection of component comments #52744
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 @MackinnonBuck. 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. |
Hi @MackinnonBuck. If this is not a tell-mode PR, please make sure to follow the instructions laid out in the servicing process document. |
Hi @MackinnonBuck. 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. |
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
@MackinnonBuck can you fix the merge conflict? |
7f88530
to
5bbcd02
Compare
@MackinnonBuck are the test failures related? |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Test failures are unrelated |
Fix misdetection of component comments
Backport of #52647
Fixes an issue where in certain cases, SSR updates fail to apply to the page. This results browser errors which may cause parts of the app to lose functionality.
Description
Under the hood, Blazor uses HTML comments to store component metadata in the DOM. When an SSR update occurs, those comments help indicate which HTML elements are associated with a component. However, one aspect of the enhanced navigation/streaming rendering logic was sometimes misinterpreting ordinary HTML comments as Blazor component comments, causing an error to be thrown. This edge case doesn't occur often, but the error can be reproduced fairly consistently if:
This PR fixes the issue by correcting the logic that sometimes misinterprets non-component comments as component comments.
Fixes #52126
Customer Impact
Customers with interactive components in the top level of their app's layout are likely to encounter this bug. This seems to be a somewhat common pattern - we've seen multiple customers in the linked issue indicate that they're affected by this bug. When the bug occurs, it may cause parts of the app to stop working; components may not become interactive and link clicks may not do anything.
Regression?
This is a bug in streaming rendering and enhanced navigation, which are features that were introduced in .NET 8. The bug has existed for as long as SSR updates have been allowed to add, update, and remove interactive components.
Risk
The change to this particular piece of code is fairly straightforward to reason about, and we have a new E2E test for the exact scenario that produced the error.
Verification
Packaging changes reviewed?