fix: save remote follower count separately from local follower count

This commit is contained in:
Julian Lam
2023-08-08 12:05:08 -04:00
parent c02271c7af
commit 4218ecc4a0

View File

@@ -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);
}