Ariver
2026-06-03 2fc1c3aef1e7934efeb1125210f4b97dbbb17414
Fix engine status updates after model reload
2 files modified
12 ■■■■ changed files
02-P-NBL/round-5/qa-report.md 2 ●●● patch | view | raw | blame | history
privatevoice.src/services/engine_service.go 10 ●●●●● patch | view | raw | blame | history
02-P-NBL/round-5/qa-report.md
@@ -128,7 +128,7 @@
## 7. 未完成项
- 物理断网后的 App 级 Qwen3-ASR 识别尚未执行。当前已验证引擎级本地识别不依赖远程服务,但未关闭真实网络做 App 全流程测试。
- UI 可视 smoke 没有完整执行,因为菜单栏 App 未稳定暴露可自动抓取的设置窗口;已通过服务逻辑、配置重启和日志完成模型路径验证。
- UI 可视 smoke 发现过一次模型卡片和底部 Engine 状态不同步:模型列表已切到 English/Moonshine,但底部仍显示 SenseVoice。原因是后端 `EngineService.SetStatus` 更新内部状态后没有主动发 `engine:status` 事件,前端可能显示旧硬件信息。本轮已修复:状态变化时主动向前端 emit。
## 8. 结论
privatevoice.src/services/engine_service.go
@@ -159,10 +159,18 @@
func (s *EngineService) SetStatus(status, hardwareInfo, lastError string) {
    s.mu.Lock()
    defer s.mu.Unlock()
    s.status = status
    s.hardwareInfo = hardwareInfo
    s.lastError = lastError
    s.mu.Unlock()
    if s.app != nil {
        s.app.Event.Emit("engine:status", map[string]interface{}{
            "status":       status,
            "hardwareInfo": hardwareInfo,
            "error":        lastError,
        })
    }
}
// DownloadModel downloads the ASR model with progress events.