- Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
When loading relations (I have been using belongsTo relations mostly), js-data-adapter
does not check for empty or duplicate keys before calling findAll
(example for belongsTo: https://github.com/js-data/js-data-adapter/blob/release/src/index.js#L817).
This results in cases where:
- The
findAll
function is called with an emptywhere.in
array - The
findAll
function is called with duplicates in thewhere.in
array
These two cases are -at best- very inefficient or problematic depending on the actual adapter being used and the endpoints (ex: the js-data-http
might fail because an API is not expecting an empty in
clause or duplicated).
I have my own adapter that extends js-data-adapter
so I have played with fixes and simply filtering out duplicates or not calling findAll
if keys is empty works well.
I can work on a PR if you would accept it.
crobinson42
Metadata
Metadata
Assignees
Labels
No labels