zjncs opened a new pull request, #5628:
URL: https://github.com/apache/rocketmq-dashboard/pull/5628
Closes #5627
## Problem
`reloadInstances` only bumped the retry token — `instancesLoading` stayed
`false` for the whole refetch, and pages mirroring the flag into their table
spinners (`consumer.tsx` / `topic.tsx` do `setLoading(instancesLoading)` in the
no-instance branch) rendered a hard empty state with a dead-looking retry
button instead of a loading state.
## Fix
Re-arm the flag alongside the token bump:
```ts
const reloadInstances = useCallback(() => {
setInstancesLoading(true);
setReloadToken((token) => token + 1);
}, []);
```
## Verification (on unmodified rocketmq-studio 6a68042f)
- New test `re-arms the loading flag while a retry is in flight`: first load
rejects (failed=true), click retry, assert loading=true then the resolved state
— **FAILS on the branch** (5s timeout, `instances-loading` stays `"false"`),
**PASSES with this change**
- Mutation check: stashing only the hook change makes the test fail again;
restoring it passes
- Regression: the full `useInstanceFilter` suite 4/4; the ConsumerPage suite
(a consumer of the hook) 39/39 on the branch; `tsc --noEmit` clean
## Collision note
`useInstanceFilter.ts` and its test are untouched by any of the 329 open PRs
(verified per-PR file lists) — a clean PR. Note this targets
**rocketmq-studio** because the retry mechanism does not exist on master.
--
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]