Improve Blazor reconnection experience after the server is restarted#8
Conversation
…flect change in ResumeCircuit
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f287efaa36
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| persistedCircuitState = await _circuitPersistenceManager.ResumeCircuitAsync(circuitId, Context.ConnectionAborted); | ||
| if (persistedCircuitState == null) | ||
| { | ||
| // The circuit state cannot be retrieved. It might have been deleted or expired. | ||
| // We do not send an error to the client as this is a valid scenario | ||
| // that will be handled by the client reconnection logic. | ||
| Log.InvalidInputData(_logger); | ||
| await NotifyClientError(Clients.Caller, "The circuit state could not be retrieved. It may have been deleted or expired."); | ||
| Context.Abort(); | ||
| return null; |
There was a problem hiding this comment.
Close connection when resume state is missing
When persistedCircuitState is null you now just log and return, leaving the SignalR connection open. In the “state missing” scenario (e.g., server restart/expired cache), the client ends up with a connected transport but no circuit; CircuitManager.reconnect() short‑circuits if the connection is already Connected, so the retry path will report success without re‑handshaking and the UI can stay stuck with no functional circuit. Aborting the connection (or otherwise forcing a reconnect) on this path would ensure retries actually re‑establish the circuit.
Useful? React with 👍 / 👎.
Benchmark PR from qodo-benchmark#32