Skip to content

fix(dashboard): prevent superseded dashboard loads from mutating state#301

Merged
1186258278 merged 1 commit into
mainfrom
cursor/critical-correctness-bugs-81b8
May 27, 2026
Merged

fix(dashboard): prevent superseded dashboard loads from mutating state#301
1186258278 merged 1 commit into
mainfrom
cursor/critical-correctness-bugs-81b8

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 26, 2026

变更描述

修复仪表盘数据加载在「已排队更新加载」场景下的竞态:_dashboardLoadSeq 在每次调用 loadDashboardData 时就会递增,而 _loadDashboardDataInner 仍可能带着旧的 loadSeq 继续执行。原先在首轮 await coreP 之后、执行 loadSeq 校验之前,就会清空 _dashboardStatusSummaryCache、弹出服务失败 toast,并在自愈路径中调用 writeOpenclawConfig,导致已被更新的加载请求所淘汰的那一波仍可能污染全局缓存或写回 OpenClaw 配置。

本次在第一波 await coreP 之后立即校验 loadSeq / page.isConnected,并在自愈路径中 readOpenclawConfig 再次 await 之后重复校验,避免淘汰中的加载产生副作用。同时更正了 loadDashboardData 上方误导性的「跳过本次」注释,与当前 Promise 链串行化行为一致。

变更类型

  • Bug 修复 (fix)

测试清单

  • 本地运行 npm run build 前端构建通过
  • 本地运行 cargo check Rust 编译通过(当前环境 Cargo 1.83 解析依赖时因上游 edition2024 要求失败,与本次 JS 变更无关)
  • 在 macOS 上测试通过
  • 在 Windows 上测试通过
  • 在 Linux 上测试通过
  • 新功能已添加对应测试
  • 所有现有测试通过(node --test tests/*.test.js

相关 Issue

(自动化巡检;无关联 Issue 编号)

截图 (如涉及 UI 变更)

无 UI 变更。

Open in Web View Automation 

_loadDashboardDataInner could run with an outdated loadSeq while
_dashboardLoadSeq had already advanced for a newly queued refresh.
Mutations (status summary cache, error toasts) and writeOpenclawConfig
ran before the final seq check, so a superseded wave could still
clear shared state or persist normalized config after a newer load
was requested. Bail out immediately after the first await and after
the self-heal config re-read when the load is obsolete.

Co-authored-by: 晴天 <1186258278@users.noreply.github.com>
@1186258278 1186258278 marked this pull request as ready for review May 27, 2026 23:21
@1186258278 1186258278 closed this May 27, 2026
@1186258278 1186258278 reopened this May 27, 2026
@1186258278 1186258278 merged commit 8568dd0 into main May 27, 2026
3 checks passed
1186258278 added a commit that referenced this pull request May 28, 2026
See CHANGELOG.md for the full notes. Highlights:

- feat(hermes): 50+ visual config panels covering session runtime, model
  management, terminal/sandbox, kanban, safety/privacy, display, browser,
  voice and toolsets — replaces hand-editing ~/.hermes/config.yaml.
- feat(hermes): maintenance/upgrade controls (Update Backup, Session Store
  Maintenance, Curator Maintenance).
- feat(channels): 14 new channels (iMessage / WhatsApp / Telegram / Discord
  plugin runtime / Signal / Microsoft Teams / LINE / Mattermost / Synology /
  Google Chat / Zalo / DingTalk / Tlon / IRC / Nostr / Twitch / Nextcloud
  Talk / ClickClack), unified channel editor, SecretRef preservation,
  multi-account save, generic diagnostics.
- fix(hermes): critical upstream 0.14.0 missing pieces compensated
  (dashboard_auth stubs + web_dist index.html injected at install/update/
  start; idempotent + self-yielding when upstream ships the real files).
- fix(hermes): upgrade path now installs runtime extras (croniter / httpx /
  openai / aiohttp / websockets) to prevent post-upgrade Gateway crashes.
- fix(hermes): hermes_venv_python now resolves uv-tool install paths so
  '可选依赖管理' / 多 Gateway 看板 stop falsely reporting 'venv not found'.
- fix(hermes): group-chat page no longer renders run_id as the reply text;
  it now listens to hermes-run-done and reads payload.output.
- fix: dashboard race condition (#301), Node.js nvm-managed version
  detection (#295), agent models sync with merged openclaw.json (#297).

Hot-update minAppVersion bumped to 0.17.0 because src-tauri/src/lib.rs
registers 40+ new Tauri commands — older desktop builds must NOT pull this
frontend via hot-update or they will hit missing-command crashes.
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