perf: sync megagroup unread derivation

This commit is contained in:
A 2026-07-09 13:49:34 +08:00
parent 4c0cc2b7a7
commit 41c7f1d018
5 changed files with 87 additions and 217 deletions

View file

@ -411,9 +411,8 @@ RETURNING pinned_message_id`, channel.ID, topID, pts).Scan(&latestPinned); err !
channel.TopMessageID = topID
channel.Pts = pts
channel.PinnedMessageID = latestPinned
if err := refreshChannelDialogsAfterDeleteTx(ctx, tx, channel); err != nil {
return nil, domain.ChannelUpdateEvent{}, channel, err
}
// 删除后不再对全员刷新 channel_dialogs 缓存行(性能审计 H4a):unread 读时由
// 可见 incoming 消息动态派生(deleted 自动出列),top 由 channels.top_message_id 提供。
event := domain.ChannelUpdateEvent{
ChannelID: channel.ID,
Type: domain.ChannelUpdateDeleteMessages,