Repository navigation
[release/11.0] Avoid sending JSInterop calls when component is disposed - #69522
Merged
Merged
Conversation
* Regression test for the report. * Guard all outcomming JSInterop calls with disposal check.
3 tasks
Contributor
|
Hi @github-actions[bot]. 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. |
kotlarmilos
approved these changes
Sep 29, 2026
Contributor
|
Hi @github-actions[bot]. 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. |
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #69517 to release/11.0
/cc @ilonatommy
Avoid sending JSInterop calls when component is disposed
This change centralizes disposal handling in
VirtualizeJsInterop, which owns the object reference. It consists of:ObjectDisposedExceptionwhen disposal races with an invocation already starting.Description
Virtualize<TItem>can be disposed while an asynchronous JS interop operation is pending. When the operation completes, the lifecycle continuation may issue another interop call using the component's disposedDotNetObjectReference, resulting in anObjectDisposedExceptionand circuit termination.Fixes #69501
Customer Impact
Interactive server apps that use
Virtualizecomponent can occasionally terminate the circuit on navigation (or another render-tree updates that removes the component while JS interop is pending).The failure was reproduced in the Aspire Dashboard through rapid navigation and in a standalone Blazor Server application. When it occurs, the browser displays the unhandled-error UI and the user must reconnect or reload the application.
There is no workaround other than avoiding the affected navigation timing.
Regression?
This is a lifetime race in the existing virtualization implementation that has been there since the beginning.
Risk
The change is internal and does not alter public API. It only changes behavior after
VirtualizeJsInteropdisposal has started.Exception handling is limited to
ObjectDisposedException. Other interop exceptions continue to propagate normally. Browser-side disposal still bypasses the ordinary-call guard so required cleanup can run.Verification
Packaging changes reviewed?