hyperhyperspace / hyperhyperspace-core

A library to create p2p applications, using the browser as a full peer.
https://www.hyperhyperspace.org
MIT License
195 stars 12 forks source link

Add support for marking some prevOps as obsolete #29

Open sbazerque opened 1 year ago

sbazerque commented 1 year ago

Right now it is not possible to indicate that some mutation operations can safely be ignored. I'd like to add another special field to MutationOp that is similar to prevOps but, instead of indicating that this op comes after some others, it indicates that such previous ops are obsolete and that they should not be fetched.

The sync agent should take this field into consideration when backtracking from the current state, and don't ask for ops that have been obsoleted.

Since in the most common case this cannot be done without breaking BFT, try to do it in a way that doesn't impose the burden of checking that there is no op-obsolescence on all the types that don't support it (maybe a parameter passed to MutableObject's constructor enabling obsolescence?).