-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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(core): attempt to recover from user errors during creation #36381
Conversation
e10a3b5
to
526ff89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - but only for the unrelated size change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this problem and creating a test case for it (which was tricky)! 👍
The changes LGTM (with a couple nits), but I think it'd be great if @pkozlowski-opensource can have a look at this change as well, so I'm adding him as a reviewer to this PR.
Thank you.
526ff89
to
113648d
Compare
I've addressed the feedback @AndrewKushnir. Also sorry for the larger diff, |
113648d
to
3113e17
Compare
3113e17
to
cedc991
Compare
This is ready for review again. Also thanks @pkozlowski-opensource for the help with the test cases. |
* Indicates that there was an error before we managed to complete the first create pass of the | ||
* view. This means that the view is likely corrupted and we should try to recover it. | ||
*/ | ||
incompleteFirstPass: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of potentially making this a counter so that we can stop trying after a certain number of attempts. I decided to keep it simple for now, but I'm open to changing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, I think that keeping it simple for now is the way to go 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
* Indicates that there was an error before we managed to complete the first create pass of the | ||
* view. This means that the view is likely corrupted and we should try to recover it. | ||
*/ | ||
incompleteFirstPass: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, I think that keeping it simple for now is the way to go 👍
@@ -398,11 +398,11 @@ describe('view insertion', () => { | |||
const fixture = TestBed.createComponent(AppComponent); | |||
fixture.detectChanges(); | |||
|
|||
expect(fixture.debugElement.nativeElement.textContent).toBe('start|test|end'); | |||
expect(fixture.nativeElement.textContent).toBe('start|test|end'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
fixture.componentInstance.insertTpl = true; | ||
fixture.detectChanges(); | ||
expect(fixture.debugElement.nativeElement.textContent).toBe('start|testtest|end'); | ||
expect(fixture.nativeElement.textContent).toBe('start|testtest|end'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@crisbeto could you please rebase this PR? There is no conflict, but the merge script failed since this PR was rebased/created prior to the most recent update of the base SHA in the merge script. Feel free to add "merge" label back once it's done. FYI, g3 presubmit is successful. |
If there's an error during the first creation pass of a `TView`, the data structure may be corrupted which will cause framework assertion failures downstream which can mask the user's error. These changes add a new flag to the `TView` that indicates whether the first creation pass was successful, and if it wasn't we try re-create the `TView`. Fixes angular#31221.
cedc991
to
c497fe1
Compare
Rebased. |
@crisbeto thanks for rebasing! It looks like payload size limit checks failed on CI, could you please have a look when you get a chance? Thank you. |
180df60
to
77c64ee
Compare
Fixed the payload size failures. |
Thanks @crisbeto. I've re-requested review from @IgorMinar to review/approve payload size increase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for size changes (look like accumulation)
@@ -30,7 +30,7 @@ | |||
"master": { | |||
"uncompressed": { | |||
"runtime-es2015": 1485, | |||
"main-es2015": 137320, | |||
"main-es2015": 137897, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is mostly accumulation from other PRs? The change itself doesn't seem to merit this jump in size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Thanks!
If there's an error during the first creation pass of a `TView`, the data structure may be corrupted which will cause framework assertion failures downstream which can mask the user's error. These changes add a new flag to the `TView` that indicates whether the first creation pass was successful, and if it wasn't we try re-create the `TView`. Fixes #31221. PR Close #36381
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
If there's an error during the first creation pass of a
TView
, the data structure may be corrupted which will cause framework assertion failures downstream which can mask the user's error. These changes add a new flag to theTView
that indicates whether the first creation pass was successful, and if it wasn't try re-create theTView
.Fixes #31221.