fireproof-storage / fireproof

Realtime database, runs anywhere. Install Fireproof in your front-end app or edge function, and sync data via any backend.
https://fireproof.storage
Other
219 stars 16 forks source link

undo feature #92

Open jchris opened 4 months ago

jchris commented 4 months ago

it should be simple to broadcast writes that undo the previous history, while still being append only in the crdt log

jchris commented 4 months ago

from discord:

I think both of those boil down to appending a bulk op to the database that reverts any changes in the undo history region. I think a classic undo button that supports multiple undo would be easy enough to write, it could just work its way back the crdt history and send changes that take each doc back to the previous version. The versions are tracked by CID so this maintains the provability of the pre-undo write. undo and redo type exploration would append a lot to the history but still have the right user experience

jchris commented 4 months ago

feature request use case description:

I'm prototyping a collaborative level editor type thing for a game.

we have two use cases:

a shared undo type thing: As a member of a group making changes to a 3D environment, I want to revert some changes one/all of the others has made
while optimistically calculating results of some game logic I want to backtrack because the optimistic results turned out to be wrong

The first use case is the main one ... the second is a variation of common game networking, only over a much longer timeframe ...and is probably out of scope for fireproof, but feels so close that it's worth noting