Frun1na opened a new pull request, #5645:
URL: https://github.com/apache/rocketmq-dashboard/pull/5645

   ### Which Issue(s) This PR Fixes
   
   - Fixes #5644
   
   ### Brief Description
   
   The broker-cluster topology page polls `listClusters` every 2 s while live 
refresh is on, and every failing tick toasted `common.refreshFailed` and called 
`clearData()`. With the server briefly down the operator gets an error toast 
every 2 s and the topology they are looking at is blanked between ticks.
   
   This adds the same silent-tick treatment the consumer page uses (#4968): a 
`silent` flag on `loadData` — the poller passes `silent=true`, which skips the 
spinner, skips the toast, and keeps the last good topology. An explicit refresh 
(button) keeps the loud failure: data clears and one toast shows.
   
   The most recent request clears the spinner even when it is a silent tick. 
Otherwise, a tick that superseded a pending explicit refresh left that 
refresh's spinner on, because the explicit request was no longer the latest and 
skipped `setLoading(false)`.
   
   ### How Did You Test This Change?
   
   Rebased onto `rocketmq-studio` (a92c2314).
   
   ```
   $ cd web && npx vitest run src/pages/studio/__tests__/BrokerCluster.test.tsx
    Test Files  1 passed (1)
         Tests  19 passed (19)
   ```
   
   The first new test fails on the unpatched page (toast fires and the table is 
cleared on a silent tick); this was run on the original branch:
   
   ```
   × keeps the last topology and stays quiet when a live-refresh tick fails
   Tests  1 failed | 15 passed (16)
   ```
   
   The second fails when `!silent &&` is restored in the `finally` guard on the 
rebased branch:
   
   ```
   × clears the spinner when a live-refresh tick supersedes a pending explicit 
refresh
   Tests  1 failed | 18 passed (19)
   ```
   
   `eslint`, `prettier --check` and `tsc -b` pass on both changed files.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [x] New source files carry the ASF license header
   - [ ] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)
   
   ---
   
   Re-submission of #5073: the original PR was closed by the stale bot after 7 
days without review activity, and GitHub rejects reopening pull requests in 
this repository ("state cannot be changed"), so the same change is re-submitted 
rebased onto the current `rocketmq-studio` tip (`6a68042f`). The original 
thread stays available at #5073.
   
   


-- 
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