fix(federation): fix reaction relay using wrong ID for message lookup
Reaction outbox events used reactionId (add) or a composite dedup key (remove) as the event messageId. The receiver looked up dm_messages by sourceMessageId = event.messageId, which never matched because it was searching for a reactionId, not the actual message ID. Fix: include the actual DM messageId in the reaction payload JSON. The receiver now uses event.reaction.messageId for the lookup, with fallback to event.messageId for backward compatibility.
This commit is contained in:
@@ -1135,6 +1135,7 @@ function handleReactionAdd(event: Record<string, unknown>, userId: string): void
|
||||
}));
|
||||
queueOutboxEvent(reactionId, dmMsg.dmChannelId, 'reaction_add', JSON.stringify({
|
||||
reaction: {
|
||||
messageId,
|
||||
userId,
|
||||
homeUserId: reactionUser?.homeUserId || userId,
|
||||
emoji,
|
||||
@@ -1212,6 +1213,7 @@ function handleReactionRemove(event: Record<string, unknown>, userId: string): v
|
||||
'reaction_remove',
|
||||
JSON.stringify({
|
||||
reaction: {
|
||||
messageId,
|
||||
userId,
|
||||
homeUserId: removingUser?.homeUserId || userId,
|
||||
emoji,
|
||||
|
||||
Reference in New Issue
Block a user