-
-
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
store.push throws with JSONAPI document { data: null } #3790
Comments
Agree, we should fix this. |
I was just about to post the same thing. I am glad I have found this first. Just to be sure, JSON API also states that I felt there was something wrong when I saw the error mentioned by @mitchlloyd, although I am not certain about how this case should be handled. @wecc, could you please explain how the fix should behave? I am guessing that the appropriate callback will be |
Any idea when this fix will make it into a release? |
@Ramblurr this should be fixed in |
I think there may be a regression in 2.4.0 with respect to behaviour described in this pull request. I have a model hook like this in an acceptance test: return this.store.queryRecord('some-model', { limit: 1 }); Whereas this model hook works with Ember Data 2.3.3, the same test now fails with 2.4.0. I'll see if I can put together a reproduction mini app today. |
What does the server response look like for this query? |
Like this: { "plural_model_name": [] } |
Apologies for the delay, but I have a reproduction available now.
The repo lives here: https://github.com/jherdman/issue-3790-reproduction. Run the app, hit the index page in your browser. Note the Ember Data 2.4 complains about the empty response, whereas 2.3.3 does not. |
Hey friends. Should I open a brand new ticket for this? |
Yes please. |
The JSONAPI spec indicates that the following payload is a valid response when asking for a has-one relationship from a server:
However, when that normalized response makes it to
store.push
, ED throws the following error:It should be simple to add a failing test case for this in
store-test.js
but I'm getting timeout errors when trying to install the ED dependencies at the moment.The text was updated successfully, but these errors were encountered: