From 0bf076bb05bfd2bfcf5ee5e2c95a3fce6a62e3f1 Mon Sep 17 00:00:00 2001 From: chao <48119764+withchao@users.noreply.github.com> Date: Sat, 8 Feb 2025 10:36:00 +0800 Subject: [PATCH 1/3] fix: the user sets the conversation timer cleanup timestamp unit incorrectly (#3102) * 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 * fix: fill send time * fix: fill send time * fix: crash caused by withdrawing messages from users who have left the group * fix: user msg timestamp --- internal/rpc/conversation/conversation.go | 5 +++-- pkg/common/storage/database/mgo/conversation.go | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/rpc/conversation/conversation.go b/internal/rpc/conversation/conversation.go index 53364ff86..76dd606aa 100644 --- a/internal/rpc/conversation/conversation.go +++ b/internal/rpc/conversation/conversation.go @@ -16,10 +16,11 @@ package conversation import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/rpcli" "sort" "time" + "github.com/openimsdk/open-im-server/v3/pkg/rpcli" + "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/database/mgo" @@ -773,7 +774,7 @@ func (c *conversationServer) ClearUserConversationMsg(ctx context.Context, req * if conversation.IsMsgDestruct == false || conversation.MsgDestructTime == 0 { continue } - seq, err := c.msgClient.GetLastMessageSeqByTime(ctx, conversation.ConversationID, req.Timestamp-conversation.MsgDestructTime) + seq, err := c.msgClient.GetLastMessageSeqByTime(ctx, conversation.ConversationID, req.Timestamp-(conversation.MsgDestructTime*1000)) if err != nil { return nil, err } diff --git a/pkg/common/storage/database/mgo/conversation.go b/pkg/common/storage/database/mgo/conversation.go index 851ec99c4..536827450 100644 --- a/pkg/common/storage/database/mgo/conversation.go +++ b/pkg/common/storage/database/mgo/conversation.go @@ -243,7 +243,14 @@ func (c *ConversationMgo) FindRandConversation(ctx context.Context, ts int64, li "$add": []any{ bson.M{ "$toLong": "$latest_msg_destruct_time", - }, "$msg_destruct_time"}, + }, + bson.M{ + "$multiply": []any{ + "$msg_destruct_time", + 1000, // convert to milliseconds + }, + }, + }, }, }, }, From ad8829c5a6d267f29fe0e506b962d86ad8ab1cdc Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Sat, 8 Feb 2025 12:03:29 +0800 Subject: [PATCH 2/3] build: keep conflict is true. (#3103) --- .github/workflows/merge-from-milestone.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/merge-from-milestone.yml b/.github/workflows/merge-from-milestone.yml index 8e09c9ab7..67aafcf0d 100644 --- a/.github/workflows/merge-from-milestone.yml +++ b/.github/workflows/merge-from-milestone.yml @@ -113,14 +113,26 @@ jobs: echo "Cherry-picking commit: $merge_commit" if ! git cherry-pick "$merge_commit" --strategy=recursive -X theirs; then - echo "Cherry-pick encountered conflicts, attempting to continue..." - git cherry-pick --continue || { echo "Cherry-pick failed"; exit 1; } + echo "Cherry-pick encountered conflicts, attempting to resolve..." + git status --porcelain | grep '^UU ' | cut -c 4- | while read -r file; do + echo "Resolving conflict in $file" + git add "$file" + done + git status --porcelain | grep '^AA ' | cut -c 4- | while read -r file; do + echo "Adding new file $file" + git add "$file" + done + git status --porcelain | grep '^DD ' | cut -c 4- | while read -r file; do + echo "Removing deleted file $file" + git rm "$file" + done + git cherry-pick --continue || { echo "Cherry-pick failed"; continue; } fi git remote set-url origin "https://${BOT_TOKEN}@github.com/${{ github.repository }}.git" echo "Pushing branch: $cherry_pick_branch" - git push origin $cherry_pick_branch --force || { echo "Push failed"; exit 1; } + git push origin $cherry_pick_branch --force || { echo "Push failed"; continue; } new_pr_title="$pr_title [Created by @$pr_creator from #$pr_number]" new_pr_body="$pr_body From 489571f4b6cdb8c8906a15aab4ad3fefa38ffbda Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Sat, 8 Feb 2025 15:26:35 +0800 Subject: [PATCH 3/3] fix: solve stop when merge failed (#3106) --- .github/workflows/merge-from-milestone.yml | 35 +++++++++++++--------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/merge-from-milestone.yml b/.github/workflows/merge-from-milestone.yml index 67aafcf0d..1f5762ccb 100644 --- a/.github/workflows/merge-from-milestone.yml +++ b/.github/workflows/merge-from-milestone.yml @@ -113,26 +113,33 @@ jobs: echo "Cherry-picking commit: $merge_commit" if ! git cherry-pick "$merge_commit" --strategy=recursive -X theirs; then - echo "Cherry-pick encountered conflicts, attempting to resolve..." - git status --porcelain | grep '^UU ' | cut -c 4- | while read -r file; do - echo "Resolving conflict in $file" - git add "$file" + echo "Conflict detected for $merge_commit. Resolving with incoming changes." + conflict_files=$(git diff --name-only --diff-filter=U) + echo "Conflicting files:" + echo "$conflict_files" + + for file in $conflict_files; do + if [ -f "$file" ]; then + echo "Resolving conflict for $file" + git add "$file" + else + echo "File $file has been deleted. Skipping." + git rm "$file" + fi done - git status --porcelain | grep '^AA ' | cut -c 4- | while read -r file; do - echo "Adding new file $file" - git add "$file" - done - git status --porcelain | grep '^DD ' | cut -c 4- | while read -r file; do - echo "Removing deleted file $file" - git rm "$file" - done - git cherry-pick --continue || { echo "Cherry-pick failed"; continue; } + + echo "Conflicts resolved. Continuing cherry-pick." + git cherry-pick --continue || { echo "Cherry-pick failed, but continuing to create PR."; } + else + echo "Cherry-pick successful for commit $merge_commit." fi git remote set-url origin "https://${BOT_TOKEN}@github.com/${{ github.repository }}.git" echo "Pushing branch: $cherry_pick_branch" - git push origin $cherry_pick_branch --force || { echo "Push failed"; continue; } + if ! git push origin $cherry_pick_branch --force; then + echo "Push failed, but continuing to create PR..." + fi new_pr_title="$pr_title [Created by @$pr_creator from #$pr_number]" new_pr_body="$pr_body