Skip to content

Commit

Permalink
fix: sdk logout due to client kick online, incr sync data trigger ful…
Browse files Browse the repository at this point in the history
…l id. (#601)

* feat: add function of GetUsersInGroup checks if the provided userIDs are in the specified group.

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

* feat: add function of GetUsersInGroup checks if the provided userIDs are in the specified group.

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

* feat: add function of GetUsersInGroup checks if the provided userIDs are in the specified group.

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

* feat: add function of GetUsersInGroup checks if the provided userIDs are in the specified group.

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

* feat: add incremental synchronization for common conversation attributes.

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

* fix: commit.

* fix: commit.

* fix: commit.

* fix: commit.

* feat: add incremental synchronization for common conversation attributes.

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

* fix: sync user error.

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

* fix: remove wasm file.

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

* fix: change limit int type avoid overflow and group member sorted.

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

* fix: sdk logout due to client kick online, incr sync data trigger full id.

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

---------

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
  • Loading branch information
FGadvancer authored Jul 18, 2024
1 parent b48e07b commit 53c2ae2
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 41 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require golang.org/x/net v0.22.0

require (
github.com/google/go-cmp v0.6.0
github.com/openimsdk/protocol v0.0.69-alpha.30
github.com/openimsdk/protocol v0.0.69-alpha.37
github.com/openimsdk/tools v0.0.49-alpha.44
github.com/patrickmn/go-cache v2.1.0+incompatible
golang.org/x/image v0.15.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205Ah
github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/openimsdk/protocol v0.0.69-alpha.30 h1:OXzCIpDpIY/GI6h1SDYWN51OS9Xv/BcHaOwq8whPKqI=
github.com/openimsdk/protocol v0.0.69-alpha.30/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8=
github.com/openimsdk/protocol v0.0.69-alpha.37 h1:2gtDkippSBfbXIP++BEQsz4e+qjk86ddnh4b7p40/HY=
github.com/openimsdk/protocol v0.0.69-alpha.37/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8=
github.com/openimsdk/tools v0.0.49-alpha.44 h1:anefO8hvQwJrYL+V4ifSge/CveZHIpjPeik6BgETuG8=
github.com/openimsdk/tools v0.0.49-alpha.44/go.mod h1:zc0maZ2ohXlHd0ylY5JnCE8uqq/hslhcfcKa6iO5PCU=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
Expand Down
6 changes: 6 additions & 0 deletions internal/friend/sync2.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ func (f *Friend) IncrSyncFriends(ctx context.Context) error {
}
return resp.UserIDs, nil
},
IDOrderChanged: func(resp *friend.GetIncrementalFriendsResp) bool {
if resp.SortVersion > 0 {
return true
}
return false
},
}
return friendSyncer.Sync()
}
Expand Down
41 changes: 23 additions & 18 deletions internal/group/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ import (
"github.com/openimsdk/tools/log"
)

const (
groupSortIDUnchanged = 0
groupSortIDChanged = 1
)

func (g *Group) DoNotification(ctx context.Context, msg *sdkws.MsgData) {
go func() {

Expand Down Expand Up @@ -57,7 +62,7 @@ func (g *Group) doNotification(ctx context.Context, msg *sdkws.MsgData) error {
return err
}
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil,
nil, nil, detail.Group, detail.GroupMemberVersion, detail.GroupMemberVersionID)
nil, nil, detail.Group, groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
case constant.JoinGroupApplicationNotification: // 1503
var detail sdkws.JoinGroupApplicationTips
if err := utils.UnmarshalNotificationElem(msg.Content, &detail); err != nil {
Expand All @@ -76,8 +81,8 @@ func (g *Group) doNotification(ctx context.Context, msg *sdkws.MsgData) error {
if detail.QuitUser.UserID == g.loginUserID {
return g.IncrSyncJoinGroup(ctx)
} else {
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, []*sdkws.GroupMemberFullInfo{detail.QuitUser},
nil, nil, detail.Group, detail.GroupMemberVersion, detail.GroupMemberVersionID)
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, []*sdkws.GroupMemberFullInfo{detail.QuitUser}, nil,
nil, detail.Group, groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
}
case constant.GroupApplicationAcceptedNotification: // 1505
var detail sdkws.GroupApplicationAcceptedTips
Expand Down Expand Up @@ -115,7 +120,7 @@ func (g *Group) doNotification(ctx context.Context, msg *sdkws.MsgData) error {
}
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil,
[]*sdkws.GroupMemberFullInfo{detail.NewGroupOwner, detail.OldGroupOwnerInfo}, nil,
detail.Group, detail.GroupMemberVersion, detail.GroupMemberVersionID)
detail.Group, groupSortIDChanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
case constant.MemberKickedNotification: // 1508
var detail sdkws.MemberKickedTips
if err := utils.UnmarshalNotificationElem(msg.Content, &detail); err != nil {
Expand All @@ -132,7 +137,7 @@ func (g *Group) doNotification(ctx context.Context, msg *sdkws.MsgData) error {
return g.IncrSyncJoinGroup(ctx)
} else {
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, detail.KickedUserList, nil,
nil, detail.Group, detail.GroupMemberVersion, detail.GroupMemberVersionID)
nil, detail.Group, groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
}
case constant.MemberInvitedNotification: // 1509
var detail sdkws.MemberInvitedTips
Expand All @@ -142,15 +147,15 @@ func (g *Group) doNotification(ctx context.Context, msg *sdkws.MsgData) error {
userIDMap := datautil.SliceSetAny(detail.InvitedUserList, func(e *sdkws.GroupMemberFullInfo) string {
return e.UserID
})
//自己也是被邀请的一员
//Also invited as a member
if _, ok := userIDMap[g.loginUserID]; ok {
if err := g.IncrSyncJoinGroup(ctx); err != nil {
return err
}
return g.IncrSyncGroupAndMember(ctx, detail.Group.GroupID)
} else {
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil, nil,
detail.InvitedUserList, detail.Group, detail.GroupMemberVersion, detail.GroupMemberVersionID)
detail.InvitedUserList, detail.Group, groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
}
case constant.MemberEnterNotification: // 1510
var detail sdkws.MemberEnterTips
Expand All @@ -164,7 +169,7 @@ func (g *Group) doNotification(ctx context.Context, msg *sdkws.MsgData) error {
return g.IncrSyncGroupAndMember(ctx, detail.Group.GroupID)
} else {
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil, nil,
[]*sdkws.GroupMemberFullInfo{detail.EntrantUser}, detail.Group, detail.GroupMemberVersion, detail.GroupMemberVersionID)
[]*sdkws.GroupMemberFullInfo{detail.EntrantUser}, detail.Group, groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
}
case constant.GroupDismissedNotification: // 1511
var detail sdkws.GroupDismissedTips
Expand All @@ -181,29 +186,29 @@ func (g *Group) doNotification(ctx context.Context, msg *sdkws.MsgData) error {
}
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil,
[]*sdkws.GroupMemberFullInfo{detail.MutedUser}, nil, nil,
detail.GroupMemberVersion, detail.GroupMemberVersionID)
groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
case constant.GroupMemberCancelMutedNotification: // 1513
var detail sdkws.GroupMemberCancelMutedTips
if err := utils.UnmarshalNotificationElem(msg.Content, &detail); err != nil {
return err
}
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil,
[]*sdkws.GroupMemberFullInfo{detail.MutedUser}, nil, nil,
detail.GroupMemberVersion, detail.GroupMemberVersionID)
groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
case constant.GroupMutedNotification: // 1514
var detail sdkws.GroupMutedTips
if err := utils.UnmarshalNotificationElem(msg.Content, &detail); err != nil {
return err
}
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil, nil,
nil, detail.Group, detail.GroupMemberVersion, detail.GroupMemberVersionID)
nil, detail.Group, groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
case constant.GroupCancelMutedNotification: // 1515
var detail sdkws.GroupCancelMutedTips
if err := utils.UnmarshalNotificationElem(msg.Content, &detail); err != nil {
return err
}
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil, nil,
nil, detail.Group, detail.GroupMemberVersion, detail.GroupMemberVersionID)
nil, detail.Group, groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
case constant.GroupMemberInfoSetNotification: // 1516
var detail sdkws.GroupMemberInfoSetTips
if err := utils.UnmarshalNotificationElem(msg.Content, &detail); err != nil {
Expand All @@ -212,37 +217,37 @@ func (g *Group) doNotification(ctx context.Context, msg *sdkws.MsgData) error {

return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil,
[]*sdkws.GroupMemberFullInfo{detail.ChangedUser}, nil, nil,
detail.GroupMemberVersion, detail.GroupMemberVersionID)
detail.GroupSortVersion, detail.GroupMemberVersion, detail.GroupMemberVersionID)
case constant.GroupMemberSetToAdminNotification: // 1517
var detail sdkws.GroupMemberInfoSetTips
if err := utils.UnmarshalNotificationElem(msg.Content, &detail); err != nil {
return err
}
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil,
[]*sdkws.GroupMemberFullInfo{detail.ChangedUser}, nil, nil,
detail.GroupMemberVersion, detail.GroupMemberVersionID)
detail.GroupSortVersion, detail.GroupMemberVersion, detail.GroupMemberVersionID)
case constant.GroupMemberSetToOrdinaryUserNotification: // 1518
var detail sdkws.GroupMemberInfoSetTips
if err := utils.UnmarshalNotificationElem(msg.Content, &detail); err != nil {
return err
}
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil,
[]*sdkws.GroupMemberFullInfo{detail.ChangedUser}, nil, nil,
detail.GroupMemberVersion, detail.GroupMemberVersionID)
detail.GroupSortVersion, detail.GroupMemberVersion, detail.GroupMemberVersionID)
case constant.GroupInfoSetAnnouncementNotification: // 1519
var detail sdkws.GroupInfoSetAnnouncementTips //
if err := utils.UnmarshalNotificationElem(msg.Content, &detail); err != nil {
return err
}
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil, nil,
nil, detail.Group, detail.GroupMemberVersion, detail.GroupMemberVersionID)
nil, detail.Group, groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
case constant.GroupInfoSetNameNotification: // 1520
var detail sdkws.GroupInfoSetNameTips //
if err := utils.UnmarshalNotificationElem(msg.Content, &detail); err != nil {
return err
}
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil,
nil, nil, detail.Group, detail.GroupMemberVersion, detail.GroupMemberVersionID)
return g.onlineSyncGroupAndMember(ctx, detail.Group.GroupID, nil, nil,
nil, detail.Group, groupSortIDUnchanged, detail.GroupMemberVersion, detail.GroupMemberVersionID)
default:
return errs.New("unknown tips type", "contentType", msg.ContentType).Wrap()
}
Expand Down
27 changes: 23 additions & 4 deletions internal/group/sync2.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,18 @@ func (g *Group) syncGroupAndMember(ctx context.Context, groupID string, resp *gr
}
return resp.UserIDs, nil
},
IDOrderChanged: func(resp *group.GetIncrementalGroupMemberResp) bool {
if resp.SortVersion > 0 {
return true
}
return false
},
}
return groupMemberSyncer.Sync()
}

func (g *Group) onlineSyncGroupAndMember(ctx context.Context, groupID string, deleteGroupMembers, updateGroupMembers, insertGroupMembers []*sdkws.GroupMemberFullInfo,
updateGroup *sdkws.GroupInfo, version uint64, versionID string) error {
updateGroup *sdkws.GroupInfo, sortVersion uint64, version uint64, versionID string) error {
groupMemberSyncer := incrversion.VersionSynchronizer[*model_struct.LocalGroupMember, *group.GetIncrementalGroupMemberResp]{
Ctx: ctx,
DB: g.db,
Expand All @@ -207,9 +213,10 @@ func (g *Group) onlineSyncGroupAndMember(ctx context.Context, groupID string, de
Delete: datautil.Slice(deleteGroupMembers, func(e *sdkws.GroupMemberFullInfo) string {
return e.UserID
}),
Insert: insertGroupMembers,
Update: updateGroupMembers,
Group: updateGroup,
Insert: insertGroupMembers,
Update: updateGroupMembers,
Group: updateGroup,
SortVersion: sortVersion,
}
},
Server: func(version *model_struct.LocalVersionSync) (*group.GetIncrementalGroupMemberResp, error) {
Expand Down Expand Up @@ -288,6 +295,12 @@ func (g *Group) onlineSyncGroupAndMember(ctx context.Context, groupID string, de
}
return resp.UserIDs, nil
},
IDOrderChanged: func(resp *group.GetIncrementalGroupMemberResp) bool {
if resp.SortVersion > 0 {
return true
}
return false
},
}
return groupMemberSyncer.CheckVersionSync()
}
Expand Down Expand Up @@ -342,6 +355,12 @@ func (g *Group) IncrSyncJoinGroup(ctx context.Context) error {
return resp.GroupIDs, nil

},
IDOrderChanged: func(resp *group.GetIncrementalJoinGroupResp) bool {
if resp.SortVersion > 0 {
return true
}
return false
},
}
return opt.Sync()
}
17 changes: 17 additions & 0 deletions internal/incrversion/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type VersionSynchronizer[V, R any] struct {
Syncer func(server, local []V) error
FullSyncer func(ctx context.Context) error
FullID func(ctx context.Context) ([]string, error)
IDOrderChanged func(resp R) bool
}

func (o *VersionSynchronizer[V, R]) getVersionInfo() (*model_struct.LocalVersionSync, error) {
Expand Down Expand Up @@ -134,6 +135,14 @@ func (o *VersionSynchronizer[V, R]) Sync() error {
}

}
// The ordering of fullID has changed due to modifications such as group role level changes or friend list reordering.
// Therefore, it is necessary to refresh and obtain the fullID again.
if o.IDOrderChanged != nil && o.IDOrderChanged(resp) {
lvs.UIDList, err = o.FullID(o.Ctx)
if err != nil {
return err
}
}
}
return o.updateVersionInfo(lvs, resp)
}
Expand Down Expand Up @@ -202,6 +211,14 @@ func (o *VersionSynchronizer[V, R]) CheckVersionSync() error {
}

}
// The ordering of fullID has changed due to modifications such as group role level changes or friend list reordering.
// Therefore, it is necessary to refresh and obtain the fullID again.
if o.IDOrderChanged != nil && o.IDOrderChanged(resp) {
lvs.UIDList, err = o.FullID(o.Ctx)
if err != nil {
return err
}
}
return o.updateVersionInfo(lvs, resp)
} else if version <= lvs.Version {
log.ZWarn(o.Ctx, "version less than local version", errs.New("version less than local version"),
Expand Down
28 changes: 19 additions & 9 deletions internal/interaction/long_conn_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ func (c *LongConnMgr) readPump(ctx context.Context) {
}()
connNum := 0
for {
select {
case <-ctx.Done():
c.closedErr = ctx.Err()
log.ZInfo(c.ctx, "readPump done, sdk logout.....")
return
default:
}
ctx = ccontext.WithOperationID(ctx, utils.OperationIDGenerator())
needRecon, err := c.reConn(ctx, &connNum)
if !needRecon {
Expand Down Expand Up @@ -225,6 +232,7 @@ func (c *LongConnMgr) writePump(ctx context.Context) {
select {
case <-ctx.Done():
c.closedErr = ctx.Err()
log.ZInfo(c.ctx, "writePump done, sdk logout.....")
return
case message, ok := <-c.send:
if !ok {
Expand Down Expand Up @@ -286,16 +294,17 @@ func (c *LongConnMgr) heartbeat(ctx context.Context) {
func (c *LongConnMgr) sendPingMessage(ctx context.Context) {
c.connWrite.Lock()
defer c.connWrite.Unlock()
log.ZDebug(ctx, "ping Message Started", "goroutine ID:", getGoroutineID())
opid := utils.OperationIDGenerator()
log.ZDebug(ctx, "ping Message Started", "goroutine ID:", getGoroutineID(), "opid", opid)
if c.IsConnected() {
log.ZDebug(ctx, "ping Message Started isConnected", "goroutine ID:", getGoroutineID())
log.ZDebug(ctx, "ping Message Started isConnected", "goroutine ID:", getGoroutineID(), "opid", opid)
c.conn.SetWriteDeadline(writeWait)
if err := c.conn.WriteMessage(PingMessage, []byte(utils.OperationIDGenerator())); err != nil {
log.ZWarn(ctx, "ping Message failed", err, "goroutine ID:", getGoroutineID())
if err := c.conn.WriteMessage(PingMessage, []byte(opid)); err != nil {
log.ZWarn(ctx, "ping Message failed", err, "goroutine ID:", getGoroutineID(), "opid", opid)
return
}
} else {
log.ZDebug(ctx, "ping Message failed, connection", "connStatus", c.GetConnectionStatus(), "goroutine ID:", getGoroutineID())
log.ZDebug(ctx, "ping Message failed, connection", "connStatus", c.GetConnectionStatus(), "goroutine ID:", getGoroutineID(), "opid", opid)
}

}
Expand Down Expand Up @@ -452,10 +461,11 @@ func (c *LongConnMgr) handleMessage(message []byte) error {
}
return sdkerrs.ErrLoginOut
case constant.KickOnlineMsg:
log.ZDebug(ctx, "client kicked offline")
c.listener.OnKickedOffline()
_ = common.TriggerCmdLogOut(ctx, c.loginMgrCh)
return errors.New("client kicked offline")
log.ZDebug(ctx, "socket receive client kicked offline")

err = errs.ErrTokenKicked.WrapMsg("socket receive client kicked offline")
ccontext.GetApiErrCodeCallback(ctx).OnError(ctx, err)
return err
case constant.GetNewestSeq:
fallthrough
case constant.PullMsgBySeqList:
Expand Down
13 changes: 6 additions & 7 deletions open_im_sdk/userRelated.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package open_im_sdk
import (
"context"
"encoding/json"
"errors"
"fmt"
"strings"
"sync"
Expand All @@ -41,11 +40,12 @@ import (
"github.com/openimsdk/openim-sdk-core/v3/pkg/db/db_interface"
"github.com/openimsdk/openim-sdk-core/v3/pkg/db/model_struct"
"github.com/openimsdk/openim-sdk-core/v3/pkg/sdkerrs"
"github.com/openimsdk/openim-sdk-core/v3/pkg/utils"
"github.com/openimsdk/openim-sdk-core/v3/sdk_struct"
"github.com/openimsdk/protocol/push"
"github.com/openimsdk/protocol/sdkws"
"github.com/openimsdk/tools/errs"
"github.com/openimsdk/tools/log"
"github.com/openimsdk/tools/utils/jsonutil"
)

const (
Expand All @@ -66,7 +66,7 @@ var (
// CheckResourceLoad checks the SDK is resource load status.
func CheckResourceLoad(uSDK *LoginMgr, funcName string) error {
if uSDK == nil {
return utils.Wrap(errors.New("CheckResourceLoad failed uSDK == nil "), "")
return errs.New("SDK not initialized,userForSDK is nil", "funcName", funcName).Wrap()
}
if funcName == "" {
return nil
Expand All @@ -75,9 +75,8 @@ func CheckResourceLoad(uSDK *LoginMgr, funcName string) error {
if parts[len(parts)-1] == "Login-fm" {
return nil
}
if uSDK.Friend() == nil || uSDK.User() == nil || uSDK.Group() == nil || uSDK.Conversation() == nil ||
uSDK.Full() == nil {
return utils.Wrap(errors.New("CheckResourceLoad failed, resource nil "), "")
if uSDK.getLoginStatus(context.Background()) != Logged {
return errs.New("SDK not logged in", "funcName", funcName).Wrap()
}
return nil
}
Expand Down Expand Up @@ -316,7 +315,7 @@ func (u *LoginMgr) handlerSendingMsg(ctx context.Context, sendingMsg *model_stru
}
if latestMsg.ClientMsgID == sendingMsg.ClientMsgID {
latestMsg.Status = constant.MsgStatusSendFailed
conversation.LatestMsg = utils.StructToJsonString(latestMsg)
conversation.LatestMsg = jsonutil.StructToJsonString(latestMsg)
return u.db.UpdateConversation(ctx, conversation)
}
return nil
Expand Down

0 comments on commit 53c2ae2

Please sign in to comment.