From 29d481d76912a8b0de0eebc41e2d8bed5b17c535 Mon Sep 17 00:00:00 2001 From: nicole mikołajczyk Date: Thu, 19 Jun 2025 10:21:03 +0200 Subject: [bugfix] delete interaction requests when deleting account (#4278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk # Description I recently noticed that pending interaction requests don't disappear on domain suspension. ## Checklist - [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md). - [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat. - [x] I/we have not leveraged AI to create the proposed changes. - [x] I/we have performed a self-review of added code. - [x] I/we have written code that is legible and maintainable by others. - [x] I/we have commented the added code, particularly in hard-to-understand areas. - [ ] I/we have made any necessary changes to documentation. - [ ] I/we have added tests that cover new code. - [x] I/we have run tests and they pass locally with the changes. - [x] I/we have run `go fmt ./...` and `golangci-lint run`. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4278 Co-authored-by: nicole mikołajczyk Co-committed-by: nicole mikołajczyk --- internal/db/interaction.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal/db/interaction.go') diff --git a/internal/db/interaction.go b/internal/db/interaction.go index 4e58e1db3..4a6ec7e2e 100644 --- a/internal/db/interaction.go +++ b/internal/db/interaction.go @@ -47,6 +47,10 @@ type Interaction interface { // DeleteInteractionRequestByID deletes one request with the given ID. DeleteInteractionRequestByID(ctx context.Context, id string) error + // DeleteInteractionRequestsByInteractingAccountID deletes all requests + // originating from the given account ID. + DeleteInteractionRequestsByInteractingAccountID(ctx context.Context, accountID string) error + // GetInteractionsRequestsForAcct returns pending interactions targeting // the given (optional) account ID and the given (optional) status ID. // -- cgit v1.2.3