yuluo-yx opened a new issue, #2901:
URL: https://github.com/apache/rocketmq-dashboard/issues/2901

   ### Problem\n stores its in-flight flag inside the effect. If a component 
rerenders with a new poll callback while the old promise is unresolved, the 
effect is recreated with a fresh flag. An interval or visibility event can then 
start another poll before the original completes.\n\n### Reproduction\n1. 
Enable polling and let the first poll return a pending promise.\n2. Rerender 
the hook with a new callback.\n3. Fire a visibility event or advance the 
interval.\n4. Observe the new callback running while the first promise is still 
pending.\n\n### Expected behavior\nThe no-overlap guarantee survives effect 
recreation; polling resumes with the latest callback only after the active 
promise settles.\n\n### Proposed fix\nKeep the active promise in a hook-level 
ref and clear it with identity checking, plus a rerender regression test.


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