From 9f0c7ca25a23fa0decd5338679f95176c182932c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Youn=20M=C3=A9lois?= Date: Tue, 10 Mar 2026 18:55:38 +0100 Subject: [PATCH] appview/strings: delete PDS record when deleting a string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Orphaned `sh.tangled.string` records on users' PDSs cannot be cleaned up by the appview and they would need to be removed manually by each user. Signed-off-by: Youn Mélois --- appview/strings/strings.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/appview/strings/strings.go b/appview/strings/strings.go index 0a9c2692..cdbb93a8 100644 --- a/appview/strings/strings.go +++ b/appview/strings/strings.go @@ -407,6 +407,22 @@ func (s *Strings) delete(w http.ResponseWriter, r *http.Request) { return } + client, err := s.OAuth.AuthorizedClient(r) + if err != nil { + fail("Failed to authorize client.", err) + return + } + + _, err = comatproto.RepoDeleteRecord(r.Context(), client, &comatproto.RepoDeleteRecord_Input{ + Collection: tangled.StringNSID, + Repo: user.Active.Did, + Rkey: rkey, + }) + if err != nil { + fail("Failed to delete string record from PDS.", err) + return + } + if err := db.DeleteString( s.Db, orm.FilterEq("did", user.Active.Did), -- 2.51.2