From 1eaae5f9804b406f70deb8977c9ae9ff59890f89 Mon Sep 17 00:00:00 2001 From: OpenIM-Gordon <1432970085@qq.com> Date: Thu, 12 Dec 2024 18:13:35 +0800 Subject: [PATCH] fix: fetch message return isEnd and endSeq panic. (#2959) * fix: server can return isEnd to control fetch messages when sdk pull messages end normally. * fix: server can return isEnd to control fetch messages when sdk pull messages end normally. * fix: server can return isEnd to control fetch messages when sdk pull messages end normally. --- internal/rpc/msg/sync_msg.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rpc/msg/sync_msg.go b/internal/rpc/msg/sync_msg.go index 13e3cfd33..7d4ffa3e6 100644 --- a/internal/rpc/msg/sync_msg.go +++ b/internal/rpc/msg/sync_msg.go @@ -97,8 +97,6 @@ func (m *msgServer) GetSeqMessage(ctx context.Context, req *msg.GetSeqMessageReq return nil, err } var pullMsgs *sdkws.PullMsgs - pullMsgs.IsEnd = isEnd - pullMsgs.EndSeq = endSeq if ok := false; conversationutil.IsNotificationConversationID(conv.ConversationID) { pullMsgs, ok = resp.NotificationMsgs[conv.ConversationID] if !ok { @@ -113,6 +111,8 @@ func (m *msgServer) GetSeqMessage(ctx context.Context, req *msg.GetSeqMessageReq } } pullMsgs.Msgs = append(pullMsgs.Msgs, msgs...) + pullMsgs.IsEnd = isEnd + pullMsgs.EndSeq = endSeq } return resp, nil }