Repository navigation
Conversation
|
Thanks for your PR, @Yuvan111. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
🟡 Changes recommended
The new activity-state wrapper registrations depend on an unregistered ComponentStatePersistenceManager, causing service-provider construction to fail with ValidateOnBuild for tracing-only custom renderer hosts.
1 open issue
What changed in this PR
This PR addresses #64554 by transferring Blazor navigation activity context from static server rendering to interactive renderers, restoring route tags and navigation links on per-page component events without changing public APIs.
Changes:
- Persist and restore route activity context, clear stale correlation, and preserve interactive Router context.
- Integrate activity-state persistence with renderer initialization and Server/WebAssembly service registration.
- Add unit tests, browser scenarios, and telemetry collection for initialization and enhanced navigation.
| File | Description |
|---|---|
| src/Shared/Components/ComponentsActivityLinkStore.cs | Adds context lookup and removal. |
| src/Components/WebAssembly/WebAssembly/test/Hosting/WebAssemblyHostBuilderTest.cs | Checks render-mode registration with tracing disabled. |
| src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHostBuilder.cs | Registers the WebAssembly activity-state render mode. |
| src/Components/WebAssembly/Server/src/WebAssemblyRazorComponentsBuilderExtensions.cs | Registers WebAssembly persistence support on the server. |
| src/Components/test/testassets/TestContentPackage/ActivityLinksTestTrigger.razor | Provides an interactive event trigger and runtime indicators. |
| src/Components/test/testassets/TestContentPackage/ActivityLinksTestTelemetry.cs | Defines shared activity telemetry records. |
| src/Components/test/testassets/TestContentPackage/ActivityLinksInteractiveRouterPage.razor | Hosts interactive Router test scenarios. |
| src/Components/test/testassets/TestContentPackage/ActivityLinksInteractiveRouter.razor | Supplies the interactive Router control. |
| src/Components/test/testassets/Components.WasmMinimal/Program.cs | Enables telemetry export for activity-link tests. |
| src/Components/test/testassets/Components.WasmMinimal/Components.WasmMinimal.csproj | Enables diagnostics and adds OpenTelemetry support. |
| src/Components/test/testassets/Components.WasmMinimal/ActivityLinksWebAssemblyExporter.cs | Sends browser activity telemetry to the test server. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Interactivity/ActivityLinksWebAssemblyNavigationTwo.razor | Adds the WebAssembly navigation destination. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Interactivity/ActivityLinksWebAssemblyNavigationOne.razor | Adds the WebAssembly navigation starting page. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Interactivity/ActivityLinksWebAssemblyLayout.razor | Hosts a retained WebAssembly component. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Interactivity/ActivityLinksNavigationTwo.razor | Adds the Server navigation destination. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Interactivity/ActivityLinksNavigationOne.razor | Adds the Server navigation starting page. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Interactivity/ActivityLinksLayout.razor | Hosts a retained Server component. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Interactivity/ActivityLinksCircuitInitialization.razor | Exercises render modes and prerendering options. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/ComponentsActivityTestCollector.cs | Collects, samples, and exports test activities. |
| src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs | Configures tracing and telemetry endpoints. |
| src/Components/test/E2ETest/ServerRenderingTests/InteractivityTest.cs | Adds browser assertions for route and circuit correlation. |
| src/Components/Server/src/DependencyInjection/ServerRazorComponentsBuilderExtensions.cs | Registers the Server activity-state render mode. |
| src/Components/Components/test/ComponentsActivityStateTest.cs | Tests persistence, restoration, clearing, precedence, and lifetimes. |
| src/Components/Components/src/RenderTree/Renderer.cs | Initializes activity-state restoration for the renderer. |
| src/Components/Components/src/RegisterRenderingMetricsServiceCollectionExtensions.cs | Registers activity-state adapters and persistence metadata. |
| src/Components/Components/src/PersistentState/PersistentStateProviderServiceCollectionExtensions.cs | Registers adapters even when tracing is disabled. |
| src/Components/Components/src/PersistentState/ComponentStatePersistenceManager.cs | Owns lazily initialized activity state. |
| src/Components/Components/src/ComponentsActivityState.cs | Implements route-context capture and restoration. |
| src/Components/Components/src/ComponentsActivitySource.cs | Exposes listener and navigation-activity state. |
Review effort: Balanced
|
/review |
There was a problem hiding this comment.
Reviewed frozen head 878e81f204c188df75569065db91ff4a8c42cf6e against trusted guidance commit ca7f6f3ffa5947a42939147890049ff5194c452c.
One validated P2 finding remains: removing a conditional interactive Router does not release route-context ownership, causing later SSR activity-state updates for the retained root to be discarded.
Both routed guide reviews completed (CrossCuttingGuidance and BlazorComponentsGuidance) with the configured gpt-5.6-sol workers. Existing feedback already covers thread-safe activity-state initialization, tracing-only DI registration, and clearing stale route state when tracing is disabled; none was republished. The duplicate keyed render-mode registration candidate was discarded because the only product consumer performs singular keyed resolution and no realistic changed behavior was established. No unresolved candidates remain.
Targeted validation used the supplied worktree at the frozen SHA. The pinned SDK installed successfully, but the targeted Components test build could not proceed because required generated Blazor Web.JS distribution assets were absent; this build limitation is unrelated to the source-validated finding. No temporary diagnostic test files were added. Security review was excluded by the trusted bundle; no other materially changed area was left without its routed guide.
Generated by ASP.NET Core Pull Request Review for #70063 · copilot · gpt56 · 388.7 AIC · ⌖ 12.3 AIC · ⊞ 20K
Comment /review to run again
PureWeen
left a comment
There was a problem hiding this comment.
Two current-head issues remain after reconciling the hosted review and existing threads.
Human-directed and GitHub Copilot-generated.
|
/review |
PureWeen
left a comment
There was a problem hiding this comment.
Round 2 review at 1e9cbeeaf6eaec4bbdd1e2de9ffe302887221ccd: one non-blocking telemetry metadata issue is noted below.
This finding is based on source and immutable contract verification; no browser/runtime reproduction is claimed.
Human-directed and GitHub Copilot-generated.
|
/review |
PureWeen
left a comment
There was a problem hiding this comment.
Round 3 at a8456b1d40142e4ea8e6305554fe576395a9f874: one non-blocking P3 telemetry issue remains.
This finding is based on frozen-source/contract verification and a managed persistence probe, not a live SignalR/browser pause-resume run. The probe ran on an older installed preview runtime.
Human-directed and GitHub Copilot-generated.
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
|
/review |
There was a problem hiding this comment.
🟡 Changes recommended
A critical state-restoration bug can leave retained event handlers linked to a previous navigation, while process-wide listener races and uncontrolled Auto runtime selection undermine test reliability and coverage.
3 open issues
1 resolved since last review
Review effort: Balanced
|
Round 4 local panel at
Informational [UNRESOLVED]: Discarded diagnostics: The proposed Server/WASM restoration overwrite was ruled out by production store/render-mode filtering and Posted for informational purposes so the author can confirm the verifier didn't discard or leave unresolved a real finding; this item does not block Untested coverage limits: Both Auto destinations, restoration-before-retained-root-parameter-update ordering, browser delivery versus direct setter/store probes, the interactive-Router E2E guard's independent regression sensitivity, actual trimmed/AOT publication, and activity-listener race frequency were not established by execution. These are separate from the routine discarded checks and are not additional findings. Validation boundary: All three arms reviewed frozen target source; no PR-head build, test, or browser validation ran. O ran an ancillary shared-framework DI probe, but deleted it without a retained target-bound artifact, so it is not credited as verification. Human-directed and GitHub Copilot-generated. |
There was a problem hiding this comment.
🔵 Needs a closer look
Human architecture review is needed to confirm the renderer/scope lifetime contract and unconditional persistence registrations across mixed Server and WebAssembly lifetimes, Router ownership hand-off, and circuit snapshots.
No open issues 🎉
3 resolved since last review
Review effort: Balanced
|
/review |
|
Copilot's local review panel found no issues to raise at this commit. Informational [UNRESOLVED] diagnostics:
Posted for informational purposes so the author can confirm the verifier didn't discard or leave unresolved a real finding; this item does not block Untested coverage limits: The arms did not run the PR-head build, unit tests, browser tests, trimming/AOT publication, or a target-bound runtime repro. Additional source-only gaps included custom keyed-service-provider behavior, publish-time serialization metadata, enhanced-navigation delivery ordering, Auto enhanced-navigation coverage, and independent regression sensitivity of the interactive-Router E2E guard. The previously posted keyed-provider diagnostic was not duplicated. Validation boundary: Three independent arms completed frozen-source review at Human-directed and GitHub Copilot-generated. |
|
Please keep this focused on restoring route correlation for per-page interactivity. Can we reduce the persistence changes and test infrastructure to what this fix needs? Please preserve stale-route clearing and existing Server, WebAssembly and interactive-router behavior. |
|
@kotlarmilos , Simplified this to one renderer-owned route payload using existing persistence callbacks, removing duplicate wrappers, keyed registrations, and unnecessary telemetry test infrastructure. Preserved stale-route clearing and Server/WebAssembly/Auto and interactive-router behavior. |


Fix Blazor activity route correlation for per-page interactivity
Description
Fixes missing route correlation on Blazor event activities when using per-page interactivity. Restores the aspnetcore.components.route tag and link to the corresponding navigation activity. Addresses #64554 without changing public APIs or rendering, navigation, and event-handler semantics.
Root Cause
Blazor stores navigation activity context in a renderer-local activity-link store. Per-page navigation runs in the static SSR renderer, while component events execute in a separate interactive renderer. The navigation context was not transferred, leaving event activities without route correlation while circuit correlation remained available.
Solution
Transfer navigation activity context and route tags through the existing persistent-state infrastructure. Restore context during interactive renderer initialization and refresh it after enhanced navigation. Preserve live interactive Router context and circuit links, while clearing stale route context and avoiding payloads when no listener exists.
Test Coverage
Fixes #64554