Skip to content

fix(forms): Resolves debounce promise on abort in debounceForDuration#66650

Merged
leonsenft merged 1 commit intoangular:mainfrom
SkyZeroZx:fix/signals-form-debounce-resolve
Jan 30, 2026
Merged

fix(forms): Resolves debounce promise on abort in debounceForDuration#66650
leonsenft merged 1 commit intoangular:mainfrom
SkyZeroZx:fix/signals-form-debounce-resolve

Conversation

@SkyZeroZx
Copy link
Contributor

@SkyZeroZx SkyZeroZx commented Jan 20, 2026

Ensures the promise returned by the debouncer resolves when aborted, preventing potential hangs for awaiting consumers. Fixes #66646

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #66646

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Ensures the promise returned by the debouncer resolves
when aborted, preventing potential hangs for awaiting consumers.
Fixes angular#66646
@ngbot ngbot bot added this to the Backlog milestone Jan 20, 2026

const onAbort = () => {
clearTimeout(timeoutId);
resolve();
Copy link
Contributor Author

@SkyZeroZx SkyZeroZx Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found a way to replicate the problem mentioned with a test; however, I think it's right that we solve the problem to avoid any unexpected behavior or memory leak

Copy link
Contributor

@leonsenft leonsenft Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree this is correct. I don't believe we can properly unit test this without exporting the private debounceForDuration API.

@SkyZeroZx SkyZeroZx marked this pull request as ready for review January 20, 2026 18:58
@pullapprove pullapprove bot requested a review from kirjs January 20, 2026 18:58
@kirjs kirjs requested a review from leonsenft January 26, 2026 20:15
@kirjs
Copy link
Contributor

kirjs commented Jan 26, 2026

Thank you, I know @leonsenft is working in that area right now, so adding him as a reviewer

@JeanMeche JeanMeche added the target: patch This PR is targeted for the next patch release label Jan 26, 2026
@JeanMeche JeanMeche removed the request for review from kirjs January 26, 2026 23:10
@leonsenft leonsenft added the action: merge The PR is ready for merge by the caretaker label Jan 30, 2026
@leonsenft leonsenft merged commit b1bf535 into angular:main Jan 30, 2026
24 checks passed
@leonsenft
Copy link
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: forms target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants