From 95fbaaa199bc3b88a82f0e26ccdf2219c6d58342 Mon Sep 17 00:00:00 2001 From: Gordon <46924906+FGadvancer@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:08:26 +0800 Subject: [PATCH] fix: change offset of pull message when push message come here. (#394) * fix: do not pull notifications when app reinstalled. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: do not pull notifications when app reinstalled. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: do not pull notifications when app reinstalled. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: change offset of pull message when push message come here. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> --------- Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> --- internal/interaction/msg_sync.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/interaction/msg_sync.go b/internal/interaction/msg_sync.go index d76831993..a1ed91444 100644 --- a/internal/interaction/msg_sync.go +++ b/internal/interaction/msg_sync.go @@ -219,7 +219,8 @@ func (m *MsgSyncer) pushTriggerAndSync(ctx context.Context, pullMsgs map[string] _ = triggerFunc(ctx, map[string]*sdkws.PullMsgs{conversationID: {Msgs: storageMsgs}}) m.syncedMaxSeqs[conversationID] = lastSeq } else if lastSeq != 0 && lastSeq > m.syncedMaxSeqs[conversationID] { - needSyncSeqMap[conversationID] = [2]int64{m.syncedMaxSeqs[conversationID], lastSeq} + //must pull message when message type is notification + needSyncSeqMap[conversationID] = [2]int64{m.syncedMaxSeqs[conversationID] + 1, lastSeq} } } m.syncAndTriggerMsgs(ctx, needSyncSeqMap, defaultPullNums)