Skip to content

Commit

Permalink
fix: some messages seq is zero,filter this message and print exceptio…
Browse files Browse the repository at this point in the history
…n info (#260)

* fix: message status change

* fix: page pull change args

* feat: add wasm multipart upload

* feat: add wasm multipart upload

* feat: add wasm multipart upload

* test: log add

* test: log add

* refactor: remove session type

* refactor: remove session type

* refactor: remove session type

* refactor: remove session type

* refactor: syncer update

* refactor: syncer update

* refactor: syncer update

* refactor: syncer update

* refactor: syncer update

* refactor: syncer update

* refactor: go-cmp change version

* feat: wasm add upload file

* feat: wasm add upload file

* refactor: user update

* refactor: upload file add content type

* refactor: conversation trigger

* refactor: conversation trigger

* fix: msg file ContentType

* test: log  add

* chore: makefile update

* fix: sync user info error

* fix: send video message blocking

Signed-off-by: Gordon <1432970085@qq.com>

* fix: logout don't callback when network can not establish

Signed-off-by: Gordon <1432970085@qq.com>

* fix: logout don't callback when network can not establish

Signed-off-by: Gordon <1432970085@qq.com>

* new feat: sync less data

* new feat: sync less data

* fix: still reconn when token is invalid

Signed-off-by: Gordon <1432970085@qq.com>

* fix: sendMessage not oss add content

Signed-off-by: Gordon <1432970085@qq.com>

* flag

Signed-off-by: hanzhixiao <709674996@qq.com>

* fix bug: friend wasm sql

* fix: kick logout

Signed-off-by: Gordon <1432970085@qq.com>

* fix: kick logout

Signed-off-by: Gordon <1432970085@qq.com>

* fix bug: friend msg syncer

* fix: wasm db close

Signed-off-by: Gordon <1432970085@qq.com>

* fix: wasm db close

Signed-off-by: Gordon <1432970085@qq.com>

* Fix: wasm close db (#176)

* fix: message status change

* fix: page pull change args

* feat: add wasm multipart upload

* feat: add wasm multipart upload

* feat: add wasm multipart upload

* test: log add

* test: log add

* refactor: remove session type

* refactor: remove session type

* refactor: remove session type

* refactor: remove session type

* refactor: syncer update

* refactor: syncer update

* refactor: syncer update

* refactor: syncer update

* refactor: syncer update

* refactor: syncer update

* refactor: go-cmp change version

* feat: wasm add upload file

* feat: wasm add upload file

* refactor: user update

* refactor: upload file add content type

* refactor: conversation trigger

* refactor: conversation trigger

* fix: msg file ContentType

* test: log  add

* chore: makefile update

* fix: sync user info error

* fix: send video message blocking

Signed-off-by: Gordon <1432970085@qq.com>

* fix: logout don't callback when network can not establish

Signed-off-by: Gordon <1432970085@qq.com>

* fix: logout don't callback when network can not establish

Signed-off-by: Gordon <1432970085@qq.com>

* fix: still reconn when token is invalid

Signed-off-by: Gordon <1432970085@qq.com>

* fix: sendMessage not oss add content

Signed-off-by: Gordon <1432970085@qq.com>

* fix: kick logout

Signed-off-by: Gordon <1432970085@qq.com>

* fix: kick logout

Signed-off-by: Gordon <1432970085@qq.com>

* fix: wasm db close

Signed-off-by: Gordon <1432970085@qq.com>

* fix: wasm db close

Signed-off-by: Gordon <1432970085@qq.com>

---------

Signed-off-by: Gordon <1432970085@qq.com>
Co-authored-by: withchao <993506633@qq.com>

* fix: search messages add localEx field

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* test

Signed-off-by: hanzhixiao <709674996@qq.com>

* fix bug: user update name and faceurl not sync

* feat: conversation local ex

* feat: conversation local ex

* fix bug: sync failed

* presuretest code

* test

* test: pressure test code

* fix: program will crash when websocket just initialized and send message

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* feature: add function of unInitSDK

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* test: add function of create group and send messages

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* test: add function of create group and send messages

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* fxi: pull messages with pagination and send message add reply timeout.

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* feat: wasm add business listener

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* feat: log level can set gorm log level

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* fix: user goroutine did not exit when ws dial because of token invalid or expired

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* fix: err message update

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* test: panic recover

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* fix: avoid panic when local don't have message

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* test: test args change

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* fix: some messages seq is zero,filter this message and print exception info

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

---------

Signed-off-by: Gordon <1432970085@qq.com>
Signed-off-by: hanzhixiao <709674996@qq.com>
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
Co-authored-by: wangchuxiao <wangchuxiao97@outlook.com>
Co-authored-by: withchao <993506633@qq.com>
Co-authored-by: hanzhixiao <709674996@qq.com>
Co-authored-by: withchao <48119764+withchao@users.noreply.github.com>
  • Loading branch information
5 people authored Aug 18, 2023
1 parent 4adbb00 commit 531b243
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions internal/conversation_msg/read_drawing.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package conversation_msg

import (
"context"
"errors"
"open_im_sdk/internal/util"
"open_im_sdk/pkg/common"
"open_im_sdk/pkg/constant"
Expand Down Expand Up @@ -141,8 +142,12 @@ func (c *Conversation) markMessagesAsReadByMsgID(ctx context.Context, conversati
func (c *Conversation) getAsReadMsgMapAndList(ctx context.Context, msgs []*model_struct.LocalChatLog) (asReadMsgIDs []string, seqs []int64) {
for _, msg := range msgs {
if !msg.IsRead && msg.SendID != c.loginUserID {
asReadMsgIDs = append(asReadMsgIDs, msg.ClientMsgID)
seqs = append(seqs, msg.Seq)
if msg.Seq == 0 {
log.ZWarn(ctx, "exception seq", errors.New("exception message "), "msg", msg)
} else {
asReadMsgIDs = append(asReadMsgIDs, msg.ClientMsgID)
seqs = append(seqs, msg.Seq)
}
} else {
log.ZWarn(ctx, "msg can't marked as read", nil, "msg", msg)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/db/chat_log_model_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func (d *DataBase) SearchAllMessageByContentType(ctx context.Context, conversati
func (d *DataBase) GetUnreadMessage(ctx context.Context, conversationID string) (msgs []*model_struct.LocalChatLog, err error) {
d.mRWMutex.Lock()
defer d.mRWMutex.Unlock()
err = utils.Wrap(d.conn.WithContext(ctx).Table(utils.GetConversationTableName(conversationID)).Debug().Where("send_id != ? AND is_read = ?", d.loginUserID, 0).Find(&msgs).Error, "GetMessageList failed")
err = utils.Wrap(d.conn.WithContext(ctx).Table(utils.GetConversationTableName(conversationID)).Debug().Where("send_id != ? AND is_read = ?", d.loginUserID, constant.NotRead).Find(&msgs).Error, "GetMessageList failed")
return msgs, err
}

Expand Down

0 comments on commit 531b243

Please sign in to comment.