fix: relay mark_unread to peers, fix docs and timestamp consistency

- Add queueReadStateRelay call in handleMarkUnread (skip '0' sentinel)
- Fix double Date.now() in queueReadStateRelay (use single const)
- Fix federation.md: read state relay uses outbox (not fire-and-forget),
  correct payload schema to match implementation
This commit is contained in:
Jannis Braun
2026-04-07 20:08:31 +02:00
parent 626a8ded50
commit 1ada46baff
3 changed files with 31 additions and 18 deletions
+6
View File
@@ -1384,6 +1384,12 @@ function handleMarkUnread(event: Record<string, unknown>, userId: string, isFede
channelId,
messageId,
});
// Relay mark-unread to federated peers for cross-instance sync
// (skip the '0' sentinel — it deletes the read state and can't be mapped to a message)
if (messageId !== '0') {
queueReadStateRelay(channelId, messageId, userId);
}
}
// ─── DM Call Handlers (Unified Room API) ───────────────────────────────────