Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
摘要
修复桌面 Web Audio 提示音在空闲时持续占用系统输出设备的问题。启动预热不检查
audioCueOnRecord,即使用户关闭提示音,胶囊窗口挂载仍会创建并 resume 一个 AudioContext;播放结束或停止也只停止 oscillator,没有释放 context。在 macOS 安装版
v2.0.1-tauri上进行了对照:退出应用后输出流和 coreaudiod 的PreventUserIdleSystemSleepassertion 消失;重新启动但不听写便出现 BuiltInSpeakerDevice 输出及 assertion;关闭录音提示音后重新启动仍复现。听写结束时麦克风自身的 assertion 正常释放,但 WebKit 输出的 assertion 继续存在。当前 beta 仍保留相同预热和不释放路径。修复 / 新增 / 改进
disposeAudioCue():初次读取到禁用设置、实时关闭提示音、监听器卸载或原生所有权变化时,取消待恢复请求和计时器并关闭 context。迟到的 Promise / 旧 onended / 旧停止计时器不能干扰下一次播放。兼容
测试计划
cd openless-all/app && npm run build;结果:TypeScript 和 Vite 生产构建通过(仅有既有 bundle-size warning)。node scripts/audio-cue-runtime.test.mjs;结果:生命周期与恢复回归通过。node scripts/audio-cue-listener-contract.test.mjs;结果:按需启动、禁用设置清理和 owner 隔离契约通过。src/**/*.test.ts全部 62 项;结果:通过,含src/lib/audioCue.test.ts。git diff --check;结果:通过。npm test全量:生产构建及此前执行的脚本通过,随后scripts/check-hotkey-injection.mjs调用 Cargo 被本机 rustc 1.95.0 阻断(上游 openless-core 要求 1.99)。没有跳过或修改此门禁,需要上游 CI 继续确认。pmset -g assertions和 coreaudiod 日志确认没有遗留 WebKit 输出 assertion,且提示音正常。scripts/audio-cue-*.test.mjs;安装版的对照结果如摘要所述。未提交用户设置、听写内容或私人日志。