summaryrefslogtreecommitdiff
path: root/internal/federation/dereferencing/thread.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/federation/dereferencing/thread.go')
-rw-r--r--internal/federation/dereferencing/thread.go14
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
}