Repository navigation
fix(remote-connect): keep mobile controllers subscribed across presence changes - #3856
Merged
bobleer merged 2 commits intoNov 10, 2026
Merged
Conversation
…nce changes Mobile web did not show a session created on the desktop until the page was reloaded. The host drops every stream-hint subscriber that is absent from each relay presence update, but the relay only reports machine-scoped sockets. Browser controllers connect user-scoped and never appear, so any unrelated presence change (another device connecting, the phone reconnecting after the screen locks) ended their catalog and session subscriptions. Later catalog changes sent them no hint until the 4-minute renewal, a return to the tab, or a reload. Presence now decides only for devices it has reported at least once: a device that was online and is now absent is dropped as before. Other subscribers are governed by the existing 10-minute read lease, which mobile web renews every 4 minutes. No relay or controller change is required.
…e rule Name the affected clients as hidden controllers (mobile web, KMP, HarmonyOS), which all connect user-scoped, and record in the Peer Device Mode host stream section how long a hint lease lasts, how controllers renew it, and when presence may end it early.
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
Mobile clients did not show a session created on the desktop until they were reloaded. The host now keeps stream-hint subscriptions for controllers that never take part in relay presence, so catalog and session hints keep reaching them.
Type and Areas
Type: bug fix
Areas: Rust core (remote connect host streams), mobile web / KMP / HarmonyOS (remote control), docs
Motivation / Impact
On every relay
device-presenceupdate, Desktop and CLI callHostStreamHub::retain_onlineand drop every stream-hint subscriber missing from the list. The relay only putsmachine-scopedsockets in presence. All three mobile controllers (mobile webAccountRealtime.ts, KMPAccountRealtime.kt, HarmonyOSAccountRealtime.ets) connectuser-scoped("hidden controllers"), so they never appear. Any unrelated presence change silently ended their@host/catalogand session subscriptions, for example another device connecting or the phone reconnecting after the screen locks. After that, a session created on the desktop sent nohost-stream-changedhint. The list stayed stale until the 4-minute renewal, a return to the foreground, or a reload. Live chat updates were exposed to the same gap.retain_onlinenow decides only for devices that presence has reported at least once. A device that was online and is now absent is dropped as before. Other subscribers fall back to the existing 10-minute read lease, which every mobile client renews every 4 minutes. No relay or controller change is needed, so existing relays and deployed clients pick up the fix once the host updates. Hosts without this change keep the old behavior.The Peer Device Mode doc now records the lease length, the renewal, and when presence may end a lease early.
Verification
cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-connect --lib remote_connect::host_stream::passes (21 tests), including the newpresence_drops_only_devices_that_take_part_in_it. The test checks that a hidden subscriber survives presence updates, including an empty one, and still gets the catalog hint, and that a peer that was reported online and then went absent is dropped.rustfmt --checkon the changed file andpnpm run check:repo-hygienepass.Reviewer Notes
debug. Streams are still byte-bounded and released after the existing grace period.retain_online_controllers) is unchanged. Peer controllers are machine-scoped, and mobile web never callspeer_control_attach.Checklist