tju-yxq opened a new pull request, #5542:
URL: https://github.com/apache/rocketmq-dashboard/pull/5542

   ### Which Issue(s) This PR Fixes
   
   - Fixes #5541
   
   ### Brief Description
   
   Brings the six remaining unguarded async effects and timers up to the 
codebase's own standard (cancelled flag / captured timer id cleared in cleanup):
   
   - **alerts.tsx**: `setRuntime` now checks the effect's existing `cancelled` 
flag — a slow runtime response for a previous domain/filter/page can no longer 
clobber the current one; the mount-only `listInstances()` effect gains the same 
flag.
   - **cluster/index.tsx**: the 3s failure-retry timer is captured and cleared 
in the effect cleanup, so it cannot fire after the component moved on.
   - **ToolPlaygroundModal.tsx**: `bootstrap()`'s cluster-list writes now check 
a `mountedRef` (its tool-catalog half was already guarded by 
`toolLoadRequestRef`).
   - **AssistantBubble.tsx**: the 2s copy-reset timer is captured in a ref and 
cleared on unmount; re-copying now resets the previous countdown instead of 
stacking a second timer.
   - **MetricsExplorer.tsx**: the de-registered-data-source `setTimeout(…, 0)` 
returns a cleanup that clears the timer.
   
   ### How Did You Test This Change?
   
   ```
   cd web && npx vitest run src/pages/ops/__tests__/AlertsPage.test.tsx 
src/pages/cluster/__tests__/ClusterPage.test.tsx 
src/pages/ai/__tests__/AiPage.test.tsx 
src/components/__tests__/MetricsExplorer.test.tsx
    Test Files  4 passed (4)
         Tests  109 passed (109)   # AlertsPage 29, ClusterPage 30, AiPage 15, 
MetricsExplorer 35
   
   cd web && npx eslint src/pages/ops/alerts.tsx src/pages/cluster/index.tsx 
src/pages/ai/components/ToolPlaygroundModal.tsx 
src/pages/ai/components/AssistantBubble.tsx src/components/MetricsExplorer.tsx
    0 errors (5 pre-existing warnings)
   
   cd web && npx tsc --noEmit
   (no output — exit 0)
   ```
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in (one 
concern — the remaining unguarded async effects/timers — six sites across five 
files, per the grouping guideline #2107)
   - [x] Commit subject follows Conventional Commits
   - [ ] Tests added or updated for non-trivial changes, test methods named 
`...Test` (guard hardening; the four covering suites pass — the alerts runtime 
race is timing-dependent and covered by the existing page behavior tests)
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no new UI text)
   - [x] Architecture constraints stay green (no Java changes)
   - [x] New source files carry the ASF license header (no new source files)
   - [ ] Documentation touched where behaviour changed (internal guards only)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to