angular icon indicating copy to clipboard operation
angular copied to clipboard

fix(core): check if transplanted views are attached to change detector

Open edusperoni opened this issue 1 year ago • 1 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [x] 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.io application / infrastructure changes
  • [ ] Other... Please describe:

What is the current behavior?

Template views are always changed detected inside OnPush components if they are detached. Depending on the project, it needs to have at least 1 transplanted view attached for the issue to be reproduced.

Issue Number: #46973

What is the new behavior?

We first check if the transplanted view is attached to change detection before running any other CD in it.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

edusperoni avatar Jul 26 '22 22:07 edusperoni

All internal tests passed in the TGP. This change is good to go once comments are resolved.

atscott avatar Aug 01 '22 23:08 atscott

@atscott I've updated the PR with new tests. They should cover all cases now

edusperoni avatar Aug 04 '22 18:08 edusperoni

I see that you just added the action: merge label, but the following checks are still failing:     failure status "pullapprove" is failing     pending status "google3" is pending

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

ngbot[bot] avatar Aug 05 '22 18:08 ngbot[bot]

This PR was merged into the repository by commit dbed2cf079c52825ce0aa67fc2a46bc3d38f408f.

dylhunn avatar Aug 08 '22 18:08 dylhunn

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.