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

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

Fix issue with reloading array records. #469

Closed deanmarano closed 1 year ago

deanmarano commented 1 year ago

I was looking at getting reloading for fragment arrays working, and I think I stumbled across a bug.

This conditional:

 if ((updates[key] === null) !== (original[key] === null))

it wasn't catching when the array existed and was different, so I added another condition (updates[key] !== original[key]). This updated the _fragmentData properly, but the cache was still being used so updates weren't making it through. I nabbed some code to clear the cache and the test started passing.