NerdWalletOSS / apollo-cache-policies

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

fix bug with duplicate collection references #76

Closed danReynolds closed 1 year ago

danReynolds commented 1 year 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.