From 7184507be2b769269bd6846ed85e15f021c940b4 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 25 Sep 2025 15:12:52 -0400 Subject: [PATCH] fix: #13667, record to instances:lastSeen instead of domains:lastSeen --- src/activitypub/index.js | 2 +- test/activitypub/analytics.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/activitypub/index.js b/src/activitypub/index.js index 6b51236bfa..459c86c8fe 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -522,7 +522,7 @@ ActivityPub.record = async ({ id, type, actor }) => { await Promise.all([ db.sortedSetAdd(`activities:datetime`, now, id), - db.sortedSetAdd('domains:lastSeen', now, hostname), + ActivityPub.instances.log(hostname), analytics.increment(['activities', `activities:byType:${type}`, `activities:byHost:${hostname}`]), ]); }; diff --git a/test/activitypub/analytics.js b/test/activitypub/analytics.js index 85c8792115..9faf50ddb0 100644 --- a/test/activitypub/analytics.js +++ b/test/activitypub/analytics.js @@ -1,7 +1,7 @@ 'use strict'; -const nconf = require('nconf'); const assert = require('assert'); +const nconf = require('nconf'); const db = require('../../src/database'); const controllers = require('../../src/controllers'); @@ -105,7 +105,7 @@ describe('Analytics', () => { it('should increment the last seen time of that domain', async () => { const id = `https://example.org/activity/${utils.generateUUID()}`; - const before = await db.sortedSetScore('domains:lastSeen', 'example.org'); + const before = await db.sortedSetScore('instances:lastSeen', 'example.org'); await controllers.activitypub.postInbox({ body: { id, @@ -118,7 +118,7 @@ describe('Analytics', () => { }, }, { sendStatus: () => {} }); - const after = await db.sortedSetScore('domains:lastSeen', 'example.org'); + const after = await db.sortedSetScore('instances:lastSeen', 'example.org'); assert(before && after); assert(before < after);