diff --git a/pkg/common/db/controller/msg.go b/pkg/common/db/controller/msg.go index 415e69e32..9a59e9030 100644 --- a/pkg/common/db/controller/msg.go +++ b/pkg/common/db/controller/msg.go @@ -455,8 +455,10 @@ func (db *commonMsgDatabase) GetMsgBySeqsRange(ctx context.Context, userID strin if err != nil && errs.Unwrap(err) != redis.Nil { return 0, 0, nil, err } - if userMaxSeq < maxSeq { - maxSeq = userMaxSeq + if userMaxSeq != 0 { + if userMaxSeq < maxSeq { + maxSeq = userMaxSeq + } } if begin < minSeq { begin = minSeq