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 empty where.in array
- The
findAll function is called with duplicates in the where.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.
When loading relations (I have been using belongsTo relations mostly),
js-data-adapterdoes not check for empty or duplicate keys before callingfindAll(example for belongsTo: https://github.com/js-data/js-data-adapter/blob/release/src/index.js#L817).This results in cases where:
findAllfunction is called with an emptywhere.inarrayfindAllfunction is called with duplicates in thewhere.inarrayThese two cases are -at best- very inefficient or problematic depending on the actual adapter being used and the endpoints (ex: the
js-data-httpmight fail because an API is not expecting an emptyinclause or duplicated).I have my own adapter that extends
js-data-adapterso I have played with fixes and simply filtering out duplicates or not callingfindAllif keys is empty works well.I can work on a PR if you would accept it.