Skip to content

[signal forms]: debounceForDuration does not resolve its Promise on abort, causing pending awaits #66646

@u-mikhalenka

Description

@u-mikhalenka

Which @angular/* package(s) are the source of the bug?

forms

Is this a regression?

No

Description

The current implementation of debounceForDuration does not resolve or reject the returned Promise when the associated AbortSignal is aborted (source).

As a result, callers awaiting this Promise may remain suspended indefinitely. In particular, debounceSync awaits debounceForDuration (source), and if the debounce is aborted, the await never resolves.

This can lead to:

  • async execution paths that never complete
  • retention of async stack frames and captured variables
  • potentially increased memory usage in long-running or frequently triggered scenarios

Resolving the Promise on abort would avoid this issue. This should be safe, as debounceSync already checks controller.signal.aborted before performing the sync operation, so resolving early would not change observable behavior—only ensure proper completion of the async flow.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)

Angular CLI       : 21.0.5
Node.js           : 24.13.0
Package Manager   : npm 11.6.2
Operating System  : darwin arm64

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions