From 277ff0e50cd68a4535543c595ff0e1222d83d215 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Thu, 26 Mar 2026 04:34:13 +0100 Subject: [PATCH] fix(federation): sync ALL locally-created messages, not just local-home-user messages Messages by replicated users (e.g., Jannis browsing orbit) have source_instance IS NULL because they were created on that instance. The sync endpoint was incorrectly filtering these out, causing most DM history to be missing from the sync response. --- packages/server/src/routes/federation.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/src/routes/federation.ts b/packages/server/src/routes/federation.ts index bd184251..9b9155e5 100644 --- a/packages/server/src/routes/federation.ts +++ b/packages/server/src/routes/federation.ts @@ -566,8 +566,9 @@ export async function federationRoutes(app: FastifyInstance): Promise { } // 4. Query mutation log for the relevant channels - // Only return mutations for messages authored by LOCAL users - // (source_instance IS NULL) — each instance is authoritative for its own users' messages. + // Return mutations for ALL locally-created messages (source_instance IS NULL). + // This includes messages by replicated users (e.g., Jannis browsing orbit) + // because they were created on THIS instance and need to be synced to the peer. let mutationRows: Array<{ id: string; dm_message_id: string;