Skip to content

fix(dashboard): settle failed refresh requests - #2688

Merged
openai0229 merged 6 commits into
OtterMind:mainfrom
HandSonic:fix/dashboard-refresh-settles
Sep 9, 2026
Merged

openai0229 merged 6 commits into
OtterMind:mainfrom
HandSonic:fix/dashboard-refresh-settles

Conversation

@HandSonic

@HandSonic HandSonic commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

Fixes #2682

Summary

Dashboard refresh failures previously left the refresh action pending forever because the store wrapped the detail request without propagating rejection. The refresh request now resolves to true on success, resolves to false when no dashboard is selected, and preserves request rejection on failure. DashboardContent clears its loading state in finally, so the refresh control always settles while existing callers keep their original success semantics.

Affected surfaces

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

Verification

  • yarn test:dashboard-store: passed success, rejection, missing-dashboard, and zero-ID cases.
  • yarn lint: passed.
  • yarn build:web:community --app_version=0.0.0: all Community prebuild tests, production build, and bundle verification passed.
  • Playwright CLI: forced the first dashboard detail refresh to return HTTP 500 after 500 ms; loading blocked duplicate refreshes, then restored the refresh control. A second click reached the real endpoint with HTTP 200 and retained the current dashboard.
  • Docker MySQL 8.4 on 127.0.0.1:3306: datasource pre_connect passed in the isolated Community runtime; temporary database and account were removed after verification.

Risk and compatibility

No API or persisted-data format changes. Failed detail requests reject as they did before the wrapper was introduced, but the UI now clears loading through finally. The change is limited to six frontend files.

Reviewer map

  • Start with runDashboardRefresh, refreshCurrentDashboard, and DashboardContent.refreshChartList.
  • Failure condition: a rejected refresh remains pending, the refresh control stays loading, or a retry cannot issue another request.
  • Rollback: revert the dashboard refresh commit; 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 conflict resolution, implementation reduction, tests, Playwright verification, and adversarial review.

@HandSonic
HandSonic requested a review from openai0229 as a code owner August 12, 2026 00:57
@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 12, 2026
@HandSonic
HandSonic force-pushed the fix/dashboard-refresh-settles branch from 3175f5a to aee5e48 Compare August 12, 2026 16:49
@HandSonic
HandSonic force-pushed the fix/dashboard-refresh-settles branch from aee5e48 to e8ac916 Compare August 19, 2026 19:43

@openai0229 openai0229 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Blocking regression: runDashboardRefresh now converts a rejected load into the fulfilled value false, but both callers ignore the boolean. In particular, DingChartModal uses refreshCurrentDashboard().then(() => staticMessage.success(...)), so a failed refresh now displays "pin to dashboard success". Previously that callback did not run on rejection.

Please update callers to distinguish success from failure and use finally for loading cleanup, or preserve rejection while ensuring the refresh button always settles. Add a caller-level test for the failed refresh path, not only the helper test.

@HandSonic
HandSonic requested a review from a team as a code owner August 22, 2026 15:00
@HandSonic HandSonic closed this Aug 22, 2026
@HandSonic HandSonic reopened this Aug 22, 2026
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Aug 22, 2026
@openai0229 openai0229 moved this from Done to In Review in Chat2DB Community Aug 22, 2026
@HandSonic
HandSonic force-pushed the fix/dashboard-refresh-settles branch from 2be02a1 to 30eb49f Compare September 3, 2026 16:49
@HandSonic

Copy link
Copy Markdown
Contributor Author

Addressed the requested caller-level regression: pin success now depends on the boolean refresh result, both refresh-button and pin-submit loading clear in finally, and caller tests cover false/rejected refreshes plus failed pin requests. The branch is also rebased to current main and Playwright-verified with a delayed 500 refresh.

@HandSonic

Copy link
Copy Markdown
Contributor Author

Addressed on the current head: callers now distinguish the boolean result and use inally for loading cleanup; caller-level pin/refresh tests cover failure without a success toast. The combined production build passed, and Playwright verified that a forced failed refresh settles and a second refresh succeeds. Please re-review when convenient.

openai0229
openai0229 previously approved these changes Sep 8, 2026

@openai0229 openai0229 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed the minimized implementation at 2da56d2. Refresh rejection now propagates, DashboardContent clears loading in finally, existing pin-success semantics remain unchanged, and the change is limited to five frontend files. Focused tests, full lint/build, Playwright failure-and-retry coverage, and JavaScript security checks passed.

@openai0229 openai0229 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed final head 63a6e09. Both refresh callers now consume request rejections after global error handling, so loading settles without unhandled promise rejections and pin success is not shown after a failed refresh. Focused tests, full Community build, Playwright forced-500 verification, and CI passed.

@openai0229
openai0229 merged commit 236a4c0 into OtterMind:main Sep 9, 2026
14 of 16 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug(dashboard): failed refresh leaves the button loading forever

2 participants