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

   ## Which Issue(s) This PR Fixes
   
   Fixes #5984
   
   > Note: the previous attempt #5985 was automatically closed by the stale bot 
on 2026-10-17 after 7 days without review activity. This is a fresh 
resubmission; I'm happy to close it if the original author reopens #5985.
   
   ## Brief Description
   
   `rmq.group.reset_offset` rejected only a **null** timestamp. A `0` (or 
negative) value passed both preview and execute. The broker resolves a 
timestamp at or before the first stored message to each queue's minimum offset, 
so the applied L2 mutation rewound **every queue** of the topic — a mass replay 
of already-consumed messages, reachable through `POST 
/api/ai/tools/rmq.group.reset_offset/execute`, `POST /api/mcp/tools/call` and 
`rmqctl group reset-offset --timestamp=0`. The REST endpoint `POST 
/api/groups/reset-offset` already answers 400 for the same input (`@NotNull 
@Positive`).
   
   ### Changes
   
   - Reject `timestamp <= 0` in the shared 
`GroupResetOffsetToolHandler.requireTimestamp` (used by both `preview()` and 
`execute()`), with the REST contract message `timestamp must be positive` and 
HTTP 400, before any broker call.
     - Preview now fails, so no confirm token is issued for the destructive 
rewind.
     - Execute can no longer reach `MetadataService.resetOffset`.
   - Regression tests for both paths with `0` and `-1`.
   
   ## How Did You Test This Change?
   
   ```
   mvn -B -ntp test -Dtest=GroupResetOffsetToolHandlerTest
   ```
   
   - With the fix: `Tests run: 6, Failures: 0, Errors: 0, Skipped: 0`
   - Fix reverted while keeping the new tests: the 4 new cases fail, the 2 
original cases pass (red/green verified).
   - `mvn checkstyle:check`: 0 violations.
   
   ## Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled (2 files, 
+44/-1)
   - [x] Commit subject follows Conventional Commits and is `[studio]`-prefixed
   - [x] Tests added/updated for non-trivial changes
   - [x] New source files carry the ASF license header (no new files)
   - [x] No UI text / i18n changes


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