Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: msg syncer sync msg has sync when old msg push #152

Merged
merged 7 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
test.SENDINTERVAL = SENDINTERVAL
test.WSADDR = WSADDR
test.ACCOUNTCHECK = ACCOUNTCHECK
strMyUidx := "2712330015"
strMyUidx := "5035571337"

tokenx := test.RunGetToken(strMyUidx)
fmt.Println(tokenx)
Expand Down
1 change: 1 addition & 0 deletions internal/conversation_msg/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func (c *Conversation) deleteMessageFromLocal(ctx context.Context, conversationI
func (c *Conversation) doDeleteMsgs(ctx context.Context, msg *sdkws.MsgData) {
tips := sdkws.DeleteMsgsTips{}
utils.UnmarshalNotificationElem(msg.Content, &tips)
log.ZDebug(ctx, "doDeleteMsgs", "seqs", tips.Seqs)
for _, v := range tips.Seqs {
msg, err := c.db.GetMessageBySeq(ctx, tips.ConversationID, v)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/interaction/msg_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (m *MsgSyncer) pushTriggerAndSync(ctx context.Context, pullMsgs map[string]
log.ZDebug(ctx, "trigger msgs", "msgs", storageMsgs)
_ = triggerFunc(ctx, map[string]*sdkws.PullMsgs{conversationID: {Msgs: storageMsgs}})
m.syncedMaxSeqs[conversationID] = lastSeq
} else if lastSeq != 0 { //为0就是全是通知
} else if lastSeq != 0 && lastSeq > m.syncedMaxSeqs[conversationID] {
needSyncSeqMap[conversationID] = [2]int64{m.syncedMaxSeqs[conversationID], lastSeq}
}
}
Expand Down