-
Notifications
You must be signed in to change notification settings - Fork 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
fromFetch throws AbortError #4739
Comments
@cartant how does this happen? Shouldn't the AbortError be ignored if the Observable unsubscribed? |
It aborts the promise returned by |
So in that code sample provided in the issue description, why would that matter? |
Try the StackBlitz and you'll see. Sometimes it works and sometimes it fails. Bottom line is that |
* test(fetch): test expectations after complete * fix(fromFetch): don't abort if fetch resolves Closes ReactiveX#4739
Bug Report
Current Behavior
fromFetch
seems to fail withAbortError
when I would expect it to succeed.Reproduction
Here's an example using fromFetch(...) and from(fetch(...)) that I would expect to have the same result.
This code throws an AbortError:
Expected behavior
The snippit above should complete and log the response to the console.
Environment
Possible Solution
In the definition of
fromFetch()
, don't callcontroller.abort()
if it has already emitted a value. Perhaps set a flag (reuse/rename theunsubscribed
flag) before callingsubscriber.next
.The text was updated successfully, but these errors were encountered: