yyqdbngt opened a new pull request, #2940:
URL: https://github.com/apache/rocketmq-dashboard/pull/2940

   ## Summary
   - `consumerService.listConsumerGroupPage`, 
`topicService.getTopicConsumerPage`, and `messageService.listDLQGroups` (mock 
mode) now clamp `page` to >= 1 and `pageSize` to 1..100, matching the existing 
`listTopicsPage` behavior
   - Adds a regression test per service: zero/negative page and zero/oversized 
pageSize resolve to the first page instead of a negative slice
   
   ## Why
   These mock pagination paths computed `from = (page - 1) * pageSize` without 
clamping, while `listTopicsPage`, `aclService.pageAclUsers`, 
`messageService.queryMessagePage`, and `opsService.listAlertRulesPage` already 
validate or clamp the same inputs. A zero or negative `pageSize` made `from` 
negative, and `Array.prototype.slice` interprets negative indices from the end 
of the array — so `pageSize: 0` returned an empty page and `page: 0` returned a 
shifted, wrong window of rows.
   
   ## Testing
   - `./node_modules/.bin/vitest run src/services/consumerService.test.ts 
src/services/topicService.test.ts src/services/messageService.test.ts` → 33 
passed (3 new; verified all 3 fail with the pre-fix services)
   - `./node_modules/.bin/tsc --noEmit` → clean
   - `./node_modules/.bin/eslint` on the 6 changed files → 0 errors
   


-- 
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]

Reply via email to