diff --git a/internal/federation/federatingdb/create.go b/internal/federation/federatingdb/create.go index cdd725c05..11030b16b 100644 --- a/internal/federation/federatingdb/create.go +++ b/internal/federation/federatingdb/create.go @@ -65,7 +65,7 @@ func (f *federatingDB) Create(ctx context.Context, asType vocab.Type) error { // Cache entry for this create activity ID for later // checks in the Exist() function if we see it again. - f.createdIDs.Set(ap.GetJSONLDId(asType).String(), struct{}{}) + f.activityIDs.Set(ap.GetJSONLDId(asType).String(), struct{}{}) switch name := asType.GetTypeName(); name { case ap.ActivityBlock: diff --git a/internal/federation/federatingdb/db.go b/internal/federation/federatingdb/db.go index 300f48c56..cd5110923 100644 --- a/internal/federation/federatingdb/db.go +++ b/internal/federation/federatingdb/db.go @@ -65,7 +65,7 @@ type federatingDB struct { // tracks Activity IDs we have handled creates for, // for use in the Exists() function during forwarding. - createdIDs simple.Cache[string, struct{}] + activityIDs simple.Cache[string, struct{}] } // New returns a DB that satisfies the pub.Database @@ -84,6 +84,6 @@ func New( intFilter: intFilter, spamFilter: spamFilter, } - fdb.createdIDs.Init(0, 1000) + fdb.activityIDs.Init(0, 1000) return &fdb } diff --git a/internal/federation/federatingdb/exists.go b/internal/federation/federatingdb/exists.go index c707baa54..ec996f72f 100644 --- a/internal/federation/federatingdb/exists.go +++ b/internal/federation/federatingdb/exists.go @@ -25,5 +25,5 @@ import ( // Exists is an implementation of pub.Database{}.Exists(), optimized specifically for // the only usecase in which go-fed/activity/pub actually calls it. Do not use otherwise! func (f *federatingDB) Exists(ctx context.Context, id *url.URL) (exists bool, err error) { - return f.createdIDs.Has(id.String()), nil + return f.activityIDs.Has(id.String()), nil }