NerdWalletOSS / apollo-cache-policies

An extension of the Apollo 3 cache with support for advanced cache policies.
Apache License 2.0
152 stars 22 forks source link

fix bug with duplicate collection references #76

Closed danReynolds closed 11 months ago

danReynolds commented 11 months ago

There was a bug where if you evict data, its reference in it's collection entity list is duplicated when it is later written back into the cache. This is because eviction doesn't eagerly remove the reference and the updating of the collection list wasn't filtering out entities that already exist in the list.

In this change, we update the collection list merge function to remove duplicates.