ember-ajax icon indicating copy to clipboard operation
ember-ajax copied to clipboard

Ember Data Mixin Breaks Adapter Level Error Handling

Open jherdman opened this issue 8 years ago • 3 comments

In investigating how our Ember Data mixin works with a few of our apps at Precision Nutrition, I noticed that adapter level error handling is circumvented. This breaks applications by changing the expected shape of API errors.

jherdman avatar Jan 16 '17 01:01 jherdman

I'm a bit stumped on how best to actually implement a test for this. The acceptance test that exists for testing the ember-data integration doesn't allow (non-hacky) access to the actual model object, and I haven't quite figured out how to import everything necessary to make ED's store work in an integration test. Welp!

Ideally I'd like to be able to call store.findRecord directly and inspect the contents after success/failure to make sure everything's kosher, but that's an unusually difficult nut to crack. Anyone have any insight, by chance?

XaserAcheron avatar Jan 19 '17 22:01 XaserAcheron

I suppose we could set up an acceptance test scenario wherein a model has an active-model-adapter, and we look to see that the output from an error request aligns with what we expect.

jherdman avatar Jan 20 '17 13:01 jherdman

Not sure if this is related but I ran into a situation where the handleResponse of the underlying DS.JSONAPIAdaptor is being overriden and super is not called. It is causing problems with ember-simple-auth that relies on the adapter's handleResponse to detect whether a request failed with 401.

Is there a work around while some work is being done on this?

sumeetattree avatar Apr 16 '19 15:04 sumeetattree