unbridled-41 opened a new pull request, #3300: URL: https://github.com/apache/rocketmq-dashboard/pull/3300
# PR 3 — fix(acl): reload the user page after creating or deleting a user ## Problem / Evidence On the ACL page 用户管理 tab, create/delete only mutate the local page array and never update the cached server total nor refetch (contrast: the rules tab bumps `ruleRefreshKey` after its mutations, `acl.tsx` handleRuleSubmit/handleDeleteRule): - Create with a full page: the new row is prepended, the previous last row is silently pushed out of view, and the header/pagination keeps showing the stale total. - Delete the last row on the last page: the table goes empty, the total stays too high, and the empty-page auto-correction (which lives inside the fetch effect) never runs because nothing refetches. Regression tests added: `reloads the server user page after creating an ACL user` and `reloads the server user page after deleting one ACL user` — both red on pristine (`pageAclUsers` called once instead of twice), green after the fix. ## Root cause / Fix List mutations bypass the server-paginated inventory contract. Fix: add a `userRefreshKey` state next to `ruleRefreshKey`, include it in the fetch effect deps, and bump it after successful create/delete so the authoritative server page is reloaded — totals stay correct and an emptied page falls back to the previous one (the effect's existing correction logic). Update-in-place is untouched (no total change). ## Priority & scoring PRIORITY 72 = 影响 26 (wrong pagination totals, hidden rows, unrecoverable empty page until manual pagination) + 波及范围 12 (ACL user inventory) + 可复现性 19 (fully deterministic) + 维护价值 15 (mirrors the established rules-tab pattern). FIX_CONFIDENCE 88. ## Tests - `npx vitest run src/pages/instance/__tests__/AclPage.test.tsx` → 23/23 (2 new tests red on pristine, green after fix). - Full web suite + build + tsc/eslint: see comment below. ## Risk Low. Create/delete now refetch like the rules tab already does; the extra request is an idempotent page GET. -- 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]
