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(core): Add alternative rethrow method by wrapping yield #3063

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Mar 16, 2023

Related #2191

Summary

Originally, we introduced a check called hasResult, which determined whether we'd rethrow an error, or treat it as a network error.
This check must now be changed to further isolate the non-network errors to the yield operation in our response streams. Specifically, when yielding, the resulting error may come from downstream exchanges, bindings, or the UI framework.

We now detect this differently by wrapping the yield in a boolean flag.

Another thing I've noticed is that Safari doesn't seem to notice broken response streams. While any other browser seems to throw a TypeError, for some reason Safari seems particularly unbothered and simply waits infinitely. It's possible there's a rather long timeout in its fetch logic, but I'll have to test this further as well.

Set of changes

  • Replace rethrow check with boolean flag checking whether we're yielding to downstream code

@kitten kitten merged commit 33d64b0 into main Mar 16, 2023
@kitten kitten deleted the fix/catch-stream-errors branch March 16, 2023 14:01
This was referenced Mar 16, 2023
@github-actions github-actions bot mentioned this pull request Mar 27, 2023
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.

2 participants