fix: sync moderation refresh cache bypass

This commit is contained in:
iamxvbaba 2026-07-24 11:57:00 +08:00
parent 3dd9c345d7
commit 6cafa40c7b
6 changed files with 187 additions and 0 deletions

View file

@ -249,6 +249,15 @@ type UsersService interface {
ByIDs(ctx context.Context, currentUserID int64, userIDs []int64) ([]domain.User, error)
}
// UserAuthoritativeProjectionService bypasses viewer-independent base caches
// for an explicit durable profile-refresh event. The event exists precisely
// because a just-committed absolute user fact must replace client and server
// caches; re-reading a stale Redis value would acknowledge the outbox row
// without ever exposing the committed state.
type UserAuthoritativeProjectionService interface {
ByIDsAuthoritative(ctx context.Context, currentUserID int64, userIDs []int64) ([]domain.User, error)
}
// TelegramLoginService is the domain-only boundary shared by the MTProto RPC
// edge and the public OIDC provider. PostgreSQL remains authoritative for all
// consent transitions; the RPC layer only projects domain state to TL.
@ -781,6 +790,12 @@ type ChannelsService interface {
FilterActiveMemberIDs(ctx context.Context, channelID int64, userIDs []int64) ([]int64, error)
}
// ChannelAuthoritativeProjectionService bypasses long-lived channel read
// models for a durable channel_state refresh emitted by an admin mutation.
type ChannelAuthoritativeProjectionService interface {
GetChannelsAuthoritative(ctx context.Context, userID int64, channelIDs []int64) ([]domain.ChannelView, error)
}
// CommunitiesService abstracts the Layer 228 Community aggregation domain.
// Community containers never expose tg types and never own message/read/pts state.
type CommunitiesService interface {