Repository navigation
Add privacy preferences, message-state, and replication integration - #6
Merged
Merged
Conversation
Adds user_privacy_preferences table (migration 000052) and wires privacy flags through read receipt write/read paths, typing indicator broadcast, and presence visibility. Replaces polling-only SyncFanoutWorker with pg_notify-driven wakeup; consolidates Redis ack to a single shared subscription channel; refactors batch processing to bulk DB ops. - Migration 000052: user_privacy_preferences (send_read_receipts, share_presence, share_typing) with permissive defaults - messages/service: MarkRead gated by send_read_receipts; GetConversationReadStatus filters hidden receipts via LEFT JOIN - realtime/ws: handleTypingSignal checks UserSharesTyping before broadcasting; drops Redis key when preference is false - presence/service: GetUserPresenceForViewer viewer-aware filtering; share_presence=false suppresses Online and LastSeenAt - replication/store: processReadCheckpoint and processTypingEvent check privacy flags in-transaction; AppendDomainEvent emits pg_notify - worker/sync_fanout: LISTEN/NOTIFY driven with fallback polling; drainUntilEmpty loop replaces single-batch calls - messages/async: single shared msg:ack:events subscription replaces per-event Redis subscriptions; in-process waiter map for WaitAck - config: SyncFanoutBatchSize, SyncFanoutFallbackPoll, SyncFanoutNotifyChannel env-configurable All gateway tests pass; build verified for cmd/api and cmd/worker. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
f8573
added a commit
that referenced
this pull request
Jun 11, 2026
* gateway: privacy prefs + read/typing/replication gating (PR 6) Adds user_privacy_preferences table (migration 000052) and wires privacy flags through read receipt write/read paths, typing indicator broadcast, and presence visibility. Replaces polling-only SyncFanoutWorker with pg_notify-driven wakeup; consolidates Redis ack to a single shared subscription channel; refactors batch processing to bulk DB ops. - Migration 000052: user_privacy_preferences (send_read_receipts, share_presence, share_typing) with permissive defaults - messages/service: MarkRead gated by send_read_receipts; GetConversationReadStatus filters hidden receipts via LEFT JOIN - realtime/ws: handleTypingSignal checks UserSharesTyping before broadcasting; drops Redis key when preference is false - presence/service: GetUserPresenceForViewer viewer-aware filtering; share_presence=false suppresses Online and LastSeenAt - replication/store: processReadCheckpoint and processTypingEvent check privacy flags in-transaction; AppendDomainEvent emits pg_notify - worker/sync_fanout: LISTEN/NOTIFY driven with fallback polling; drainUntilEmpty loop replaces single-batch calls - messages/async: single shared msg:ack:events subscription replaces per-event Redis subscriptions; in-process waiter map for WaitAck - config: SyncFanoutBatchSize, SyncFanoutFallbackPoll, SyncFanoutNotifyChannel env-configurable All gateway tests pass; build verified for cmd/api and cmd/worker. * Harden privacy sync ack and presence lifecycle ---------
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the final core privacy, message-state, and replication integration slice.
Includes:
000052_user_privacy_preferencesmigrationAsyncPipeline.Stop()shutdown ownershippresence:user:<id>Validation
go test ./internal/messages/...go test ./internal/presence/...go test ./internal/realtime/...go test ./internal/replication/...go build ./cmd/api ./cmd/workerNotes
pg_notifyis paired with fallback polling, so missed notifications create bounded delay rather than data loss.