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

FixtureAdapter.find() returns undefined when model not found #1813

Closed
orospakr opened this issue Mar 16, 2014 · 5 comments
Closed

FixtureAdapter.find() returns undefined when model not found #1813

orospakr opened this issue Mar 16, 2014 · 5 comments

Comments

@orospakr
Copy link

Rather than throwing the appropriate model not found exception in the event of a request for a non-extant id, FixtureAdapter returns undefined which breaks an assertion in Store._find(), which is unhandleable and breaks the whole app.

This is with ember-data 1.0.0beta7. I'm using EAK if that matters.

Assertion Failed: You made a request for a mymodel with id fixture-78, but the adapter's response did not have any data
@igorT
Copy link
Member

igorT commented May 28, 2014

Seems related to #1767

@wecc
Copy link
Contributor

wecc commented Nov 16, 2014

It seems that there's no code path in FixtureAdapter.find() that will reject the find and because of that the "normal" not found behavior is never reached.

@xcambar
Copy link

xcambar commented Nov 16, 2014

I have a tailored FixtureAdapter which calls an overridable fixtureNotFound method (see https://github.com/xcambar/data/blob/extendable_fixture_adapter/packages/ember-data/lib/adapters/fixture_adapter.js#L176-L199)

Would you be interested in a minimal PR implementing this, with fixtureNotFound defaulting to a rejection?

@wecc
Copy link
Contributor

wecc commented Nov 16, 2014

I think it would suffice to return Ember.RSVP.reject() to get the same behavior as with the RESTAdapter?

@wecc
Copy link
Contributor

wecc commented May 24, 2015

The FixtureAdapter has been deprecated (#3091) and is no longer included in Ember Data by default.

The code for FixtureAdapter has been moved to emberjs/ember-data-fixture-adapter, please re-open in that repo if this is still an issue.

@wecc wecc closed this as completed May 24, 2015
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

4 participants