Repository navigation
Fix Blazor browser option handling - #70526
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The replacement path skips component descriptor registration, leaving streamed components non-interactive, while removing the popstate handler can make Back change the URL without restoring the previous page.
2 open issues
What changed in this PR
This PR addresses #70510 by applying server-configured browser options to Blazor startup, rendering, navigation, and circuit behavior.
Changes:
- Read shared SSR options when scheduling circuit disposal and applying streaming updates, and refresh navigation listeners when configuration arrives.
- Forward WebAssembly culture and circuit logging settings, and honor reconnection intervals shorter than one second.
- Add browser regression tests and supporting test-asset configuration.
Review was source-level; browser tests were not run.
| File | Description |
|---|---|
| src/Components/Web.JS/src/Services/WebRootComponentManager.ts | Reads the configured timeout when scheduling circuit disposal. |
| src/Components/Web.JS/src/Services/NavigationEnhancement.ts | Clears programmatic enhanced navigation when detaching listeners. |
| src/Components/Web.JS/src/Services/ComponentDescriptorDiscovery.ts | Adds culture to WebAssembly server options. |
| src/Components/Web.JS/src/Rendering/StreamingRendering.ts | Reads shared DOM-preservation settings during updates. |
| src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectionHandler.ts | Allows the first retry-timer tick below one second. |
| src/Components/Web.JS/src/Boot.WebAssembly.Common.ts | Applies server culture while preserving explicit JavaScript precedence. |
| src/Components/Web.JS/src/Boot.Web.ts | Applies browser configuration to navigation, circuits, and WebAssembly. |
| src/Components/test/testassets/Components.WasmMinimal/Program.cs | Allows culture tests to bypass the fixed test culture. |
| src/Components/test/testassets/Components.WasmMinimal/Pages/BrowserConfigurationEnvVars.razor | Displays the active application culture. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/GlobalInteractivityApp.razor | Accepts a JavaScript culture override for tests. |
| src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs | Exposes browser-option settings through test configuration. |
| src/Components/test/E2ETest/Tests/ServerBrowserConfigurationTest.cs | Adds timeout, navigation, streaming, logging, and retry scenarios. |
| src/Components/test/E2ETest/Tests/BrowserConfigurationTest.cs | Checks server-configured culture and JavaScript precedence. |
Review effort: Balanced
|
/review |
PureWeen
left a comment
There was a problem hiding this comment.
One additional issue remains at 80353778ef33c4622a3e2b40adc4ab0dbddbc381: disabling DOM preservation does not stop the navigation that delivers the setting. The existing comments already cover history traversal and streamed-component registration.
Informational verifier trace, non-blocking: [DISCARDED] Boot.Web.ts:142: static-only responses do not emit browser configuration without an interactive component marker. One verifier discarded this as pre-existing behavior. The follow-up checks did not agree on raising it as a separate defect.
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 agent-reviewed-approved.
Human-directed and GitHub Copilot-generated.
Keep culture, circuit timeout, logging, and retry timing fixes. Preserve explicit startup values over server configuration and add browser coverage for server-only and conflicting options. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/review |
There was a problem hiding this comment.
Source-only review of frozen head 93cd111e5eb3fefcd91f462683c232864d787f85.
No verified new defect or unresolved candidate remains. The sole specialist candidate was independently checked and discarded because merge-base source proves the same maxRetries override on the exact input sequence; it is surfaced inline for auditability as required by the review contract.
Both routed guides completed: cross-cutting checks covered option precedence, lifecycle, timer behavior, configuration, localization, compatibility, and changed-test fit; Blazor checks covered hosting boundaries, circuits, WebAssembly culture, browser configuration, and E2E source coverage. Existing feedback about DOM preservation, history traversal, and streamed descriptor registration concerns changes absent from this frozen head, so it was not republished or counted as a current duplicate. No unresolved candidates remain.
Provenance: immutable guidance commit dd1062f94f356d6be59ad340e5aff2fd829165c6; merge base 60ef0101bf97cfccb49ede034b38659c15474d1b; base tip dd1062f94f356d6be59ad340e5aff2fd829165c6. Proof is source-only. Target code, tests, CI, browser workflows, and samples were not executed. Security implications were excluded by supplied policy. No materially changed area lacked a routed guide. Limitations: tracked Git bytes only; symlink, submodule, and LFS targets cannot establish behavior, and feedback posted after bundle preparation is not observable.
Generated by ASP.NET Core Pull Request Review for #70526 · copilot · gpt56 · 264.2 AIC · ⌖ 11.3 AIC · ⊞ 18.9K
Comment /review to run again
PureWeen
left a comment
There was a problem hiding this comment.
The local panel found one additional initializer-logging regression at 93cd111e5eb3fefcd91f462683c232864d787f85, reported independently by two of the three review arms.
Informational verifier traces, non-blocking:
- [UNRESOLVED]
src/Components/Web.JS/src/Boot.Web.ts:145: top-levelBlazor.start({ logLevel })does not override the server level for circuit logging. The verifier found no binding contract requiring that precedence; the top-level value did not control circuit logging at merge base either. This is separate from the initializer regression below. - [UNRESOLVED]
src/Components/Web.JS/src/Boot.Web.ts:155/src/Components/Web.JS/src/Services/WebRootComponentManager.ts:237: enhanced navigation replaces an initializer-supplied inactivity timeout with the server value. The verifier found no binding initializer-versus-server precedence contract, and merge base ignored both values rather than honoring the initializer. - [DISCARDED]
src/Components/Web.JS/src/Boot.Web.ts:152,173,177-182: the adjacent DOM-preservation, reconnection-dialog and extension-key precedence concerns were discarded as pre-existing behavior on unchanged lines, not new defects. The relatedmaxRetriestrace is already covered by #70526 (comment) and is not repeated here.
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 agent-reviewed-approved.
Untested coverage gaps: The initializer-plus-enhanced-navigation paths above have no matching permanent regression case in this diff. The panel did not execute those paths.
Routine discarded checks: Other negative checks of the timer, culture, option defaults, lifecycle and test fit produced no additional concrete findings.
Validation boundary: All three arms used frozen-source evidence; none ran scoped target builds, tests, samples or browser validation. Existing author validation claims were not treated as panel execution proof.
Human-directed and GitHub Copilot-generated.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/review |
There was a problem hiding this comment.
Source-only review of frozen head a1973d54d45300da2300e3f2071d7923fd37c483.
One contract-dependent candidate remains inline as unresolved: a beforeWebStart initializer's retry-interval mutation is overwritten by later server browser configuration. The trigger, mutation path, and reconnection effect are established in frozen source, but no assigned binding contract establishes initializer-over-server precedence for this option. Merge-base source already had the same behavior.
Both routed guides completed with gpt-5.6-sol (reasoning effort not supplied; runtime default): cross-cutting checks covered option precedence, lifecycle, timers, configuration, localization, compatibility, and changed-test fit; Blazor checks covered hosting boundaries, navigation/streaming replacement, circuits, WebAssembly culture, reconnection, and E2E source coverage. No materially changed area lacked a routed guide.
Existing-feedback disposition: no supported current-head true positive was republished. The prior streamed-component registration, current-navigation/history, startup-wait, and initializer-logging concerns are addressed in this frozen head according to their threads and frozen source. The existing maxRetries concern is not endorsed as a new defect: old/head comparison shows the same overwrite on the exact input sequence, and the frozen feedback already records that disposition.
Provenance: immutable guidance commit 3a3c6d0b75c1f26c3a4c15cd2b786fb9929c4136; merge base 60ef0101bf97cfccb49ede034b38659c15474d1b; base tip 3a3c6d0b75c1f26c3a4c15cd2b786fb9929c4136. Proof is source-only. Target code, tests, CI, browser workflows, and samples were not executed. Security assessment was excluded by supplied policy. Tracked Git bytes only; symlink, submodule, and LFS targets cannot establish behavior, and feedback posted after bundle preparation is not observable.
Generated by ASP.NET Core Pull Request Review for #70526 · copilot · gpt56 · 292.4 AIC · ⌖ 8.49 AIC · ⊞ 20.1K
Comment /review to run again
PureWeen
left a comment
There was a problem hiding this comment.
One additional cross-request DOM-preservation issue remains at a1973d54d45300da2300e3f2071d7923fd37c483.
Informational verifier trace, non-blocking: [DISCARDED] src/Components/test/E2ETest/Tests/ServerBrowserConfigurationTest.cs:54,329: One arm questioned the wall-clock timing windows. Its verifier rejected the claim because no timing artifact or flaky-test history establishes failures. This is not a request to change these tests.
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 agent-reviewed-approved.
Untested coverage gaps: The arms did not execute cross-request option isolation, delayed startup with buffered streaming, enhanced POST persisted-state transfer, or initializer retry precedence.
Routine discarded checks: The arms rejected adjacent proxy, culture, timer, DOM-registration, and duplicate-emission concerns from source. Existing startup, persisted-state, and retry-interval comments are not repeated.
Validation boundary: All three arms and both follow-up checks used frozen source. None ran target builds, tests, samples, or browser scenarios.
Human-directed and GitHub Copilot-generated.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The changes span lifecycle-sensitive DOM replacement, navigation, and component activation paths, but the source-only review could not run the real-browser Selenium regressions needed to validate them.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
|
/review |
|
Copilot's local GPT-5.6 review arm found no issues to raise at this commit. Informational, non-blocking check: Both local guide workers considered whether JavaScript-selected Validation boundary: Source-only review; no target build, unit test, Selenium/browser test, sample, CI, or runtime validation ran. Untested gaps remain around real-browser timing and lifecycle behavior for enhanced navigation, streaming, form POST replacement, circuit disposal, and reconnection. Protocol note: Both guide reports were collected and all workers are terminal, but the arm conservatively recorded a collection-invariant deviation because one redundant post-completion |
|
✅ No documentation PR was created. Confidence that documentation is needed: 25% No docs needed: bug fix to Blazor server-configured browser option handling that aligns behavior with the intended feature. Human review may confirm the precedence rule is covered in the related docs work (dotnet/AspNetCore.Docs#38107). Documentation surfaces considered
|
|
/backport to release/11.0 |
|
Started backporting to |
|
@kotlarmilos backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix Blazor browser option handling
Using index info to reconstruct a base tree...
M src/Components/Web.JS/src/Boot.Web.ts
M src/Components/Web.JS/src/Boot.WebAssembly.Common.ts
M src/Components/Web.JS/src/Services/WebRootComponentManager.ts
M src/Components/test/E2ETest/Tests/BrowserConfigurationTest.cs
M src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs
M src/Components/test/testassets/Components.WasmMinimal/Pages/BrowserConfigurationEnvVars.razor
Falling back to patching base and 3-way merge...
Auto-merging src/Components/Web.JS/src/Boot.Web.ts
Auto-merging src/Components/Web.JS/src/Boot.WebAssembly.Common.ts
Auto-merging src/Components/Web.JS/src/Services/WebRootComponentManager.ts
Auto-merging src/Components/test/E2ETest/Tests/BrowserConfigurationTest.cs
CONFLICT (content): Merge conflict in src/Components/test/E2ETest/Tests/BrowserConfigurationTest.cs
Auto-merging src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs
CONFLICT (content): Merge conflict in src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs
Auto-merging src/Components/test/testassets/Components.WasmMinimal/Pages/BrowserConfigurationEnvVars.razor
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Fix Blazor browser option handling
Error: The process '/usr/bin/git' failed with exit code 128 |


Fix Blazor browser option handling
Fix five server-configured browser option issues
Description
Fixes the five browser-option problems reported in #70510 while reviewing dotnet/AspNetCore.Docs#38107: the circuit inactivity timeout, WebAssembly culture, DOM preservation, circuit logging, and sub-second reconnection intervals.
For these settings, explicit startup or initializer values take precedence over server configuration, which takes precedence over framework defaults. The retry change preserves numeric and callback-based JavaScript retry intervals.
Fixes #70510