diff --git a/internal/rpc/group/sync.go b/internal/rpc/group/sync.go index 92c7a60ce..21b4ab24a 100644 --- a/internal/rpc/group/sync.go +++ b/internal/rpc/group/sync.go @@ -66,9 +66,6 @@ func (g *groupServer) GetFullJoinGroupIDs(ctx context.Context, req *pbgroup.GetF } func (g *groupServer) GetIncrementalGroupMember(ctx context.Context, req *pbgroup.GetIncrementalGroupMemberReq) (*pbgroup.GetIncrementalGroupMemberResp, error) { - if err := g.checkAdminOrInGroup(ctx, req.GroupID); err != nil { - return nil, err - } group, err := g.db.TakeGroup(ctx, req.GroupID) if err != nil { return nil, err @@ -76,6 +73,9 @@ func (g *groupServer) GetIncrementalGroupMember(ctx context.Context, req *pbgrou if group.Status == constant.GroupStatusDismissed { return nil, servererrs.ErrDismissedAlready.Wrap() } + if err := g.checkAdminOrInGroup(ctx, req.GroupID); err != nil { + return nil, err + } var ( hasGroupUpdate bool sortVersion uint64 diff --git a/pkg/common/storage/controller/conversation.go b/pkg/common/storage/controller/conversation.go index 5ec62b33c..ebbfe0d95 100644 --- a/pkg/common/storage/controller/conversation.go +++ b/pkg/common/storage/controller/conversation.go @@ -142,7 +142,10 @@ func (c *conversationDatabase) SetUsersConversationFieldTx(ctx context.Context, if err != nil { return err } - cache = cache.DelConversationIDs(NotUserIDs...).DelUserConversationIDsHash(NotUserIDs...).DelConversations(conversation.ConversationID, NotUserIDs...) + cache = cache.DelConversationIDs(NotUserIDs...). + DelUserConversationIDsHash(NotUserIDs...). + DelUsersConversation(conversation.ConversationID, NotUserIDs...). + DelConversationVersionUserIDs(NotUserIDs...) } return cache.ChainExecDel(ctx) }) @@ -335,7 +338,9 @@ func (c *conversationDatabase) CreateGroupChatConversation(ctx context.Context, conversations = append(conversations, &conversation) cache = cache.DelConversations(v, conversationID).DelConversationNotReceiveMessageUserIDs(conversationID) } - cache = cache.DelConversationIDs(notExistUserIDs...).DelUserConversationIDsHash(notExistUserIDs...) + cache = cache.DelConversationIDs(notExistUserIDs...). + DelUserConversationIDsHash(notExistUserIDs...). + DelConversationVersionUserIDs(userIDs...) if len(conversations) > 0 { err = c.conversationDB.Create(ctx, conversations) if err != nil {