-
Notifications
You must be signed in to change notification settings - Fork 121
Description
In #835 we disabled the deduplication of loadSubset calls inside the query collection because there were some problems with garbage collection of queries which would lead to deduplicated queries to use stale data from the local collection (because the query they depend on was the one loading updates from the backend but is now GCed).
However, we do need to optimize the query collection such that we do not fetch data we already have locally and integrate it smartly with GC such that we detect when data becomes stale and needs to be fetched from the backend. The main problem came from the fact that we did reference counting on a per-row basis, we're thinking that it would be more maintainable on a per-query basis, i.e. if query 1 loads some data and query 2 is deduplicated because of query 1, then query 1's ref count is essentially 2 (meaning that it can only be GCed after query 2 has been GCed).