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

Error message on empty response "request for a undefined with id" typeClassKey? #4217

Closed
erkie opened this issue Mar 7, 2016 · 2 comments
Closed

Comments

@erkie
Copy link

erkie commented Mar 7, 2016

The following asserts resolve to weird error messages because the property typeClassKey is undefined on the typeClass variables. I searched the entire ember-data repo and the ember core repo for the string typeClassKey but couldn't find anything. So I'm not really sure what it should be...

https://github.com/emberjs/data/blob/master/addon/-private/system/store/finders.js#L37
https://github.com/emberjs/data/blob/master/addon/-private/system/store/finders.js#L148
https://github.com/emberjs/data/blob/master/addon/-private/system/store/finders.js#L195
https://github.com/emberjs/data/blob/master/addon/-private/system/store/finders.js#L70

@pangratz
Copy link
Member

pangratz commented Mar 9, 2016

Nice find @erkie! It looks like this hasn't been caught by existing tests for this. Also, this is a good chance to clean up that code a bit. Would you be interested in helping out?

As a first step we should update the existing tests so the expected assertion messages are checked. I would suggest to update the regex in this line to something like /You made a findRecord request for person with id the-id but the adapter's response did not have any data/. This test should be failing now. As next the assertion message needs to be updated accordingly here, where the type of the model can be get via typeClass.modelName (this has been changed sometimes in the past and not been updated here). The tests should be passing again.

I haven't looked for the other assertions you pointed out, but I hope that there are also tests for this. So they should be updated accordingly.

Let me know of you are interested in helping out and if you need help somewhere. I think this is an ideal chance to update CONTRIBUTING.md if there are any obscurities.

Thanks!

@bmac
Copy link
Member

bmac commented Mar 28, 2016

Fixed via #4276

@bmac bmac closed this as completed Mar 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants