fix(remote): keep desktop relay reconnect alive under backpressure - #3255
Merged
Merged
Conversation
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.
Summary
Fixes desktop Remote Connect staying offline after the relay closes its WebSocket while device RPC events are under load. The PR also includes the local HarmonyOS account-startup race fix.
Fixes #
Type and Areas
Type: regression fix
Areas: Rust core, remote connect, HarmonyOS mobile
Motivation / Impact
The relay client used non-blocking sends for bounded event queues and treated a full queue like a closed consumer. That could terminate the receive loop and the only reconnect task, leaving the desktop device offline until the app was restarted. Event delivery now applies backpressure without terminating the transport, and graceful Socket.IO teardown has a timeout.
HarmonyOS initializes the account store before the rest of cold-start work and serializes initialization so an early login tap cannot race session-store setup.
Verification
pnpm run fmt:rscargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-connect --lib remote_connect::relay_client::tests::— 5 passedcargo check --locked -p openbitfun-core --no-default-features --features remote-connect— passedgit diff --check— passedReviewer Notes
The reconnect regression test fills the event queue and verifies routing waits for capacity instead of dropping the connection. Existing local HarmonyOS changes are intentionally included in this branch so the account-login and relay reconnect fixes can be tested together.
Checklist