-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
[compiler][fixtures] Patch error-handling edge case in snap evaluator #31082
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -75,7 +75,7 @@ export const FIXTURE_ENTRYPOINT = { | |||
|
|||
### Eval output | |||
(kind: ok) [[ (exception in render) Error: throw with error! ]] | |||
[[ (exception in render) Error: throw with error! ]] | |||
[2] |
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.
Note that we now correctly do the non-throwing re-render instead of returning a cached error
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.
accepting to unblock but one question
if (this.state.hasError) { | ||
this.setState({hasError: false, error: null}); | ||
if (this.state.errorFromLastRender !== NO_ERROR_SENTINEL) { | ||
// Reschedule a third render that immediately returns the cached error |
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 don't get the comment here, seems backwards since we're clearing errorFromLastRender
? wouldn't this not immediately return the error?
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.
This wouldn't return errorFromLastRender
, but it would find the correct one in this.propsErrorMap
.
I had trouble figuring out another solution to render components exactly once (per entry in sequentialRenders
) and clear the error-state to retry rendering when props change
Definitely not sold that this is the best way writing this and I'm probably missing a common pattern, any suggestions welcome.
Fix edge case in which we incorrectly returned a cached exception instead of trying to rerender with new props. ghstack-source-id: 843fb85df4a2ae7a88f296104fb16b5f9a34c76e Pull Request resolved: #31082
Stack from ghstack (oldest at bottom):
Fix edge case in which we incorrectly returned a cached exception instead of trying to rerender with new props.