Skip to content

fix(core): prevent unsubscribe during emit from throwing off other listeners#69327

Open
crisbeto wants to merge 1 commit into
angular:mainfrom
crisbeto:69325/output-emitter-array
Open

fix(core): prevent unsubscribe during emit from throwing off other listeners#69327
crisbeto wants to merge 1 commit into
angular:mainfrom
crisbeto:69325/output-emitter-array

Conversation

@crisbeto

Copy link
Copy Markdown
Member

Fixes that when a listener unsubscribes from an output within its own callback, it was preventing subsequent listeners from running.

These changes fix the issue by not mutating the array while the emit loop is running, but replacing the listener with null and coming back later to remove it.

Fixes #69325.

…steners

Fixes that when a listener unsubscribes from an `output` within its own callback, it was preventing subsequent listeners from running.

These changes fix the issue by not mutating the array while the emit loop is running, but replacing the listener with `null` and coming back later to remove it.

Fixes angular#69325.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jun 12, 2026
@angular-robot angular-robot Bot added the area: core Issues related to the framework runtime label Jun 12, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jun 12, 2026
@crisbeto crisbeto requested a review from atscott June 12, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OutputEmitterRef.emit() skips listeners when an earlier listener unsubscribes synchronously (e.g. outputToObservable + take(1))

1 participant