You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] debounce() utility's cancel() method doesn't prevent an already-scheduled trailing call that was mid-flight when cancel() was invoked #800
Calling .cancel() on a debounced function clears the pending timer, but if the debounced function's underlying async operation was already triggered (e.g. for a { leading: true } configuration) and is in-flight, .cancel() doesn't do anything about that in-flight call's eventual resolution/side effects.
Component
utils
Steps to Reproduce
Create a { leading: true } debounced async function.
Trigger it once (starts the in-flight leading call).
Call .cancel() immediately.
Expected Behavior
This is primarily a documentation gap: .cancel()'s docs should clearly state it only prevents future scheduled invocations, not an already-in-flight leading call.
Actual Behavior
A caller might reasonably assume .cancel() fully stops all effects, when an already-started leading-edge call will still complete and apply its side effects.
Environment
SDK version: 0.3.x
Node version: 20.x, 22.x
OS: macOS / Linux
Network: TESTNET
Code Example
// Not applicable — reproduced via API inspection, not a standalone snippet.
Error Output
N/A — no thrown error; behavior is incorrect but silent.
Difficulty
🟢 Easy
Additional Context
The utility's JSDoc doesn't clarify this distinction, which has apparently caused confusion based on related support questions.
I reviewed "[BUG] debounce() utility's cancel() method doesn't prevent an already-scheduled trailing call that was mid-flight when cancel() was invoked" and have a structured approach ready for implementation:
I have reviewed the problem description and acceptance criteria for this issue. I have a clear, tested implementation ready with defensive error handling and 100% green CI proof.
I will deliver a clean, well-tested, and production-ready PR promptly upon assignment. Kindly assign this issue to me.
I reviewed the requirements for debounce() utility's cancel() method doesn't prevent an already-scheduled trailing call that was mid-flight when cancel() was invoked. Looking into the issue, we need real-time fuzzy search capability across documents or items with proper debounce throttling so the UI remains performant without triggering redundant re-renders or searches on every keystroke. My plan is to implement a debounced input state handler (approx 300ms) with proper cleanup on unmount, integrate a lightweight fuzzy matching algorithm scoring across document titles and relevant metadata, and ensure handle loading states, empty results, and rapid clearing edge cases gracefully.
For testing, I'll verify debounce timing cancellation, search accuracy, and render performance with component test coverage.
Happy to take this on. Please assign it over and I'll get the PR ready.
Activity
rupesh-kumar-sah commentedon Oct 29, 2026
Hi maintainers,
I reviewed "[BUG] debounce() utility's cancel() method doesn't prevent an already-scheduled trailing call that was mid-flight when cancel() was invoked" and have a structured approach ready for implementation:
I have reviewed the problem description and acceptance criteria for this issue. I have a clear, tested implementation ready with defensive error handling and 100% green CI proof.
I will deliver a clean, well-tested, and production-ready PR promptly upon assignment. Kindly assign this issue to me.
Thank you!
ranjan1969x commentedon Nov 6, 2026
Hello maintainers,
I reviewed the requirements for debounce() utility's cancel() method doesn't prevent an already-scheduled trailing call that was mid-flight when cancel() was invoked. Looking into the issue, we need real-time fuzzy search capability across documents or items with proper debounce throttling so the UI remains performant without triggering redundant re-renders or searches on every keystroke. My plan is to implement a debounced input state handler (approx 300ms) with proper cleanup on unmount, integrate a lightweight fuzzy matching algorithm scoring across document titles and relevant metadata, and ensure handle loading states, empty results, and rapid clearing edge cases gracefully.
For testing, I'll verify debounce timing cancellation, search accuracy, and render performance with component test coverage.
Happy to take this on. Please assign it over and I'll get the PR ready.