From 42ffec1250c9029bcaa9ecdfa8b3864f0901ec1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 9 Sep 2025 12:09:35 -0400 Subject: [PATCH] test: add await to send return promise from ap.send --- src/activitypub/inbox.js | 6 +++--- src/activitypub/index.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.js index 754720f208..5dc584a689 100644 --- a/src/activitypub/inbox.js +++ b/src/activitypub/inbox.js @@ -21,7 +21,7 @@ const helpers = require('./helpers'); const inbox = module.exports; function reject(type, object, target, senderType = 'uid', id = 0) { - activitypub.send(senderType, id, target, { + return activitypub.send(senderType, id, target, { id: `${helpers.resolveActor(senderType, id)}#/activity/reject/${encodeURIComponent(object.id)}`, type: 'Reject', object: { @@ -408,7 +408,7 @@ inbox.follow = async (req) => { await user.setUserField(id, 'followerRemoteCount', followerRemoteCount); await user.onFollow(actor, id); - activitypub.send('uid', id, actor, { + await activitypub.send('uid', id, actor, { id: `${nconf.get('url')}/${type}/${id}#activity/accept:follow/${handle}/${Date.now()}`, type: 'Accept', object: { @@ -435,7 +435,7 @@ inbox.follow = async (req) => { await user.setCategoryWatchState(actor, id, categories.watchStates.tracking); } - activitypub.send('cid', id, actor, { + await activitypub.send('cid', id, actor, { id: `${nconf.get('url')}/${type}/${id}#activity/accept:follow/${handle}/${Date.now()}`, type: 'Accept', object: { diff --git a/src/activitypub/index.js b/src/activitypub/index.js index 11f16322e2..211f1d093f 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -405,7 +405,7 @@ ActivityPub.send = async (type, id, targets, payload) => { }; const oneMinute = 1000 * 60; - batch.processArray(inboxes, async (inboxBatch) => { + return batch.processArray(inboxes, async (inboxBatch) => { const retryQueueAdd = []; const retryQueuedSet = [];