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

   ### Which Issue(s) This PR Fixes
   
   Fixes #4623
   
   ### Brief Description
   
   `rmqctl` transparently runs the two-phase confirmation handshake (dry-run 
preview to obtain a `confirm_token`, then execute) only when `--yes` is 
supplied. When the user instead answers the interactive "Type \"yes\" to 
continue" prompt for an L2/L3 tool, the resulting execution call carries no 
`confirm_token`, and the server rejects every non-dry-run mutation without a 
token (`CONFIRMATION_TOKEN_REQUIRED`) — so the interactive flow the prompt 
advertises can never succeed.
   
   This PR drops the `--yes` condition from the auto-preview path: any non-L1 
call that does not carry an explicit `--confirm-token` or a `--dry-run` flag 
runs the preview first, regardless of how it was confirmed. Interactive 
sessions now get the same treatment as scripted `--yes` calls.
   
   ### How Did You Test This Change?
   
   ```
   cd rmqctl
   go test ./...                     # all packages pass
   go test -race ./cmd/              # pass
   gofmt -l cmd/                     # clean
   go vet ./...                      # clean
   make catalog-verify               # pass
   ```
   
   Added `TestCatalogInteractiveConfirmAutoFetchesToken`: an interactive 
`yes\n` on `topic update` must first send a dry-run preview (no token), then an 
apply call carrying the auto-fetched token, and the command output is the 
EXECUTED result. The test fails without the fix (the first server call is the 
execution itself).
   
   ### Checklist
   
   - [x] Follows the project style guidelines
   - [x] Tests cover the change; `go test ./...` passes locally
   - [x] The commit message follows Conventional Commits
   - [x] No unrelated files are touched
   


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