From a8c68ddc65c446fcda641eef174c835e2a6c8609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 13 Feb 2026 10:39:54 -0500 Subject: [PATCH] test: fix redis, from was string in map, but int in notif object --- src/notifications.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/notifications.js b/src/notifications.js index a47860887a..12ed99f7d5 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -106,7 +106,7 @@ Notifications.getMultiple = async function (nids) { return userData; }); // from can be either uid or cid - const userMap = new Map(userKeys.map((from, index) => [from, usersData[index]])); + const userMap = new Map(userKeys.map((from, index) => [String(from), usersData[index]])); notifications.forEach((notification) => { if (notification) { @@ -125,8 +125,9 @@ Notifications.getMultiple = async function (nids) { if (notification.bodyLong) { notification.bodyLong = utils.stripHTMLTags(notification.bodyLong, ['img', 'p', 'a']); } - if (userMap.has(notification.from)) { - notification.user = userMap.get(notification.from); + const fromUser = userMap.get(String(notification.from)); + if (fromUser !== undefined) { + notification.user = fromUser; } if (notification.user && notification.from) { notification.image = notification.user.picture || null;