summaryrefslogtreecommitdiff
path: root/internal/federation/federatingprotocol.go
diff options
context:
space:
mode:
authorLibravatar Sam Lade <sam@sentynel.com>2023-02-15 19:41:16 +0000
committerLibravatar GitHub <noreply@github.com>2023-02-15 19:41:16 +0000
commit40b584c21955341c6f6ae76a172e14ce8c18e490 (patch)
tree821972707c8febae9cc066c94828cb807cdc057e /internal/federation/federatingprotocol.go
parentuse woff(2) fonts for Noto Sans (#1509) (diff)
downloadgotosocial-40b584c21955341c6f6ae76a172e14ce8c18e490.tar.xz
Fix 410 Gone race on account deletes (#1507)
Diffstat (limited to 'internal/federation/federatingprotocol.go')
-rw-r--r--internal/federation/federatingprotocol.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/federation/federatingprotocol.go b/internal/federation/federatingprotocol.go
index 90a2c50b2..d75570dd6 100644
--- a/internal/federation/federatingprotocol.go
+++ b/internal/federation/federatingprotocol.go
@@ -209,6 +209,16 @@ func (f *federator) AuthenticatePostInbox(ctx context.Context, w http.ResponseWr
transport.WithFastfail(ctx), username, publicKeyOwnerURI, false,
)
if err != nil {
+ if errors.Is(err, transport.ErrGone) {
+ // This is the same case as the http.StatusGone check above.
+ // It can happen here and not there because there's a race
+ // where the sending server starts sending account deletion
+ // notifications out, we start processing, the request above
+ // succeeds, and *then* the profile is removed and starts
+ // returning 410 Gone, at which point _this_ request fails.
+ w.WriteHeader(http.StatusAccepted)
+ return ctx, false, nil
+ }
return nil, false, fmt.Errorf("couldn't get requesting account %s: %s", publicKeyOwnerURI, err)
}