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

   ### 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 `rocketmq-studio` branch, or I 
have stated the exact version I am running below.
   
   ### Studio Version
   
   branch: rocketmq-studio
   git commit id: a92c2314
   deployed as: built from source (the web service module only, no server or 
web dev server running)
   
   ### Runtime Environment
   
   OS: Ubuntu on WSL2 (linux/amd64)
   MySQL: not applicable - the defect is in the web mock data source
   browser (for UI issues): not applicable - reproduced by a unit test against 
the mock branch
   
   ### Connected RocketMQ Cluster
   
   not applicable - no cluster is involved; the defect reproduces with the 
bundled mock data source alone
   
   ### Describe the Bug
   
   In mock-data mode the cluster page's NameServer configuration-drift panel 
advertises a comparison scope the endpoint does not use. 
`getNameServerConfigDiff` (`web/src/services/clusterService.ts:128`) answers 
with `comparedKeys: ['listenPort', 'serverWorkerThreads', 
'clientRequestThreadPoolNums']`, and the panel renders that list as chips next 
to the differences (`web/src/pages/cluster/index.tsx:996`). The endpoint 
answers with `NameServerConfigDiffService.SAFE_CONFIG_KEYS`, which the service 
loads from `server/src/main/resources/cluster/nameserver-safe-config-keys.yml` 
- the 19 keys listed there. So the demo claims the drift check compares 
`clientRequestThreadPoolNums`, a key the service never compares, and it omits 
17 of the keys that it does compare.
   
   A demo reader therefore cannot tell what the feature actually checks: the 
listed scope is both wrong about one key and incomplete about the rest.
   
   ### Steps to Reproduce
   
   1. Run the web unit test that reads the endpoint's own whitelist and the 
mock result: `cd web && npx vitest run src/services/clusterService.test.ts` 
(the case `advertises the NameServer comparison scope the endpoint reports`).
   2. Observe the assertion failure: `expected [ 'listenPort', …(2) ] to deeply 
equal [ 'listenPort', …(18) ]`, with `clientRequestThreadPoolNums` on the 
received side.
   3. Alternatively, switch the app to mock data mode, open the cluster page 
and read the compared-key chips of the NameServer drift panel against the 19 
keys of `server/src/main/resources/cluster/nameserver-safe-config-keys.yml`.
   
   ### What Did You Expect to See?
   
   The mock result lists exactly the keys the endpoint compares, so the chips 
show the same comparison scope as a real deployment. The whitelist resource 
documents itself as the single source of truth ("新增/删除键直接改本文件即可,无需改代码"), and 
the neighbouring mock branches already mirror endpoint behaviour.
   
   ### What Did You See Instead?
   
   The mock result lists three keys: two from the whitelist plus 
`clientRequestThreadPoolNums`, which is not in the whitelist and is never 
compared, while `serverCallbackExecutorThreads`, `serverSelectorThreads` and 
the other 15 whitelisted keys are missing.
   
   ### Additional Context
   
   This is the same mock/endpoint parity rule the neighbouring open change 
applies to the mock cluster-config queue counts (#5486), and the new test pins 
the two lists together the way `web/src/api/aiEvents.contract.test.ts` pins the 
AI event contract against its server-side fixture: the test reads the whitelist 
from the server resource, so a key added there without the mock following fails 
the web suite. A fix with a regression test follows in a pull request.
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, I am willing to submit a pull request.
   


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