fix(desktop): 提示音的两条命令补进 ACL 允许列表 - #967
Merged
Merged
Conversation
设置页的开关点了没反应,托盘的却好使——两处走的是同一个 apply_sound_enabled,差别只在设置页要经 IPC。本仓对每条自定义命令做显式 ACL 允许列表,sound_enabled/set_sound_enabled 没登记,invoke 被 Tauri 拒在 门外;UI 侧又把错误 catch 掉了,于是表现为按钮是死的。 三处补齐:build.rs 生成 allow-* 权限、main-app capability 放行两条(设置页 读+写)、pet-page 放行 sound_enabled(桌宠页启动要读一次——它此前同样被拒, 回落默认"开",所以只有托盘的事件广播能静音,事件不过 ACL)。 顺带把吞掉的错误露出来:设置页切换失败改为回滚并把壳的原话显示在错误位, 两处读取失败降级为 console.warn。静默 catch 正是这个 bug 编译测试全绿却 线上不工作的原因。build.rs 头部记下这个不对称:capability 里名字写错是 编译期硬错,漏加 capability 只在运行期被拒。
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.
设置页的开关点了没反应,托盘的却好使——两处走的是同一个
apply_sound_enabled,差别只在设置页要经 IPC。本仓对每条自定义命令做显式
ACL 允许列表,sound_enabled/set_sound_enabled 没登记,invoke 被 Tauri 拒在 门外;UI 侧又把错误 catch 掉了,于是表现为按钮是死的。
三处补齐:build.rs 生成 allow-* 权限、main-app capability 放行两条(设置页 读+写)、pet-page 放行 sound_enabled(桌宠页启动要读一次——它此前同样被拒, 回落默认"开",所以只有托盘的事件广播能静音,事件不过 ACL)。
顺带把吞掉的错误露出来:设置页切换失败改为回滚并把壳的原话显示在错误位,
两处读取失败降级为 console.warn。静默 catch 正是这个 bug 编译测试全绿却
线上不工作的原因。build.rs 头部记下这个不对称:capability 里名字写错是
编译期硬错,漏加 capability 只在运行期被拒。