Closed klausi closed 5 days ago
Cid is only a hash value of the content of records and should not be related to rkey
.
If you want to delete a record using delete_record
, I think you should store the rkey
obtained by parsing the uri
, not the cid
of the post.
For example, in bsky-sdk
, this is how I get the rkey from at-uri and delete it.
https://github.com/sugyan/atrium/blob/main/bsky-sdk/src/record/agent.rs#L82
By the way, atrium_api::types::string::Cid
is a wrapper for ipld_core::cid::Cid
and you can get ipld_core::cid::Cid
with as_ref()
. This one has a string representation, so I guess we can use that.
Thanks a lot, did not realize that the URI is the ID of the post.
agent.delete_record()
is a exactly what I need when I store URIs, so I don't have to deal with Cid at all.
Hi,
I'm writing a tool to delete old Bluesky posts, code is at https://github.com/klausi/mastodon-bluesky-sync/blob/bluesky_delete_posts/src/delete_posts.rs (currently does not compile).
I fetch the users posts and save the Cids to delete them later:
Then I try to delete them later:
Compilation error:
How can I convert a
Cid
into aString
that is acceptable as rkey when deleting posts?Why is a string representation missing for
Cid
? Would be super useful when printing out messages to not rely on the debug representation.Thanks!