Skip to content

Fix Blazor fatal error banner persisting after successful reconnection - #70084

Merged
kotlarmilos merged 3 commits into
dotnet:mainfrom
PreethikaSelvam:GH69596Fix
Nov 6, 2026
Merged

kotlarmilos merged 3 commits into
dotnet:mainfrom
PreethikaSelvam:GH69596Fix

Conversation

@PreethikaSelvam

Copy link
Copy Markdown
Contributor

Description

When skipNegotiation: true is configured, a failed WebSocket reconnection attempt displays the fatal error banner. The banner remains visible even after a subsequent attempt successfully reconnects the circuit.

Previously, only FailedToNegotiateWithServerError was propagated to the reconnection layer. Other connection-start failures displayed the fatal banner and allowed reconnection to continue with a disconnected connection.

This change:

  • Propagates connection-start failures for an existing circuit to the reconnection layer, regardless of the error type.
  • Prevents invoking ConnectCircuit after connection startup fails.
  • Preserves initial-start failure handling and genuine fatal-error reporting.
  • Adds Selenium coverage for failed reconnection attempts with negotiation enabled and disabled, including circuit-state preservation and interactivity.

Validation

  • Reproduced the reported behavior in 10 consecutive browser runs.
  • Without the fix, the WebSockets-only regression test fails because the fatal banner remains visible after recovery; the negotiation-enabled control passes.
  • With the fix, all 8 targeted Selenium tests pass, covering the new scenarios, existing reconnection behavior, initial transport failures, and fatal errors.
  • JavaScript Debug/Release builds and the dependency-aware E2E build passed.
  • Full repository build was blocked by the unrelated missing native library atls.lib. Lint reports pre-existing violations; no new diagnostics were introduced in the changed TypeScript file.

Before Fix

GH69596BeforeFix.mp4

After Fix

GH69596AfterFix.mp4

Test Results

TestAfterFix

Fixes #69596

@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Oct 29, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 29, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @PreethikaSelvam. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

…connection failure displays the fatal error banner, which remains visible even after successful recovery.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the reconnection error-handling change.

No open issues 🎉

What changed in this PR

Fixes Blazor’s fatal error banner remaining visible after a successful reconnection by routing connection-start failures for existing circuits through the reconnection handler.

Changes:

  • Propagates existing-circuit startup failures regardless of error type, preventing ConnectCircuit from running after a failed start.
  • Adds a test-host option to skip SignalR negotiation.
  • Adds Selenium coverage for failed reconnection attempts with and without negotiation, checking recovery, preserved state, interactivity, and error-banner visibility.
File Description
src/​Components/​Web.JS/​src/​Platform/​Circuits/​CircuitManager.ts Routes existing-circuit connection-start failures to reconnection handling.
src/​Components/​test/​testassets/​Components.TestServer/​Pages/​_ServerHost.cshtml Enables WebSockets-only connections through a query option.
src/​Components/​test/​E2ETest/​ServerExecutionTests/​ServerReconnectionTest.cs Tests reconnection recovery and confirms genuine fatal errors still display the banner.

Review effort: Balanced

@PreethikaSelvam
PreethikaSelvam marked this pull request as ready for review October 30, 2026 11:55
@PreethikaSelvam
PreethikaSelvam requested a review from a team as a code owner October 30, 2026 11:55
@PureWeen

PureWeen commented Nov 1, 2026

Copy link
Copy Markdown
Member

/review

@PureWeen

PureWeen commented Nov 1, 2026

Copy link
Copy Markdown
Member

Copilot's local review panel found no issues to raise at this commit.

@kotlarmilos kotlarmilos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I suggest removing E2E test as the change is small.

@PreethikaSelvam

Copy link
Copy Markdown
Contributor Author

LGTM! I suggest removing E2E test as the change is small.

As per the suggestion removed the E2E test.

@kotlarmilos
kotlarmilos self-requested a review November 3, 2026 09:35
@kotlarmilos
kotlarmilos merged commit 502e6cc into dotnet:main Nov 6, 2026
32 checks passed
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 8%

No docs needed: bug fix in Blazor circuit reconnection handling with no public API, configuration, or default changes.

Documentation surfaces considered

  • Conceptual article: Not required — Single TypeScript file changed; fix restores expected reconnection behavior, no new documented behavior.
  • Migration guidance: Not required — No upgrade action required.
  • Breaking change: Not required — No compatibility impact; bug fix.

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 23f4fbe0 Deployed Nov 6, 2026 by kotlarmilos via conclusion #218
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-reviewed-approved area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Blazor] Error UI is shown on a transient connection failure during reconnection when skipNegotiation is used, and stays after a successful reconnect

4 participants