RockteMQ-AI commented on issue #1090:
URL: 
https://github.com/apache/rocketmq-dashboard/issues/1090#issuecomment-5208081097

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The reported issue has been verified against the described code.
   
   **Root Cause:** `BrokerCluster.tsx` invokes `void loadData()` during render 
(inside the `initialized` guard), which violates React lifecycle rules (state 
updates during render can cause infinite loops or inconsistent state). The 
live-refresh Switch only calls `setAutoRefresh` without scheduling any timer or 
effect to fetch updated data.
   
   **Impact:** Broker Cluster page — initial load may cause React 
warnings/errors, and enabling live-refresh has no effect on data freshness.
   
   **Severity:** medium
   
   **Proposed Fix Direction:**
   1. Move initial `loadData()` into a `useEffect` with proper dependency 
tracking
   2. Schedule periodic refreshes only while auto-refresh is enabled (via 
`setInterval` in an effect)
   3. Clean up timers on disable/unmount
   4. Add regression tests for initial and periodic fetch behavior
   
   An automated fix proposal can be generated. Reply `/approve` to proceed with 
PR generation.
   
   ---
   *Automated evaluation by github-manager*


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