heckj / CRDT

Conflict-free Replicated Data Types in Swift
https://swiftpackageindex.com/heckj/CRDT/main/documentation/crdt
MIT License
145 stars 3 forks source link

support retaining the full history for LWWRegister, ORMap, and ORSet #37

Open heckj opened 1 year ago

heckj commented 1 year ago

Currently, the history is optimized out and dropped on delta updates (or more specifically, generating a delta for these types only includes the most recent value - not all the possible changes that have happened since a previous update).

However, if you want to be able to view the state of the CRDT at any arbitrary point in its history, then that additional detail becomes worth maintaining, even thought the overall CRDT size can become notably larger.

The current logic would require a few updates to maintain this history, but it should be pretty directly doable as an initialization option.