unbridled-41 commented on PR #3997:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/3997#issuecomment-5558079839

   ## Audit follow-up (second commit `2b347d9672df87ad206032fec6dad46b957e72f1`)
   
   During the evidence-chain review of this PR, a real defect was found in the 
original implementation: `ClusterRepositoryImpl.copyBroker` rebuilds `BrokerVO` 
field-by-field for the repository's defensive copies (used by 
`findById`/`findAll`), so the four new daily-counter fields were silently 
dropped on every repository read. The web listing path was unaffected (it 
consumes the provider result directly), but any repository consumer would have 
seen zeroed counters — a lossy copy violating the method's own contract.
   
   Fix: carry the four fields through `copyBroker`, seed the demo broker 
(`initStubData`) with counters, and lock it in with 
`findByIdShouldPreserveBrokerDailyMessageCounters`.
   
   - Red (copyBroker fix stashed, stub data + test kept): `mvn -ntp test 
-Dtest=ClusterRepositoryImplTest` → Tests run: 5, Failures: 1 — `expected: 
1500L but was: 0L`.
   - Green: ClusterRepositoryImplTest **5/5**; cluster module 
(`ClusterRepositoryImplTest,ClusterServiceTest,ClusterControllerTest,ClusterServiceRegistryTest,ClusterConnectionServiceTest,RocketMQClusterProviderTest`)
 → **Tests run: 102, Failures: 0**.
   - New head `2b347d96...`: 0 check runs / no workflow runs (upstream CI 
currently fails to start for all branches); diff of the second commit is 2 
files, +20/−0.


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