Skip to content

fix(core): unable to retrieve defer blocks in tests when component injects ViewContainerRef - #62156

Closed
crisbeto wants to merge 1 commit into
angular:mainfrom
crisbeto:62047/vcr-blocks
Closed

crisbeto wants to merge 1 commit into
angular:mainfrom
crisbeto:62047/vcr-blocks

Conversation

@crisbeto

Copy link
Copy Markdown
Member

Fixes that getDeferBlocks wasn't accounting for the case where a component might be injecting ViewContainerRef. When that happens, an additional wrapper is introduced that needs to be accounted for when traversing the tree.

Fixes #62047.

…jects ViewContainerRef

Fixes that `getDeferBlocks` wasn't accounting for the case where a component might be injecting `ViewContainerRef`. When that happens, an additional wrapper is introduced that needs to be accounted for when traversing the tree.

Fixes angular#62047.
@crisbeto
crisbeto requested a review from AndrewKushnir June 20, 2025 07:30
@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 20, 2025
@angular-robot angular-robot Bot added the area: core Issues related to the framework runtime label Jun 20, 2025
@ngbot ngbot Bot added this to the Backlog milestone Jun 20, 2025
getDeferBlocks(lContainer[HOST], deferBlocks);
}

for (let j = CONTAINER_HEADER_OFFSET; j < lContainer.length; j++) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This change is unrelated. I just renamed the i, because it was shadowing the i from the outer loop.

@AndrewKushnir AndrewKushnir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix @crisbeto 👍

@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 20, 2025
@AndrewKushnir

Copy link
Copy Markdown
Contributor

(FYI, leaving it in the merge queue until Monday, since that might affect testing in g3 and may require attention/rollback)

@crisbeto

Copy link
Copy Markdown
Member Author

This PR was merged into the repository by commit 3eee19d.

The changes were merged into the following branches: main, 20.0.x

@crisbeto crisbeto closed this in 3eee19d Jun 23, 2025
crisbeto added a commit that referenced this pull request Jun 23, 2025
…jects ViewContainerRef (#62156)

Fixes that `getDeferBlocks` wasn't accounting for the case where a component might be injecting `ViewContainerRef`. When that happens, an additional wrapper is introduced that needs to be accounted for when traversing the tree.

Fixes #62047.

PR Close #62156
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Jul 24, 2025
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: 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.

fixture.getDeferBlocks() returns empty array

2 participants