You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "123123213weqw (via GitHub)" <gi...@apache.org> on 2026/10/16 02:28:06 UTC
[PR] fix(web): cancel queued visible polls when the effect is gone [rocketmq-dashboard]
123123213weqw opened a new pull request, #6837:
URL: https://github.com/apache/rocketmq-dashboard/pull/6837
Fixes #6412.
`useVisiblePolling` scheduled polls through `Promise.resolve().then(poll)`: cleanup removed the timer and the visibility listener, but nothing could cancel a microtask already queued — so disabling live refresh, changing the callback, or unmounting in the window between the scheduling event and the queued callback still started the obsolete request, and visibility was only checked before queuing, not when the callback actually ran.
The effect now owns a `cancelled` flag set in cleanup, and the queued wrapper re-validates at execution time: a suppressed poll bails out (and still releases the in-flight guard via the existing `finally`) when the effect is gone, polling is disabled, or the page is no longer visible. The overlap guard, timer and listener logic are untouched.
Three red-first regression tests (each fails on the base hook): queued poll does not run after unmount, does not run after polling is disabled, and does not run when the page hides before the queued callback executes — the last also asserts the guard is released so the next visible event polls again. Suite is 8/8; lint clean.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(web): cancel queued visible polls when the effect is gone [rocketmq-dashboard]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6837:
URL: https://github.com/apache/rocketmq-dashboard/pull/6837#issuecomment-6377405810
This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(web): cancel queued visible polls when the effect is gone [rocketmq-dashboard]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #6837: fix(web): cancel queued visible polls when the effect is gone
URL: https://github.com/apache/rocketmq-dashboard/pull/6837
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org