mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
fix: DeleteDoc crash (#3078)
* pb * fix: Modifying other fields while setting IsPrivateChat does not take effect * fix: quote message error revoke * refactoring scheduled tasks * refactoring scheduled tasks * refactoring scheduled tasks * refactoring scheduled tasks * refactoring scheduled tasks * refactoring scheduled tasks * upgrading pkg tools * fix * fix * optimize log output * feat: support GetLastMessage * feat: support GetLastMessage * feat: s3 switch * feat: s3 switch * fix: GetUsersOnline * feat: SendBusinessNotification supported configuration parameters * feat: SendBusinessNotification supported configuration parameters * feat: SendBusinessNotification supported configuration parameters * feat: seq conversion failed without exiting * fix: DeleteDoc crash
This commit is contained in:
parent
efcd76318e
commit
9f796e78c1
@ -18,11 +18,12 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/openimsdk/tools/utils/jsonutil"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/openimsdk/tools/utils/jsonutil"
|
||||||
|
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/database"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/database"
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/model"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/model"
|
||||||
|
|
||||||
@ -722,13 +723,13 @@ func (db *commonMsgDatabase) DeleteDoc(ctx context.Context, docID string) error
|
|||||||
if index <= 0 {
|
if index <= 0 {
|
||||||
return errs.ErrInternalServer.WrapMsg("docID is invalid", "docID", docID)
|
return errs.ErrInternalServer.WrapMsg("docID is invalid", "docID", docID)
|
||||||
}
|
}
|
||||||
index, err := strconv.Atoi(docID[index+1:])
|
docIndex, err := strconv.Atoi(docID[index+1:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errs.WrapMsg(err, "strconv.Atoi", "docID", docID)
|
return errs.WrapMsg(err, "strconv.Atoi", "docID", docID)
|
||||||
}
|
}
|
||||||
conversationID := docID[:index]
|
conversationID := docID[:index]
|
||||||
seqs := make([]int64, db.msgTable.GetSingleGocMsgNum())
|
seqs := make([]int64, db.msgTable.GetSingleGocMsgNum())
|
||||||
minSeq := db.msgTable.GetMinSeq(index)
|
minSeq := db.msgTable.GetMinSeq(docIndex)
|
||||||
for i := range seqs {
|
for i := range seqs {
|
||||||
seqs[i] = minSeq + int64(i)
|
seqs[i] = minSeq + int64(i)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user