automerge / automerge-repo-rs

MIT License
39 stars 6 forks source link

Currently unidentified bug in fs_store.rs::compact that results in data loss. #52

Open issackelly opened 1 year ago

issackelly commented 1 year ago

Occasionally, if i make a few dozen changes to my document... this branch is called:

https://github.com/automerge/spanreed/commit/84ad6cf54c667f17d976c837f95e22fb98d3986b#diff-05a5db13701065ba8c66d1545cd83b1ba2b610cd217f6ecf94b6fda757864f28R183-R186

I haven't yet identified why.

issackelly commented 1 year ago

In repo.rs compaction is an optional step that occurs at time of save. and in fs_store.rs compaction is a step that happens independent of what is going on.

I think in alex's implementation it assumes that the live path will only ever run append and something else will run compact (but never incremental).

The InMemoryStore tells a very different story, and it is replacing the contents.

This commit rectifies that I think 9fdc4cd8b9396164c1c684fdb6f178fce98e4de4

gterzian commented 1 year ago

cc @alexjg