Repository navigation
Fix reconnect UI stuck after ConnectCircuit/ResumeCircuit failure - #70112
vendasankarsf3945 wants to merge 10 commits into
Conversation
|
Thanks for your PR, @vendasankarsf3945. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the Blazor circuit reconnection and cleanup changes.
No open issues 🎉
What changed in this PR
This PR addresses #69931 by cleaning up failed Blazor circuit connections so subsequent reconnect attempts can proceed instead of leaving the reconnect UI stuck.
Changes:
- Stops and awaits connection cleanup when
ConnectCircuitorResumeCircuitthrows, then rethrows the original error. - Coalesces overlapping reconnect attempts, guards renderer detachment, and delays resume completion until circuit-open callbacks finish.
- Adds unit tests covering invocation failures, overlapping reconnects, callback errors, and connection closure with detached renderer interop.
| File | Description |
|---|---|
src/Components/Web.JS/test/Platform/Circuits/CircuitManagerReconnect.test.ts |
Adds focused reconnect and resume lifecycle tests. |
src/Components/Web.JS/src/Platform/Circuits/CircuitManager.ts |
Adds failed-invocation cleanup and coordinates reconnect and resume lifecycle handling. |
Review effort: Balanced
|
/review |
|
/review |
|
Copilot's local review panel found no issues to raise at this commit. |
kotlarmilos
left a comment
There was a problem hiding this comment.
Changes look good. Please reduce the test scaffolding and consolidate JS coverage
Thanks for the feedback. I've reduced the test scaffolding and consolidated the existing JS coverage to eliminate duplication and improve readability. |
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
Fix reconnect UI stuck after ConnectCircuit/ResumeCircuit failure
Description
This PR fixes an issue where the reconnect UI becomes stuck when
ConnectCircuitorResumeCircuithub method invocations fail, leaving the Blazor client in an unresponsive state.Root Cause
When the
ConnectCircuitorResumeCircuithub method invocations fail (throw an exception), the SignalR connection is not properly cleaned up. The circuit manager leaves the connection in a "Connected" state even though the circuit operation failed, resulting in:The root cause is the lack of error handling around these critical hub method invocations. Previously, if
ConnectCircuitorResumeCircuitthrew an exception, the code would immediately propagate the error without stopping the underlying connection, leaving it orphaned.Changes Made:
CircuitManager.ts:
ConnectCircuitinvocation to catch errors and stop the connection before re-throwingResumeCircuitinvocation with the same error handlingstopConnectionAfterFailedCircuitInvocation()private method to safely stop the connection and log any errors that occur during cleanupCircuitManagerReconnect.test.ts (new file):
ConnectCircuitthrowsResumeCircuitthrowsonCircuitClosed,onCircuitOpened) throwing errors do not trigger the automatic connection stop behaviorTechnical Details:
ConnectCircuitorResumeCircuitfail, the error is now caught, the connection is stopped, and the error is re-thrown for higher-level handlingstopConnectionAfterFailedCircuitInvocation()method handles any errors that occur during the connection stop operation itself, logging them as errorsTesting
PASS test/Platform/Circuits/CircuitManagerReconnect.test.ts
CircuitManager reconnect
✓ stops the connection when ConnectCircuit throws (XX ms)
✓ stops the connection when ResumeCircuit throws (XX ms)
✓ does not stop the connection when onCircuitClosed throws (XX ms)
✓ does not stop the connection when onCircuitOpened throws (XX ms)
Fixes #69931