fix: eliminate infinite loop in actors.assert via user.getUsersFields

This commit is contained in:
Julian Lam
2024-06-14 10:59:07 -04:00
parent 6227ab900e
commit 18e583184f

View File

@@ -156,7 +156,7 @@ Actors.assert = async (ids, options = {}) => {
const exists = await db.isSortedSetMembers('usersRemote:lastCrawled', profiles.map(p => p.uid));
const uidsForCurrent = profiles.map((p, idx) => (exists[idx] ? p.uid : 0));
const current = await user.getUsersFields(uidsForCurrent, ['username', 'fullname']);
const current = await db.getObjectsFields(uidsForCurrent.map(id => `userRemote:${id}`), ['username', 'fullname']);
const queries = profiles.reduce((memo, profile, idx) => {
const { username, fullname } = current[idx];