zjncs opened a new pull request, #5595:
URL: https://github.com/apache/rocketmq-dashboard/pull/5595
## 问题
`web/src/services/consumerService.ts` 的 `listConsumerGroupPage`(118-134
行)mock **不校验分页参数**:
- **page 0/负值** 变成负 slice 索引(`from = Math.min((page-1)*pageSize,
len)`)——`page=-1` 从列表**末尾**取数=错误数据;`page: 0` 返回 `{items: [], total: 10, page:
0}`
- **pageSize 101** 静默返回整页数据
后端全部 400:`MetadataService.validatePagination`(`/groups/page` 经 395 行调用)抛
`"page must be greater than zero"` / `"pageSize must be between 1 and
100"`(`MAX_PAGE_SIZE=100`)。与已合并 #5498(aclService)及本批 #5593(DLQ
mock)同族——这是同契约的消费者组分支。
## 修复
mock 按后端消息拒绝越界值;合法路径不变。
## 验证(三段)
1. **先红**:新增 4 用例(page 0/负值、pageSize 101/0)在未修复代码上失败(负页返回垃圾行、101 返回整页)
2. **后绿 + 回归**:修复后 21/21(含既有 17 用例)
3. **突变**:mock 还原 → 4 用例红;恢复 → 绿
## 碰撞核查
`web/src/services/consumerService.ts` 无任何开放 PR
触碰(已认领服务:aclService/clusterService/instanceService/opsService/messageService——188
open PR 文件清单核对)。
Closes #5594
--
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]