earthstar-project / earthstar

Storage for private, distributed, offline-first applications.
https://earthstar-project.org
GNU Lesser General Public License v3.0
632 stars 20 forks source link

Reuse query followers in ReplicaCache #237

Closed sgwilym closed 2 years ago

sgwilym commented 2 years ago

What's the problem you solved?

ReplicaCache was creating a new QueryFollower every time it was queried, even for the same query. It was also referencing the follower before it had been declared.

What solution are you recommending?

If a cached result is found, the existing query follower in the cache entry is used.