Wang1rrr opened a new pull request, #5527: URL: https://github.com/apache/rocketmq-dashboard/pull/5527
<!-- Make sure the base branch is `rocketmq-studio`: that is the RocketMQ Studio trunk. --> ### Which Issue(s) This PR Fixes No issue. This replaces #4984, which the stale bot closed before review and which can no longer be reopened. It is rebased onto the current trunk and now includes regression tests. ### Brief Description On the current trunk, `rulesLoading` / `usersLoading` (`web/src/pages/instance/acl.tsx`) and `loading` (`web/src/pages/ops/systemAlerts.tsx`) start `true`, and the effects that refetch only ever call `set…Loading(false)`. After the first load, every later request (paging, a filter change, an instance switch, the reload after deleting a rule) runs with the flag still `false`: - The ACL tables show no spinner and keep presenting the previous page's rows as current until the response arrives. - The alert feed keeps the previous alerts instead of its loading card. If the reload fails, the old rows stay on screen under the error toast. Each loader now sets its flag to `true` before the request starts. That happens inside the async loader rather than in the effect body, so an effect run doesn't cascade an extra render. Unmount/cancel handling is unchanged. (#5495 also touches `systemAlerts.tsx`, but clears rows after a *failed* reload; it never re-arms the flag. The two are complementary.) ### How Did You Test This Change? - New `AclPage.test.tsx` case: delete a rule while the reload is held pending, then assert the rule table's spinner is active. New `SystemAlertsPage.test.tsx` case: switch the level filter while the reload is pending, then assert the previous alert is replaced by the loading card. With both pages reverted to trunk, both tests fail; with the fix, they pass. - `cd web && npm test`: 147 files / 1388 tests pass. `npm run lint`: 0 errors (the same 10 existing warnings). `tsc -b`: clean. ### 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/` (no UI text) - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit checks) (frontend only) - [ ] New source files carry the ASF license header (no new files) - [ ] Documentation touched where behaviour changed (no documented behaviour changes) đŸ¤– Generated with [Claude Code](https://claude.com/claude-code) -- 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]
