-
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
fix(ajax): Only set timeout & responseType if request is asynchronous #2486
Conversation
LGTM, missing an update in a test though shouldnt there be a spec/observables/dom/ajax-spec.ts that needs this case added and asserted? |
Edit: I'm an idiot and didn't rebuild the project code after adding my |
look, I'm not deciding anything here, at all. If it was me maintaining something as big as Rxjs I would want to have a test that proves a bug exist. A fix made and a test that shows the bug no longer exist. If it is possible. If really hard to test then maybe some example runs showing the bug seems resolved. For example used to be : "some code" is now : "some code". So if its hard or impossible to test I would just amend the description with a code snippet where it works.. You already added a jsFiddle which is good |
Added two tests: one for asynchronous, one for synchronous. It required changing the Hopefully that provides enough coverage for this issue. It doesn't show a good before/after shot of it working vs not working (the jsFiddle will have to suffice for the "not working" part) but hopefully it helps prevent future regressions. |
Anything I can do to help this issue get merged? A project I'm working on requires sync requests in one scenario (iOS Safari) and we cannot use it there because of this issue. I'm happy to help however I can to make sure it's included in a future release. |
At what state about this issue? Can we merge jkrehm's pr? |
Thanks @jkrehm |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
Setting
async: false
in the call toObservable.ajax
results in an error:You can observe the behavior here: https://jsfiddle.net/jkrehm/k4o9do0q/1/
My solution is simply to wrap the code that sets
timeout
andresponseType
(also a problem) in an if-statement so they're only set ifasync: true
(the default).