Closed jessegrosjean closed 6 months ago
yeah, it's by design - but not specifically well thought out by me, I was replicating what's in JS automerge-repo. Delete marks the item locally as deleted, with the concept being that others might have replicas and try to continue to sync, and we don't want to just "reload" on sync when we've deleted it.
The (perhaps poor) conceit/conception is that all documents are always in the repo, and you control the sharing by allowing or disallowing it with the sharing controls (either the static .agreeable
or something you make that provides a choice of "may I share" given an ID and peerID (conforms to ShareAuthorizing)
That said, I think there should be a way for you to ask to "nuke" this ID so that it doesn't exist, or potentially allow a create() to replace it without hitting that error.
Right now this gives me a DuplicateID exception:
This is because after delete repo.handes still contains an internal document handle. I'm not sure if this is by design or not.
I'm running into this problem when I try to build start sharing/stop sharing commands for my document. The general idea is that when I'm sharing my document it should be in the repo, when I'm not it should not be in the repo. I understand that peers might still have a copy even when not sharing.