From 4218ecc4a05589b9b8a876d231efa4cbf34a2a73 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 8 Aug 2023 12:05:08 -0400 Subject: [PATCH] fix: save remote follower count separately from local follower count --- src/activitypub/inbox.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.js index 6bbf25e748..096bb481d6 100644 --- a/src/activitypub/inbox.js +++ b/src/activitypub/inbox.js @@ -53,9 +53,6 @@ async function handleFollow(type, actorId, objectId) { await db.sortedSetRemove(`followersRemote:${localUid}`, actorId); } - const [followerCount, followerRemoteCount] = await Promise.all([ - db.sortedSetCard(`followers:${localUid}`), - db.sortedSetCard(`followersRemote:${localUid}`), - ]); - await user.setUserField(localUid, 'followerCount', followerCount + followerRemoteCount); + const followerRemoteCount = await db.sortedSetCard(`followersRemote:${localUid}`); + await user.setUserField(localUid, 'followerRemoteCount', followerRemoteCount); }