Skip to content

Commit

Permalink
fix: conversation list will disappear when conversation version table…
Browse files Browse the repository at this point in the history
… has been deleted in server. (#610)

* 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>

* fix: conversation list will disappear when conversation version table has been deleted in server.

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

---------

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
  • Loading branch information
FGadvancer committed Jul 23, 2024
1 parent c44de6a commit 3f8a209
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion internal/conversation_msg/conversation_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ func (c *Conversation) doMsgNew(c2v common.Cmd2Value) {
continue
}
msg.Status = constant.MsgStatusSendSuccess
// msg.IsRead = false
//De-analyze data
err := c.msgHandleByContentType(msg)
if err != nil {
Expand Down
18 changes: 17 additions & 1 deletion internal/conversation_msg/sync2.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,23 @@ func (c *Conversation) IncrSyncConversations(ctx context.Context) error {
return c.conversationSyncer.Sync(ctx, server, local, nil, true)
},
FullSyncer: func(ctx context.Context) error {
return c.conversationSyncer.FullSync(ctx, c.loginUserID)
conversationIDList, err := c.db.GetAllConversationIDList(ctx)
if err != nil {
return err
}
if len(conversationIDList) == 0 {
return c.conversationSyncer.FullSync(ctx, c.loginUserID)
} else {
local, err := c.db.GetAllConversations(ctx)
if err != nil {
return err
}
server, err := c.getServerConversationList(ctx)
if err != nil {
return err
}
return c.conversationSyncer.Sync(ctx, server, local, nil, true)
}
},
FullID: func(ctx context.Context) ([]string, error) {
resp, err := util.CallApi[pbConversation.GetFullOwnerConversationIDsResp](ctx, constant.GetFullConversationIDs, &pbConversation.GetFullOwnerConversationIDsReq{
Expand Down

0 comments on commit 3f8a209

Please sign in to comment.