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.
This commit is contained in:
Jannis Braun
2026-03-26 04:34:13 +01:00
parent ae004b72e1
commit 277ff0e50c
+3 -2
View File
@@ -566,8 +566,9 @@ export async function federationRoutes(app: FastifyInstance): Promise<void> {
} }
// 4. Query mutation log for the relevant channels // 4. Query mutation log for the relevant channels
// Only return mutations for messages authored by LOCAL users // Return mutations for ALL locally-created messages (source_instance IS NULL).
// (source_instance IS NULL) — each instance is authoritative for its own users' messages. // 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<{ let mutationRows: Array<{
id: string; id: string;
dm_message_id: string; dm_message_id: string;