qa-lab: cache normalized Matrix mention ids

This commit is contained in:
Gustavo Madeira Santana
2026-04-10 18:40:36 -04:00
parent 32ac479304
commit bb00432920

View File

@@ -266,6 +266,7 @@ export function normalizeMatrixQaObservedEvent(
typeof mentionsRaw === "object" && mentionsRaw !== null
? (mentionsRaw as Record<string, unknown>)
: null;
const mentionUserIds = normalizeMentionUserIds(mentions?.user_ids);
const reactionKey =
type === "m.reaction" && typeof relatesTo?.key === "string" ? relatesTo.key : undefined;
const reactionEventId =
@@ -302,9 +303,7 @@ export function normalizeMatrixQaObservedEvent(
? {
mentions: {
...(mentions.room === true ? { room: true } : {}),
...(normalizeMentionUserIds(mentions.user_ids)
? { userIds: normalizeMentionUserIds(mentions.user_ids) }
: {}),
...(mentionUserIds ? { userIds: mentionUserIds } : {}),
},
}
: {}),