unbridled-41 opened a new issue, #5945:
URL: https://github.com/apache/rocketmq-dashboard/issues/5945

   ### Studio Version
   branch: `rocketmq-studio` @ `7e7aa344` (the revision verified; the branch is 
based on it)
   deployed as: not required to reproduce
   
   ### Runtime Environment
   
   Reproduced with the frontend tests (`cd web && npx vitest run 
src/utils/topicConfigComparison.test.ts`); any browser.
   
   ### Connected RocketMQ Cluster
   
   A comparison whose two sides come from different providers (or an Apache 
side plus a Tencent one).
   
   ### Describe the Bug
   
   `compareTopicInventories` only normalised strings:
   
   ```ts
   const valueOf = (topic, field) => {
     const value = topic[field];
     return typeof value === 'string' ? value.trim() : value;
   };
   ```
   
   The providers spell "absent" differently: the Apache provider never sets 
`namespace`, so the API serializes `namespace: null`, while a Tencent topic can 
answer `""` for the same thing. Left raw, the null:
   
   - leaks into the difference text and the drawer's CSV export as the literal 
token `null` (`namespace: null -> test_namespace`), and
   - makes `null` vs `""` - both "no namespace" - a configuration **DRIFT**, so 
topics that agree are flagged for the operator to chase.
   
   ### Steps to Reproduce
   
   1. Compare an Apache instance's topics with a Tencent instance's (or any 
pair where one side omits `namespace`).
   2. The namespace row is reported as a difference, and an exported CSV 
contains `null` as a value.
   
   ### What Did You Expect to See?
   
   Absent values compared as equal and rendered as an empty field, like the 
sibling fields are trimmed for exactly this heterogeneity.
   
   ### What Did You See Instead?
   
   `DRIFT` for agreeing topics and the JS token `null` in the UI and the export.
   
   ### Evidence
   
   - `web/src/utils/topicConfigComparison.ts` (`valueOf`), 
`web/src/components/TopicConfigComparisonDrawer.tsx` (the renderer and the CSV 
column).
   - `cd web && npx vitest run src/utils/topicConfigComparison.test.ts -t 'null 
token'` - fails before the fix (`expected 'DRIFT' to be 'MATCH'`).
   
   ### Impact
   
   False drift reports (and a `null` value in an exported artifact) for the 
cross-provider comparison the drawer exists for.
   
   ### Acceptance Criteria
   
   - An absent value compares equal to an empty one and never renders as the 
`null` token, with a regression test.
   
   **Corresponding PR:** #ISSUEPR#
   


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