fix(client): improve reconnect handling#1073
Open
louise-poole wants to merge 4 commits into
Open
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A single wait-and-check was not enough: if the WS reconnected briefly then dropped again, conn_notify fired but is_connected() returned false. The old code returned Err(NotConnected) there, which propagated as ConnectionClosed to synchronizers and terminated the stream. Now loops until dead=true or stably connected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
close() failed with NotConnected when inner was None (WS between reconnects), leaving synchronizers hung in ensure_connection(). Now always sets dead=true and notifies conn_notify so blocked callers return immediately. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
subscribe_with_compression built a json!() literal with insertion-order keys, but Command::Subscribe serializes alphabetically. All 13 subscription tests failed with an assertion mismatch in the mock server. Now serializes Command::Subscribe directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dianacarvalho1
approved these changes
Jun 8, 2026
dianacarvalho1
left a comment
Contributor
There was a problem hiding this comment.
Thank you @louise-poole ! I'm not super familiar with this code but it looks good to me! Only one small comment
| partial_blocks: false, | ||
| }) | ||
| .to_string() | ||
| .unwrap() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close()was called on that connection (used to just hang for those callers)