seed-hypermedia / seed

Seed Hypermedia Desktop app
Apache License 2.0
7 stars 1 forks source link

Initial implementation of deletes #45

Closed burdiyan closed 1 day ago

burdiyan commented 1 week ago

This PR implements a new Refs API, which can be (arguably counter-intuitively) used to delete documents.

Notable changes:

  1. CreateRef lets you create a Ref blob for a given account + path. Currently only tombstone targets are implemented.
  2. GetRef lets you get an existing Ref. Not sure why would you want it, but it's there.
  3. GetDocument has a new ignore_deleted flag, which can be used to get the latest version of the document even if it's deleted.
  4. ListDocuments has a new deleted_only flag which lets only list deleted documents in a given account.
  5. Getting documents with exact version works regardless of the deletion.

So, if you'd want to delete a document, you'd create a tombstone Ref. This will make the document disappear from the list request (unless deleted_only is specified). A get request would return an error with FailedPrecondition GRPC error code, unless ignore_deleted flag is specified.

I still need to test if it will let you publish something again on the same path after deletion or not.