Conversation
RockteMQ-AI
approved these changes
Sep 17, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Fixes the same silent pagination truncation bug for the instance catalog listing path. Adds an isIncompletePage() guard that fails closed with 502 when TotalCount contradicts the current page, and refactors hasFetchedAll() to use offset + returned >= total.
Verdict: LGTM. Clean, well-tested fix (3 new tests including the genuine-empty-catalog edge case). The inline guard approach (boolean check + throw at call site) is slightly different from the requireCompletePage() pattern in #4531, but both are clear and correct.
Minor Note
- Same cross-PR observation: consider a shared pagination utility if this pattern grows. Not blocking.
Automated review by github-manager-bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Issue(s) This PR Fixes
Brief Description
Tencent RocketMQ 5.x catalog pagination previously treated any null/empty
Datapage as the end of the instance list before consultingTotalCount. A short page was also accepted as complete whenever it returned fewer thanPAGE_SIZErows.When
TotalCountsays more provider rows exist, either condition represents an incomplete/contradictory page. Returning the rows collected so far makes Studio's cloud-instance catalog look complete even though instances are missing.This change fails closed with a 502-style
BusinessExceptionwhen a knownTotalCountproves rows remain but the current page is short or empty. Genuine empty catalogs remain valid, and missing/negativeTotalCountkeeps the previous short-page fallback behavior.Red / Green Verification
Baseline:
master@d50ffecc9d7e8f8f46da64198831bd7952e6974e.Fail-before, Java 21:
TotalCount=1andData=null.TencentCatalogServiceTest: 9 tests, exactly 1 failure.Expecting code to raise a throwable, proving current master returned a successful empty catalog.Green, Java 21:
TencentCatalogServiceTest: 11/11 passed, 0 failures/errors.mvn -B -ntp -DskipTests package: BUILD SUCCESS.git diff --check: clean.Compatibility / Risk
No API, schema, dependency, or frontend changes. Normal full pages, successful final pages, client-side search filtering, count normalization, and genuine empty catalogs are unchanged. Only provider responses that contradict their own known total count now surface as unavailable instead of silently truncating the catalog.
AI-assisted source audit, implementation and regression authoring; Tencent's current
DescribeInstanceListAPI contract and the pinned Java SDK model were checked before filing.