You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "unbridled-41 (via GitHub)" <gi...@apache.org> on 2026/09/05 08:18:15 UTC

[PR] fix(acl): reload the user page after creating or deleting a user [rocketmq-dashboard]

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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(acl): reload the user page after creating or deleting a user [rocketmq-dashboard]

Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #3300:
URL: https://github.com/apache/rocketmq-dashboard/pull/3300#issuecomment-5550559377

   补充完整验证记录(本地沙箱;因上游 CI 对所有分支 startup_failure——工作流未启动——无法依赖 CI):
   
   - 新回归测试先红后绿:pristine 上 create/delete 成功后 `pageAclUsers` 仅 1 次调用(期望 2 次),两个新测试均红灯;修复后 `npx vitest run src/pages/instance/__tests__/AclPage.test.tsx` 23/23 通过。
   - 全量前端套件(`npx vitest run --testTimeout=60000`)两轮:第一轮 2 失败、第二轮 924 tests 1 失败 = `ConsumerPage.test.tsx` "keeps the latest client stack..."(本沙箱已证实的负载脆弱文件,与 PR #3156 验证时同一文件);AclPage(含 2 个新测试)在全量与隔离运行中均 23/23 全过。本次修改未触碰 ConsumerPage。
   - `npm run build` ✓(等价 CI frontend-build);`npx tsc --noEmit` 干净;`npx eslint` 两个改动文件干净。
   - git diff 自检:仅 acl.tsx 新增 userRefreshKey 刷新模式 + 2 个新测试,无无关改动。
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(acl): reload the user page after creating or deleting a user [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #3300:
URL: https://github.com/apache/rocketmq-dashboard/pull/3300


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org