bug: appview/repo: deleting a repo is not consistent

did:plc:a27wdjlmq3ebx4v5f2jpzvsk opened this 9d ago 2 comments
did:plc:a27wdjlmq3ebx4v5f2jpzvsk opened 9d ago

When deleting a repo, there seem to have 3 steps :

  • deleting the AT Protocol record (a delete record send to the PDS)
  • deleting the repository from the knot (with a RPC call)
  • deleting the repository from the database in the app view (done in a transaction)

If one of the steps fails, the repository is not deleted from the database, and is keeped in a dangling state.

Further tries to delete the repository will end with a "Failed to delete repository from PDS" message because the record is already deleted or with a "xrpc request failed".

I'm not a go developer, but this seems to be related to this Go function : https://tangled.org/tangled.org/core/blob/master/appview/repo/repo.go#L834

The code returns if one of the first operations fails, so the actual deletion in the AppView database is never reached.

I guess there a some ways to implement it. Maybe the simplest is to make the RepoDeleteRecord and RepoDelete calls idempotent, so they do not throw an error if the repo has already been deleted. That way the code should be able to reach the AppView database part.

No activity yet.

cospan · schematic version control on atproto built on AT Protocol