You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whereas the findAll method does not use the manager.
Failing test case
test("meta is proxied correctly on the PromiseArray",function(assert){letdefered=RSVP.defer();env.registry.register('adapter:person',DS.Adapter.extend({findAll(store,type,query){returndefered.promise;}}));letresult;run(function(){result=store.findAll('person');});assert.notOk(result.get('meta.foo'),'precond: meta is not yet set');run(function(){defered.resolve({data: [],meta: {foo: 'bar'}});});assert.equal(result.get('meta.foo'),'bar');});
That said, it is difficult for us to provide support for meta on the RecordArray returned by findAll for the following reasons:
findAll('foo') returns the same RecordArray as peekAll('foo'). Having meta for an unknown request would be confusing for folks using peekAll.
findAll('foo') may or may not hit network, and may or may not do so as a background request, it is uncertain what meta would refer to in this scenario.
findAll('foo') contains all available records from all requests ever made as well as anything created client side, not just from the single request it may also make itself. It is uncertain how any meta object from a single specific request would be applicable to this array.
The above said, we are committed to building better APIs with first-class json-api support in the near future.
Issue
In 2.18.0,
store.findAll
does not set the meta property on the resolvedRecordArray
.Example
I wasn't sure how best to create a live example of this without a backend, but here's an example:
response:
Cause
The
query
method sets up the RecordArray with a RecordArrayManager which sets themeta
property:https://github.com/emberjs/data/blob/v2.18.0/addon/-private/system/store/finders.js#L166
whereas the
findAll
method does not use the manager.Failing test case
I just copied the one for
query
and replaced it withfindAll
: https://github.com/emberjs/data/blob/v2.18.0/tests/integration/store/query-test.js#L28-L49The text was updated successfully, but these errors were encountered: