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(component): fixes recursive rendering #3255

Merged
merged 3 commits into from
Dec 6, 2021

Conversation

e-davidson
Copy link
Contributor

Handles edge case where rendering causes the observable to emit which causes
ASSERTION ERROR: Reached the max number of directives [Expected=> 1 != 1 <=Actual]

Change the logic to set embeddedViewCreated before calling createEmbeddedView, so if ensureEmbeddedViewCreated is called recursively it won't call createEmbeddedView a 2nd time. Also, we're calling ensureEmbeddedViewCreated after we setup the view context because if it gets called recursively the previous call stack will override the later value.

PR Checklist

Please check if your PR fulfills the following requirements:

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
[ ] Other... Please describe:

What is the current behavior?

Closes #3246

Does this PR introduce a breaking change?

[ ] Yes
[x] No

handles edge case where rendering causes the observable to emit which causes
`ASSERTION ERROR: Reached the max number of directives [Expected=> 1 != 1 <=Actual]`

Closes issue ngrx#3246
modules/component/src/let/let.directive.ts Outdated Show resolved Hide resolved
modules/component/src/let/let.directive.ts Outdated Show resolved Hide resolved
e-davidson and others added 2 commits November 29, 2021 10:19
Co-authored-by: Marko Stanimirović <markostanimirovic95@gmail.com>
Copy link
Member

@markostanimirovic markostanimirovic left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thanks @e-davidson!

@timdeschryver
Copy link
Member

I'm going to trigger the CI by closing and reopening this PR..

@ngrxbot
Copy link
Collaborator

ngrxbot commented Dec 4, 2021

Preview docs changes for f4763a2 at https://previews.ngrx.io/pr3255-f4763a27/

@timdeschryver timdeschryver merged commit d24dde1 into ngrx:master Dec 6, 2021
@timdeschryver
Copy link
Member

Thanks @e-davidson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

*ngrxLet causes ASSERTION ERROR: Reached the max number of directives [Expected=> 1 != 1 <=Actual]
4 participants