-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
handleResponse
on the adapter is never called when using fetch and a response with no body
#6851
Comments
I think there's three changes to make and add test coverage for here:
@Gaurav0 mind taking a look? |
I think I encountered a similar issue. When my server returns 401 with an empty body I'm getting "SyntaxError: Unexpected end of JSON input" in the application route error action instead of the 401 error. A change in this file caused the issue: There is a new |
@andreyfel I think that you may be seeing the same bug, but I don't think the PR you linked to is the cause: In my testing, it never made it into the |
@kategengler In my case I've set a breakpoint on the code I was talking about and I could see that it was reached. |
@andreyfel It may be a different bug then, as I did the same for just inside the |
@kategengler can you check if your issue can be reproduced with ED 3.13? |
This should be resolved by #6871 |
Fix can be tested with |
When using
fetch
, a response with a status and an empty body never hitshandleResponse
on the application adapter.If I turn
jquery-integration
back on, such thatuseFetch
is true, then handleResponse is hit, for the same response code and empty body.Jumping through the debugger, I can follow it down to
response.text()
indetermineBodyPromise
, but it never makes it to thethen
on that promise. It seems like there may be a missingcatch
in the chain of promises here https://github.com/emberjs/data/blob/master/packages/adapter/addon/rest.js#L1002Versions
Run the following command and paste the output below:
yarn list ember-source && yarn list ember-cli && yarn list --pattern ember-data
.The text was updated successfully, but these errors were encountered: