Skip to content

[bug][remote] 手机端永远收不到识别结果:remote:result 事件全仓从未 emit #691

Description

@appergb

现象

用「远程输入」功能时,手机端永远看不到本次识别/润色的最终文字——状态会更新(识别中/润色中/完成),但结果文本区一直空着。

根因(已读源码确认)

remote_server/mod.rs 的 WS handler 订阅了 "remote:result" 并把 {type:"result", text} 转发给手机,H5(app.jscase "result"showResult#result-wrap)也准备好了显示。但全仓 grep 没有任何一处 emit("remote:result", ...)——这个事件从来没被发出过,所以手机端的结果区永远空。

修法(单一职责)

在听写 finalize(coordinator/dictation.rshistory.append_with_retention 之后)emit 最终文字 polished"remote:result",与同函数里已有的 app.emit("vocab:updated", ...) 同模式:

if !polished.trim().is_empty(){ifletSome(app) = inner.app.lock().clone(){let _ = app.emit("remote:result", polished.clone());}}

无手机连接时该事件无人转发 = 无害空操作。

验证

本地编译通过;需手机真机验证:远程输入一次,手机结果区出现最终文字。

来源:2026-06-16 全仓多 Agent 审计(remote_server 专项)。注:审计另发现「任意 WS 关闭无条件 cancel_remote_dictation(双手机/重连时会取消他人听写)」,属另一独立 bug,单独跟进。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Medium prioritybugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions