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

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6109
   
   ### Brief Description
   
   `RocketMQLiteTopicProvider.consumedMessages` stops after 
`MAX_SESSION_LITE_TOPIC_SCAN` (200)
   per-lite-topic offset lookups and only logs a warning (`:333-358`), so on a 
session with more lite
   topics the summed consumed offset is a lower bound that `buildSession` 
(`:307-312`) publishes as
   `consumedMessages`, feeds into `totalMessages = consumed + pending`, and 
turns into a
   `consumptionRate` percentage — a busy session reads as having unconsumed 
messages, and
   `rmq.litetopic.session` passes the same numbers on as measured.
   
   The scan now returns whether the cap cut it short; the domain model, 
`LiteTopicSessionVO` and the
   `LiteTopicSessionOutput` tool contract carry it as `consumedScanTruncated`, 
and
   `tool-catalog/tools/litetopic.yaml` documents it (with `catalog_gen.go` 
regenerated).
   
   User-visible change: the session drawer prefixes 已消费消息 and 总消息数 with `≥` 
when the flag is set,
   replaces the 消费进度 bar with a neutral `InfoBanner` explaining that the two 
counters are lower bounds
   and that 待消费消息 is complete, and the `rmq.litetopic.session` output carries
   `consumedScanTruncated: true` so an assistant can qualify the numbers 
instead of asserting them.
   
   ### How Did You Test This Change?
   
   ```
   cd server && mvn -B -ntp test -DforkCount=1 \
     
-Dtest='RocketMQLiteTopicProviderTest,LiteTopicServiceTest,LiteTopicControllerTest,LiteTopicSessionToolHandlerTest,LiteTopicListToolHandlerTest,ToolOutputSchemaContractTest'
   Tests run: 52, Failures: 0, Errors: 0, Skipped: 0
   BUILD SUCCESS          (checkstyle: 0 violations)
   
   make -C rmqctl catalog-verify   ✓
   
   npx eslint src/api/liteTopic.ts src/i18n/translations.ts 
src/pages/studio/LiteTopic.tsx \
     src/pages/studio/__tests__/LiteTopic.test.tsx     ✓
   npx prettier --check <the same four files>          ✓
   npx tsc -b                                          ✓
   npx vitest run src/pages/studio/__tests__/LiteTopic.test.tsx --maxWorkers=1 
--fileParallelism=false
     Tests  17 passed (12.3s)
   ```
   
   The new tests fail without the fix. The scan's truncation report and the 
drawer's presentation are
   the two halves, so each was removed on its own with the new cases kept:
   
   ```
   # scan no longer reports the cap (the session keeps the flag's default false)
   $ mvn -B -ntp test 
-Dtest=RocketMQLiteTopicProviderTest#getSessionShouldReportATruncatedConsumedScanTest
   [ERROR] getSessionShouldReportATruncatedConsumedScanTest:279
   Expecting value to be true but was false
   Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
   
   # drawer no longer presents the lower bound 
(web/src/pages/studio/LiteTopic.tsx restored to trunk)
   $ npx vitest run src/pages/studio/__tests__/LiteTopic.test.tsx 
--maxWorkers=1 --fileParallelism=false
    Tests  1 failed | 16 passed (17)
   ```
   
   ### 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`
   - [x] 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]

Reply via email to