Skip to content

Node.js based forum software built for the modern web

fix: introduce artificial 5s delay for 1b12 announces

Julian Lam101062cb9232
diff --git a/src/api/activitypub.js b/src/api/activitypub.js
index b95c58db00..813436a154 100644
--- a/src/api/activitypub.js
+++ b/src/api/activitypub.js
@@ -163,7 +163,9 @@ activitypubApi.create.note = enabledCheck(async (caller, { pid }) => {
await activitypub.send('uid', caller.uid, Array.from(targets), payloads.create);
if (followers.length) {
- await activitypub.send('cid', cid, followers, payloads.announce);
+ setTimeout(() => { // Delay sending to avoid potential race condition
+ activitypub.send('cid', cid, followers, payloads.announce);
+ }, 5000);
}
});