adopted-ember-addons / ember-data-model-fragments

Ember Data addon to support nested JSON documents
MIT License
370 stars 114 forks source link

Fragment array merging issue when array content is not in the same order as server's response (5.0.0-beta.0) #429

Closed qvu-square-zz closed 2 years ago

qvu-square-zz commented 2 years ago

I found a (potential) issue when updating fragment arrays from server response. I've narrowed it down to this function https://github.com/adopted-ember-addons/ember-data-model-fragments/blob/master/addon/array/fragment.js#L20

where content (from internal memory) and objs (from server response) are not sorted in the same order. I'm not sure if this is a bug or if the intention is that internal fragment array and the server response's array should be kept in the same order at all times.

This is my first time opening an issue, so apologies if it's not up to standards. Please let me know if I can provide more information to help triage.

qvu-square-zz commented 2 years ago

Actually was pointed to this section after opening the issue. https://github.com/adopted-ember-addons/ember-data-model-fragments#conflict-resolution

I'll fix this in our adapter to make sure the response match the internal records. Sorry for the noise!