fix: sync correct collectible username projection

This commit is contained in:
iamxvbaba 2026-08-02 19:32:18 +08:00
parent 8356989e01
commit 9041abd3d3
42 changed files with 601 additions and 758 deletions

View file

@ -59,9 +59,12 @@ func (r *Router) onMessagesCheckChatInvite(ctx context.Context, hash string) (tg
return nil, channelInviteErr(err)
}
if res.Already {
// chatInviteAlready#5a686d7c wraps a full Chat, so the badge flags already
// travel through tgChannelChat; nothing to re-apply here.
return &tg.ChatInviteAlready{Chat: tgChannelChat(userID, res.Channel, &res.Self)}, nil
// chatInviteAlready#5a686d7c wraps a full Chat. Run the shared peer
// read-model pass before nesting it so collectible usernames and badge
// facts cannot be lost behind a scalar-only complete Channel.
chat := tgChannelChat(userID, res.Channel, &res.Self)
r.applyPeerReadModels(ctx, userID, nil, []tg.ChatClass{chat})
return &tg.ChatInviteAlready{Chat: chat}, nil
}
invite := &tg.ChatInvite{
Channel: true,