mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-25 04:32:10 +08:00
eat: add filtering for invalid messages and invalid conversations to prevent data-fetching exceptions after conversations are deleted.
This commit is contained in:
parent
55113e5277
commit
a893141ae6
@ -266,7 +266,9 @@ func (x *JSSdk) checkMessagesAndGetLastMessage(ctx context.Context, userID strin
|
||||
break
|
||||
}
|
||||
}
|
||||
if allInValid {
|
||||
|
||||
// when the conversation has been deleted by the user, the length of message.Msgs is empty
|
||||
if allInValid && len(message.Msgs) > 0 {
|
||||
conversationIDs = append(conversationIDs, conversationID)
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,6 +23,8 @@ import (
|
||||
"github.com/openimsdk/tools/s3/aws"
|
||||
"github.com/openimsdk/tools/s3/disable"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller"
|
||||
@ -37,7 +39,6 @@ import (
|
||||
"github.com/openimsdk/tools/s3/kodo"
|
||||
"github.com/openimsdk/tools/s3/minio"
|
||||
"github.com/openimsdk/tools/s3/oss"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type thirdServer struct {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user