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

fromFetch will not abort fetch request and trigger finalize operator when built in Mac or Linux (WSL in Win10) #4820

Closed
kambing86 opened this issue May 30, 2019 · 2 comments

Comments

@kambing86
Copy link
Contributor

kambing86 commented May 30, 2019

Bug Report

Current Behavior
fromFetch is not able to abort the fetch request for subscription1, check the Network tab in Chrome's Developer Tool

another bug is the finalize operator will not be triggered for subscription2 when it's aborted

it only happens when built in Mac / WSL in Win 10
but it is running totally fine in codesandbox

Reproduction
clone github repo, and run yarn && yarn start
https://github.com/kambing86/npm-explorer/tree/feat/use-fromFetch
https://github.com/kambing86/test-from-fetch

but it is running totally fine in
https://codesandbox.io/s/github/kambing86/npm-explorer/tree/feat/use-fromFetch
https://codesandbox.io/embed/test-fromfetch-3x463
https://codesandbox.io/s/github/kambing86/test-from-fetch

Expected behavior
When unsubscribe is called, the fromFetch should abort the fetch if it is not resolved, finalize operator should be triggered

Environment

  • Runtime: Node 10 / 12, Chrome 74
  • RxJS version: 6.5.2
  • (If bug is related) Loader, build configuration: create-react-app
  • built in macOS High Sierra / WSL in Windows10

Additional context/Screenshots
check the captured video here
https://youtu.be/ZaMm_n1K4Y8
https://youtu.be/PYt3MJ_tBNQ
https://youtu.be/CdqvooTDC0g

edit: use simpler repo to reproduce, will only happen if it's used in mergeMap operator

edit 27/6/2019: uploaded new video, localhost built in windows using node v10.16.0

edit 28/8/2019: added finalize operator and found a new bug

edit 3/9/2019: if I changed to use

import { fromFetch } from "rxjs/_esm5/fetch";

then everything works fine

@kambing86
Copy link
Contributor Author

previous discussion in #4744

@kambing86 kambing86 changed the title fromFetch will not abort response correctly when built in Mac or Linux (WSL in Win10) fromFetch will not abort fetch request and trigger finalize operator when built in Mac or Linux (WSL in Win10) Aug 28, 2019
@kambing86
Copy link
Contributor Author

should be fixed by this PR #5001

@lock lock bot locked as resolved and limited conversation to collaborators Oct 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant