Skip to content

fix(desktop): 修复设置误报操作占用并显示实际运行的操作 - #1455

Merged
yyjeqhc merged 3 commits into
mainfrom
fix/desktop-settings-refresh-contention
Nov 28, 2026
Merged

yyjeqhc merged 3 commits into
mainfrom
fix/desktop-settings-refresh-contention

Conversation

@yyjeqhc

@yyjeqhc yyjeqhc commented Nov 28, 2026

Copy link
Copy Markdown
Owner

问题

有用户反馈,修改设置时反复看到“另一个 Desktop 操作仍在进行”,重启电脑后仍会出现。操作锁只存在于 Desktop 进程内。这条提示还用于 desktop_state_unavailable,保存配置失败或尚未配置 Runner 都可能走到这里。重启后相同的配置条件可以再次触发提示。

另一个可复现的问题出现在持久环境。启动刷新或定时刷新撞上正在执行的操作时,界面可能显示笼统的占用提示,或者忽略这次刷新错误,导致用户看不到操作名称和停止入口。

修改

  • 本地状态读写失败显示配置和目录权限提示。只有明确的操作占用才触发只读查询的限次重试。未配置本机 Runner 的设置显示配置引导。
  • 启动、定时和手动刷新遇到占用后读取已发布的状态。界面据此显示当前操作,对可取消操作提供停止按钮。
  • 设置页在已观察到的操作结束后重新读取 Runner 设置。设置写入仍需用户显式发起。

验证

  • 在临时目录构造无法替换的配置备份目标。重新打开同一主配置后保存仍然失败,旧实现将诊断归为等待自动恢复。修复后会保留主配置并给出本地状态诊断,移除测试制造的障碍后可再次保存。
  • 在界面测试中分别让持久环境的启动刷新和定时刷新遇到已运行的操作。修复前两个用例均无法找到当前操作,修复后可看到准确的操作和停止按钮,操作结束后状态恢复。
  • 桌面前端测试、表单控件检查和生产构建通过。Rust 桌面库的 state::、operation::tests 和 error::tests 三组测试通过。
  • 本次使用临时配置和模拟操作验证。反馈用户机器上的具体触发条件仍待现场诊断确认。

相关反馈见 #1419 和 #1166。

@swjnxyf swjnxyf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 6b44f58 against the exact clean special checkout. Both previous findings are addressed: idle_generation samples admission and generation under the existing controller lock, with pre/post target checks around settings I/O; a live completion owner now retains the Core until cleanup and return, rather than discarding it on lock contention. The original interrupted-owner fence remains intact. The regression tests exercise admitted writers, a real staged configuration rollback, delayed Core return and delayed failure cleanup, and subsequent settings mutations. No new synchronization domain or lifecycle state. Exact-head CI 46141981481 succeeded; diff check passed. I reviewed source and test assertions but did not independently rerun the reported local suite. The original reporter's machine-specific cause remains unconfirmed and the service-autostart request is outside this PR. No blocking findings; approved for merge.

@yyjeqhc
yyjeqhc merged commit f541116 into main Nov 28, 2026
19 checks passed
@yyjeqhc
yyjeqhc deleted the fix/desktop-settings-refresh-contention branch November 28, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants