Frun1na opened a new issue, #5642:
URL: https://github.com/apache/rocketmq-dashboard/issues/5642

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open 
issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository 
and believe that this is not a duplicate.
   - [x] This is a defect in RocketMQ Studio, not a usage question and not a 
defect in another Apache RocketMQ repository.
   - [x] I can reproduce this on the current `master` branch, or I have stated 
the exact version I am running below.
   
   ### Studio Version
   
   branch: `rocketmq-studio` (rmqctl is not on `master`)
   git commit id: `6a68042f`
   deployed as: built from source (`go build .` in `rmqctl/`)
   
   ### Runtime Environment
   
   OS: not applicable — the defect is in the CLI's own table renderer, before 
any server is contacted.
   MySQL: not applicable.
   browser: not applicable.
   
   ### Connected RocketMQ Cluster
   
   RocketMQ version: not applicable — the defect is in the CLI's own table 
renderer.
   access mode: not applicable.
   deployment: not applicable.
   
   ### Describe the Bug
   
   `rmqctl` renders table cells through `rmqctl/internal/output/output.go` 
(`stringify`), reached from `output.Rows` via `cmd/catalog_renderers.go` 
(`renderTable`, the default `--output table` path for table-view tools such as 
`rmq.message.query`). Nested objects and arrays decoded from the tool response 
fall through to Go's default `fmt.Sprint` formatting, so any cell that carries 
a nested value shows Go map/slice syntax:
   
   ```
   QUOTA
   map[max:10 used:3]
   ```
   
   The server sent JSON; the CLI re-renders it in Go syntax, which is noisy, 
loses the original shape, and reads nothing like the JSON the structured output 
carries.
   
   ### Steps to Reproduce
   
   1. Build the CLI: `cd rmqctl && go build .`.
   2. Run any table-view tool whose rows carry a nested object or array, e.g. 
`rmqctl message query --instance-id <id> --topic-name <topic> --key <key>` 
(default `--output table`).
   3. Look at the column that carries the nested value: it prints in Go syntax 
(`map[...]`, `[a b]`) instead of the JSON the server sent.
   4. Deterministic reproduction without a server: `go test ./internal/output/ 
-run TestRowsRendersNestedValuesAsJSON` on the unpatched renderer fails with 
`data line renders Go syntax for nested values: "group-a  map[max:10 used:3]  
[a b]"`.
   
   `go test ./internal/output/ -run TestRowsRendersNestedValuesAsJSON` pins 
this: on the unpatched renderer the data line is `"group-a  map[max:10 used:3]  
[a b]"`.
   
   ### What Did You Expect to See?
   
   Nested values rendered as their JSON form — `{"max":10,"used":3}`, 
`["a","b"]` — matching what the server sent and what the structured output 
shows. Scalar cells are unaffected.
   
   ### What Did You See Instead?
   
   Go's default map/slice formatting (`map[max:10 used:3]`, `[a b]`), which no 
other output mode of the CLI uses.
   
   ### Additional Context
   
   - renderer: `rmqctl/internal/output/output.go`, `stringify`
   - the structured (`--output json`) path is unaffected; this is the table 
renderer only
   
   ---
   
   Re-submission: the original report (#5080) was closed by the stale bot after 
7 days without triage activity, and GitHub now rejects reopening items in this 
repository. Refiled unchanged; the fix PR is linked below.
   


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