Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cdk/testing): prevent duplicate subscription #22460

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

bgotink
Copy link
Contributor

@bgotink bgotink commented Apr 12, 2021

If the actual subscription provided by the environment comes after the first batched function call, the default function is installed and without this change it'll stay installed forever, even if another handler is installed afterwards.

I looked for a location to add a test for this, but I don't think it's currently possible to test this. The only harness environment in this repo that supports the change detection status is the TestBed variant, and that environment registers its change detection status handler eagerly.

If the actual subscription provided by the environment comes
after the first batched function call, the default function is
installed and without this change it'll stay installed forever,
even if another handler is installed afterwards.
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 12, 2021
@mmalerba mmalerba added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Apr 12, 2021
@mmalerba mmalerba merged commit 58b4ab6 into angular:master Apr 13, 2021
mmalerba pushed a commit that referenced this pull request Apr 13, 2021
If the actual subscription provided by the environment comes
after the first batched function call, the default function is
installed and without this change it'll stay installed forever,
even if another handler is installed afterwards.

(cherry picked from commit 58b4ab6)
@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 May 14, 2021
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 cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants