apache / apache/rocketmq-dashboard
[Studio][Bug] Consumer group inventory goes stale after create and CSV import (no server-page refresh)
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 683
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 58
Description
## Problem
Creating a consumer group (single create or CSV import) updates the group list only locally: the created group is prepended to the currently loaded rows without refetching the server-paginated list and without updating the pagination total. The list the operator sees afterwards diverges from the server's paginated inventory until a manual refresh.
## Evidence
- `web/src/pages/instance/consumer.tsx` create flow (`onOk` of the create confirmation): after `createConsumerGroup(...)` succeeds it does `setGroups((prev) => [created, ...prev.filter(...)])`.
- Same file, CSV import flow: `if (createdGroups.length > 0) { setGroups((previous) => [...createdGroups, ...previous.filter(...)]); }`.
- The list is server-paginated: `loadConsumerGroupPage(page, pageSize)` fetches `listConsumerGroupPage({ page, pageSize })` and sets both `groups` and `totalGroups`. The local prepend updates neither the total nor the server ordering, and `autoRefresh` defaults to `false`, so nothing self-heals.
- The same file refetches the page after single and batch delete (`reloadConsumerGroupPageAfterDelete`) — the create/import paths are the only list mutations that skip the reload.
Consequences with the default settings: the pagination footer keeps showing the pre-create total; on a full page the prepended row pushes the page's last row out of view; and if the user is on page > 1 the new group is injected into that page even though the server's ordering places it elsewhere. The identical defect was already fixed for the topic inventory (merged PR #3339, "refresh paginated inventory after create") and for the ACL user inventory (#3306).
## Impact
After a successful create, the consumer group inventory shows rows and a total that do not match the server's paged inventory. An operator who creates a group and then looks for it — or trusts the total — gets wrong answers until they manually refresh.
## Expected behavior
After a successful create or import, the current page is refetched from the server (mirroring the delete paths and the topic page's post-create behavior), so rows and the pagination total reflect the server inventory.
## Related work
- #3337 (closed) tracked the same defect class for the topic page and was fixed by merged PR #3339.
- #3306 tracks the same class for the ACL user inventory.
## PR
Fix: #4245.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in web/src/pages/instance/consumer.tsx, tracing the single-create and CSV import flows alongside reloadConsumerGroupPageAfterDelete and loadConsumerGroupPage. Ensure successful create and import refetch the current server page so both rows and totalGroups match the paginated inventory, then verify the behavior on full and later pages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100