feat: outbound S2S read state relay
Queue read_state_update events when users ack DM messages on channels with a federatedId. Translates local message IDs to federation coordinates using sourceInstance/sourceMessageId.
This commit is contained in:
@@ -11,7 +11,7 @@ import { ACTIVITY_LIMITS } from '@backspace/shared/src/activities.js';
|
||||
import { sanitizeUser } from '../utils/sanitize.js';
|
||||
import { deleteAttachmentFiles } from '../utils/fileCleanup.js';
|
||||
import { resolveEmbeds, reResolveEmbeds, embedRowToEmbed } from '../utils/embedResolver.js';
|
||||
import { appendMutationLog, queueOutboxEvent, queueDmRelay, getGroupDmTargetOrigins, sendCallRelay, computeFederatedId, sendTypingRelay } from '../utils/federationOutbox.js';
|
||||
import { appendMutationLog, queueOutboxEvent, queueDmRelay, getGroupDmTargetOrigins, sendCallRelay, computeFederatedId, sendTypingRelay, queueReadStateRelay } from '../utils/federationOutbox.js';
|
||||
import { getOurOrigin } from '../utils/federationAuth.js';
|
||||
import { generateFederatedCallToken } from '../routes/livekit.js';
|
||||
import { config } from '../config.js';
|
||||
@@ -1320,6 +1320,9 @@ function handleChannelAck(event: Record<string, unknown>, userId: string, isFede
|
||||
channelId,
|
||||
messageId,
|
||||
});
|
||||
|
||||
// Relay read state to federated peers for cross-instance sync
|
||||
queueReadStateRelay(channelId, messageId, userId);
|
||||
}
|
||||
|
||||
function handleMarkUnread(event: Record<string, unknown>, userId: string, isFederated: boolean): void {
|
||||
|
||||
Reference in New Issue
Block a user