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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user