Frun1na opened a new pull request, #6518:
URL: https://github.com/apache/rocketmq-dashboard/pull/6518
### Which Issue(s) This PR Fixes
- Fixes #6517
### Brief Description
`TencentInstanceProvider.queryMessagesDetailed:662` advanced the paging
offset with `(long) result.size()` — the number of records collected — while
the loop skips `null` array entries (`MessageItem[]` elements the SDK produces
for JSON `null`), so every skipped row made the next offset one too small: the
API re-returned the tail of the page (duplicate msgIds in the result) and
`isLastPage(returned, total, result.size())` drifted the same way. A
`fetchedRows` counter now grows by `returned` per page and feeds both the next
offset and the last-page check; `result.size()` keeps serving only the
`MESSAGE_QUERY_HARD_LIMIT` result budget. The Aliyun sibling already counts raw
provider rows in its bookkeeping, and this provider guards null array elements
in three places, so the shape is expected rather than malformed. User-visible
change: a Tencent message query whose page contains an absent entry no longer
repeats messages (and no longer fetches a redundant page when the total is r
eached on such a page). The duplicated short-page comment above `isLastPage`
is removed while editing those lines.
### How Did You Test This Change?
```
cd server
mvn -B -ntp test -DforkCount=1 -Dtest=TencentInstanceProviderTest
[INFO] Tests run: 56, Failures: 0, Errors: 0, Skipped: 0 -- in
...TencentInstanceProviderTest
[INFO] You have 0 Checkstyle violations.
```
The new test fails without the fix:
```
[ERROR] Tests run: 56, Failures: 1, Errors: 0, Skipped: 0
...queryMessagesShouldAdvanceByConsumedRowsWhenAPageSkipsAnAbsentEntryTest
-- FAILURE!
org.opentest4j.AssertionFailedError:
expected: 100L
but was: 99L
```
Reverting only the two offset lines (keeping the test) reproduces exactly
that failure, so the assertion is sensitive to the fix and to nothing else.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`feat:` / `fix:` /
`refactor:` / `chore:` / `docs:` / `perf:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [ ] New source files carry the ASF license header
- [ ] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
--
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]