diff options
author | 2023-06-22 20:46:36 +0100 | |
---|---|---|
committer | 2023-06-22 20:46:36 +0100 | |
commit | 9a22102fa8b1ce47571d5bba71e8f36895d21bf0 (patch) | |
tree | 3c2af6db0a3905d31243cd840d1dd50bea59dbb0 /internal/federation/dereferencing/thread.go | |
parent | [docs] Clarify email requirement for OIDC (#1918) (diff) | |
download | gotosocial-9a22102fa8b1ce47571d5bba71e8f36895d21bf0.tar.xz |
[bugfix/chore] oauth entropy fix + media cleanup tasks rewrite (#1853)
Diffstat (limited to 'internal/federation/dereferencing/thread.go')
-rw-r--r-- | internal/federation/dereferencing/thread.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/internal/federation/dereferencing/thread.go b/internal/federation/dereferencing/thread.go index ec22c66a8..a12e537bc 100644 --- a/internal/federation/dereferencing/thread.go +++ b/internal/federation/dereferencing/thread.go @@ -279,13 +279,21 @@ stackLoop: // Get the current page's "next" property pageNext := current.page.GetActivityStreamsNext() - if pageNext == nil { + if pageNext == nil || !pageNext.IsIRI() { continue stackLoop } - // Get the "next" page property IRI + // Get the IRI of the "next" property. pageNextIRI := pageNext.GetIRI() - if pageNextIRI == nil { + + // Ensure this isn't a self-referencing page... + // We don't need to store / check against a map of IRIs + // as our getStatusByIRI() function above prevents iter'ing + // over statuses that have been dereferenced recently, due to + // the `fetched_at` field preventing frequent refetches. + if id := current.page.GetJSONLDId(); id != nil && + pageNextIRI.String() == id.Get().String() { + log.Warnf(ctx, "self referencing collection page: %s", pageNextIRI) continue stackLoop } |