Node.js based forum software built for the modern web
fix: #13667, record to instances:lastSeen instead of domains:lastSeen
Julian Lam7184507be2b7
diff --git a/src/activitypub/index.js b/src/activitypub/index.jsindex 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.jsindex 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);