diff --git a/pkg/appview/handlers/images.go b/pkg/appview/handlers/images.go index 7b6f1a5..9fb766f 100644 --- a/pkg/appview/handlers/images.go +++ b/pkg/appview/handlers/images.go @@ -178,8 +178,11 @@ func (h *DeleteManifestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request // Delete each tag from PDS and database for _, tag := range tags { - // Delete from PDS - tagRKey := fmt.Sprintf("%s:%s", repo, tag) + // Delete from PDS. Must go through RepositoryTagToRKey: the write + // path encodes repository slashes as "~", so hand-building the + // rkey here targets a record that doesn't exist (a silent no-op, + // since deleteRecord is idempotent) for any repo with a "/" in it. + tagRKey := atproto.RepositoryTagToRKey(repo, tag) if err := pdsClient.DeleteRecord(r.Context(), atproto.TagCollection, tagRKey); err != nil { // Check if OAuth error - if so, invalidate sessions and return 401 if handleOAuthError(r.Context(), h.Refresher, user.DID, err) {