diff options
author | 2023-08-11 15:17:36 +0200 | |
---|---|---|
committer | 2023-08-11 14:17:36 +0100 | |
commit | a1768a83e0b33e58a3aa9cc710896c46a3fed742 (patch) | |
tree | 9584e307e7e559733236b439210c3151353c3a8f /internal/federation | |
parent | [bugfix] Fix using wrong key for clientID during oauth callback (#2101) (diff) | |
download | gotosocial-a1768a83e0b33e58a3aa9cc710896c46a3fed742.tar.xz |
[bugfix] Suppress 'errNoEntries' warnings from InboxForwarding function call (#2102)v0.11.0-rc1
Diffstat (limited to 'internal/federation')
-rw-r--r-- | internal/federation/federatingactor.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/internal/federation/federatingactor.go b/internal/federation/federatingactor.go index 72647040a..942aa8198 100644 --- a/internal/federation/federatingactor.go +++ b/internal/federation/federatingactor.go @@ -27,6 +27,7 @@ import ( "net/url" "strings" + errorsv2 "codeberg.org/gruf/go-errors/v2" "codeberg.org/gruf/go-kv" "github.com/superseriousbusiness/activity/pub" "github.com/superseriousbusiness/activity/streams" @@ -223,14 +224,21 @@ func (f *federatingActor) PostInboxScheme(ctx context.Context, w http.ResponseWr // is in the database. // // Since our `Exists()` function currently *always* - // returns false, it will *always* attempt to insert - // the Activity. Therefore, we ignore AlreadyExists - // errors. + // returns false, it will *always* attempt to parse + // out and insert the Activity, trying to fetch other + // items from the DB in the process, which may or may + // not exist yet. Therefore, we should expect some + // errors coming from this function, and only warn log + // on certain ones. // // This check may be removed when the `Exists()` func // is updated, and/or federating callbacks are handled // properly. - if !errors.Is(err, db.ErrAlreadyExists) { + if !errorsv2.Comparable( + err, + db.ErrAlreadyExists, + db.ErrNoEntries, + ) { // Failed inbox forwarding is not a show-stopper, // and doesn't even necessarily denote a real error. l.Warnf("error calling sideEffectActor.InboxForwarding: %q", err) |