Skip to content

fix(dashboard): scope delayed mutations to owner - #2871

Open
HandSonic wants to merge 1 commit into
OtterMind:mainfrom
HandSonic:fix/dashboard-mutation-selection
Open

HandSonic wants to merge 1 commit into
OtterMind:mainfrom
HandSonic:fix/dashboard-mutation-selection

Conversation

@HandSonic

Copy link
Copy Markdown
Contributor

Related issue

N/A - no matching issue or PR was found for the delayed dashboard mutation race.

Summary

Dashboard mutations committed against whatever dashboard happened to be active when their promises resolved. A delayed save for dashboard A could replace newly selected dashboard B, while a delayed chart deletion could remove the chart from B and persist the wrong dashboard. This change keeps saves scoped to their dashboard ID, captures chart-deletion ownership before awaiting the API, updates the owning list entry, and leaves a different active dashboard/settings panel untouched.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Red tests reproduced delayed A-save and A-delete completion after selecting B.
  • Dashboard mutation tests cover stale save ownership, same-dashboard merge, deletion snapshot/fallback, filtered layout, missing IDs, and active-settings ownership.
  • Full Community prebuild suite: passed.
  • Targeted ESLint and diff checks: passed.
  • Playwright: A title save was delayed 6 seconds, B was selected immediately, B remained active before/after completion, and A's list title still updated.
  • Pairwise merge-tree checks with fix(client): ignore stale dashboard details #2836 and fix(dashboard): settle failed refresh requests #2688: passed.
  • Fork Frontend, Backend, and JavaScript CodeQL checks: passed; unchanged Java CodeQL is still running.

Risk and compatibility

No API or persisted-data format changes. Updates for the active dashboard retain the existing merge behavior. When another dashboard is active, only the owning dashboard-list entry changes. Chart deletion still persists the original dashboard's filtered chart IDs/schema.

Reviewer map

  • Start with dashboardMutation.ts, then createCommonAction.updateDashboard and deleteChart.
  • Failure condition: an A mutation changes current dashboard B, closes B settings, or persists B after deleting from A.
  • Rollback: revert b0d6cd3451d1dd3fe5ac928150850d0ae0a95258; no migration is required.

Contributor declaration

  • I linked the issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below.

AI assistance: OpenAI Codex assisted with diagnosis, implementation, tests, Playwright verification, and adversarial review.

@HandSonic
HandSonic requested review from a team and openai0229 as code owners September 3, 2026 16:51
@openai0229 openai0229 moved this to In Review in Chat2DB Community Sep 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants