fix: deliver relayed DM messages to federated users on receiving instance
The relay broadcast loop skipped members whose homeInstance matched the source instance, assuming they already received the message on their home server. This broke delivery for federated users (e.g. youruser@nova on orbit) who are actively connected to the remote instance. Client-side dedup in addRealtimeMessage already handles double delivery via sourceMessageId cross-matching, making the server-side skip both unnecessary and harmful.
This commit is contained in:
@@ -1940,15 +1940,6 @@ function processCreateEvent(
|
|||||||
.all();
|
.all();
|
||||||
|
|
||||||
for (const member of dmMembers) {
|
for (const member of dmMembers) {
|
||||||
const memberUser = db.select()
|
|
||||||
.from(schema.users)
|
|
||||||
.where(eq(schema.users.id, member.userId))
|
|
||||||
.get();
|
|
||||||
|
|
||||||
// Skip members whose home instance is the source — they already have this message
|
|
||||||
const memberHome = memberUser?.homeInstance?.startsWith('http') ? memberUser.homeInstance : `https://${memberUser?.homeInstance}`;
|
|
||||||
if (memberHome === sourceInstance) continue;
|
|
||||||
|
|
||||||
// If the member closed this DM, reopen it and send dm_channel_created
|
// If the member closed this DM, reopen it and send dm_channel_created
|
||||||
// so the sidebar resurfaces before the message arrives.
|
// so the sidebar resurfaces before the message arrives.
|
||||||
if (member.closed === 1) {
|
if (member.closed === 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user