-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: leave and drop docs #1589
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, other than the naming of the console command. Especially because it is inconsistent with the naming in client.rs
I adjusted the naming to be Latest commit adds a high-level test and also makes sure that the event subscription streams are properly terminated for removed docs. |
Ok we decided to |
iroh/src/commands/sync.rs
Outdated
Self::Drop { doc } => { | ||
let doc = get_doc(iroh, env, doc).await?; | ||
iroh.docs.drop_doc(doc.id()).await?; | ||
println!("Doc {} has been removed.", fmt_short(doc.id())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about asking for confirmation?
Added a confirmation prompt. |
## Description In `iroh-sync`: * feat: Add `Store::remove_replica` to remove a replica (namespace secret key and all entries) * feat: Adds `closed` atomic bool on `Replica` to ensure no operations can be performed on closed or removed replicas * refactor: To not add yet another `Arc` for the `closed` marker, move all things into `InnerReplica` In `iroh`: * feat: Add `DocDrop` to RPC protocol * rename `StopSync` to `Leave` * feat: Add `doc leave` command to CLI / console. `doc leave` runs `DocStopSync` in the RPC layer (we already had that), * feat: Add `doc drop` command to delete a document ## Notes & open questions Fixes #1497 ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [x] Tests if relevant.
Description
In
iroh-sync
:Store::remove_replica
to remove a replica (namespace secret key and all entries)closed
atomic bool onReplica
to ensure no operations can be performed on closed or removed replicasArc
for theclosed
marker, move all things intoInnerReplica
In
iroh
:DocDrop
to RPC protocolStopSync
toLeave
doc leave
command to CLI / console.doc leave
runsDocStopSync
in the RPC layer (we already had that),doc drop
command to delete a documentNotes & open questions
Fixes #1497
Change checklist