earthstar-project / willow-js

A Willow Data Model, Sideloading, and General Purpose Sync protocol implementation in TypeScript.
https://willowprotocol.org
GNU Lesser General Public License v3.0
45 stars 3 forks source link

Extract Inverted-Range Logic from the SummarisableStorage interface #16

Closed AljoschaMeyer closed 4 months ago

AljoschaMeyer commented 5 months ago

For replication reasons, implementations of the SummarisableStorage interface need to handle ranges whose end is less than their start by treating the order of keys as cyclic. This leads to duplicated logic across different implementations. It might be nicer to require the methods of SummarisableStorage to be invoked with well-formed ranges (start <= end) only, and add a set of conversion functions from weird ranges to pairs of well-formed ranges.

AljoschaMeyer commented 4 months ago

Turns out thisbehavior is a relic of old earthstar sync and will not be needed for Willow at all. I'll delete this logic.