Repository navigation
fix(remote-connect): drop offline peer controllers from event fanout - #3657
Merged
bobleer merged 2 commits intoNov 2, 2026
Merged
Conversation
`peer_host_invoke::retain_online_controllers` exists on the desktop host
but nothing ever calls it — the CLI has the equivalent wiring through
`peer_host::update_controller_presence`, the desktop `DevicePresence`
handler only prunes the host-stream hub.
A controller that goes offline therefore stays in `controllers` forever.
Every peer event keeps fanning out to it and the relay rejects each one,
which is what fills the log with:
peer event fanout to <device> failed: Relay event rejected
Reconnecting does not help: the stale id is still there, so the failures
continue alongside the new connection.
Retain the controller set against account presence, mirroring the CLI,
and fail closed permission requests whose last control surface vanished.
Scope subscriber removal to the relay reporting presence, including LAN. Offline presence is not permission revocation. Co-authored-by: OpenBitFun <318544290+bitfun-ai@users.noreply.github.com>
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.
问题与修复
Desktop 的
DevicePresence分支此前只清理 host-stream 订阅,没有清理 Peer UI 事件 fanout 的离线接收端,因此持续向离线设备发送事件并产生 relay 拒绝日志。本 PR 接上接收端清理,并补齐两项审查修正:
没有新增命令、必填协议字段或持久化格式。
验证
pnpm run fmt:rs— 通过,仅格式化改动的 Rust 文件。TAURI_CONFIG='{"bundle":{"resources":[],"externalBin":[]}}' cargo test --locked -p openbitfun-desktop --lib api::peer_host_invoke::tests— 16 passed。本地全新 worktree 没有构建 extension-host 等发布资源,直接执行测试先在 Tauri 资源准备阶段失败;上述测试通过仅用于单测的 bundle 配置运行,不修改仓库配置,也不代表发布打包通过。编译有一条既有
miniapp_desktop/mod.rsunused-mut warning。远程覆盖:本地状态/路由单测,不是 live Peer/Relay 断线重连验证;未运行真实 SSH、手机/IM 或 Detached Dispatch。新提交的 CI 必须通过后才能合入。
Generated with OpenBitFun