Skip to content

Remove leading debounces - #229

Merged
tudddorrr merged 1 commit into
developfrom
remove-leading-debounce
Aug 5, 2026
Merged

Remove leading debounces#229
tudddorrr merged 1 commit into
developfrom
remove-leading-debounce

Conversation

@tudddorrr

@tudddorrr tudddorrr commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Trailing-only debounce

  • Debounce behaviour changed from leading-and-trailing to trailing-only: the first call no longer fires immediately; all calls are deferred until the debounce window closes and then coalesced into a single API call.

Shared task result

  • All callers within the same debounce window now share the same Task result instead of each receiving an independent TaskCompletionSource.

Simplified debounce internals

  • Removed the SettleLeading method and the leading-call branch from Debounce(), leaving a single code path that always queues a trailing call.
  • ProcessPendingUpdates no longer distinguishes between leading-in-flight and trailing-queued states; it simply re-opens the window if an execution is still running.

Test alignment

  • Tests renamed and restructured to reflect trailing-only semantics (e.g. LeadingCall_*TrailingCall_*).
  • Assertions reordered so yield return null precedes assertions, giving the trailing call a frame to execute.
  • debounceTimerSeconds set to 0f in test setup to make trailing calls fire immediately in the next frame.

@tudddorrr
tudddorrr merged commit 1fb437b into develop Aug 5, 2026
3 checks passed
@tudddorrr
tudddorrr deleted the remove-leading-debounce branch August 5, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant