Loyal-Young opened a new pull request, #6464:
URL: https://github.com/apache/rocketmq-dashboard/pull/6464

   ### Which Issue(s) This PR Fixes
   
   Fixes #6462
   Refs #4986
   
   ### Brief Description
   
   Cancel the deferred Metrics data-source fallback when its effect is cleaned 
up. Leaving an instance with a scoped data source schedules a zero-delay reset; 
if the component unmounts or the user returns to the original instance before 
it fires, the old callback must not clear that selection or issue obsolete 
queries.
   
   Wang1rrr previously identified this timer in #4986, which was closed by the 
stale workflow. This PR addresses the Metrics timer with component regressions 
for both cleanup paths. The cluster retry timer discussed there is outside this 
change.
   
   ### How Did You Test This Change?
   
   - Both new regression cases failed against the original implementation 
because the expired fallback still called the query API.
   - `MetricsExplorer.test.tsx`: **41 tests passed**, including existing valid 
fallback behavior and the two new cancellation cases.
   - Prettier, ESLint, application TypeScript checking and `git diff --check`: 
passed.
   
   Tests use mocked APIs and controlled timers. No live Prometheus or browser 
integration test was run.
   
   ### Checklist
   
   - [x] One coherent fix with regression tests
   - [x] No new UI strings or dependencies
   
   ### AI Assistance
   
   AI assistance was used to inspect the effect lifecycle and previous 
discussion, draft the timer cleanup and component regression tests, and execute 
the checks listed above.
   


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