Skip to content

Commit 9cffe57

Browse files
committed
fix: server downtime and abnormal message handling may lead to message duplication, and the history retrieval interface might miss messages when the timestamps are the same.
Signed-off-by: Gordon <[email protected]>
2 parents d3b881b + 4431c84 commit 9cffe57

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

.github/workflows/go-build-test.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616
permissions:
1717
contents: write
18-
# pull-requests: write
1918
strategy:
2019
matrix:
2120
os: [ubuntu-latest]
@@ -36,7 +35,6 @@ jobs:
3635
go generate ./...
3736
cd wasm/cmd && make wasm
3837
39-
4038
# TODO: add coverage test
4139
go-test:
4240
name: Benchmark Test with go ${{ matrix.go_version }} on ${{ matrix.os }}
@@ -49,8 +47,8 @@ jobs:
4947
# pull-requests: write
5048
strategy:
5149
matrix:
52-
os: [ ubuntu-latest ]
53-
go_version: [ "1.22.x" ]
50+
os: [ubuntu-latest]
51+
go_version: ["1.22.x"]
5452

5553
steps:
5654
- name: Checkout SDK repository
@@ -59,7 +57,7 @@ jobs:
5957
- name: Checkout Server repository
6058
uses: actions/checkout@v4
6159
with:
62-
repository: 'openimsdk/open-im-server'
60+
repository: "openimsdk/open-im-server"
6361
path: ${{ env.SERVER_DIR }}
6462

6563
- name: Set up Go ${{ matrix.go_version }}

.github/workflows/merge-from-milestone.yml

+23-10
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ on:
1111
milestone_name:
1212
description: "Milestone name to collect closed PRs from"
1313
required: true
14-
default: "v3.8.3"
14+
default: "v3.8.4"
1515
target_branch:
1616
description: "Target branch to merge the consolidated PR"
1717
required: true
18-
default: "pre-release-v3.8.3"
18+
default: "pre-release-v3.8.4"
1919

2020
env:
21-
MILESTONE_NAME: ${{ github.event.inputs.milestone_name || 'v3.8.3' }}
22-
TARGET_BRANCH: ${{ github.event.inputs.target_branch || 'pre-release-v3.8.3' }}
21+
MILESTONE_NAME: ${{ github.event.inputs.milestone_name || 'v3.8.4' }}
22+
TARGET_BRANCH: ${{ github.event.inputs.target_branch || 'pre-release-v3.8.4' }}
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
2525
LABEL_NAME: cherry-picked
26-
TEMP_DIR: /tmp # Using /tmp as the temporary directory
26+
TEMP_DIR: /tmp
2727

2828
jobs:
2929
merge_milestone_prs:
@@ -99,19 +99,32 @@ jobs:
9999
merge_commit=$(echo "$pr_details" | jq -r '.merge_commit_sha')
100100
short_commit_hash=$(echo "$merge_commit" | cut -c 1-7)
101101
102-
if [ "$merge_commit" != "null" ];then
102+
if [ "$merge_commit" != "null" ]; then
103103
git fetch origin
104+
105+
echo "Checking out target branch: $TARGET_BRANCH"
104106
git checkout $TARGET_BRANCH
107+
108+
echo "Pulling latest changes from target branch: $TARGET_BRANCH"
105109
git pull origin $TARGET_BRANCH
110+
106111
cherry_pick_branch="cherry-pick-${short_commit_hash}"
107112
git checkout -b $cherry_pick_branch
108-
git cherry-pick "$merge_commit" --strategy=recursive -X theirs || git cherry-pick --continue
113+
114+
echo "Cherry-picking commit: $merge_commit"
115+
if ! git cherry-pick "$merge_commit" --strategy=recursive -X theirs; then
116+
echo "Cherry-pick encountered conflicts, attempting to continue..."
117+
git cherry-pick --continue || { echo "Cherry-pick failed"; exit 1; }
118+
fi
119+
109120
git remote set-url origin "https://${BOT_TOKEN}@github.com/${{ github.repository }}.git"
110-
git push origin $cherry_pick_branch --force
121+
122+
echo "Pushing branch: $cherry_pick_branch"
123+
git push origin $cherry_pick_branch --force || { echo "Push failed"; exit 1; }
111124
112125
new_pr_title="$pr_title [Created by @$pr_creator from #$pr_number]"
113126
new_pr_body="$pr_body
114-
>This PR is created from original PR #$pr_number."
127+
> This PR is created from original PR #$pr_number."
115128
116129
response=$(curl -s -X POST -H "Authorization: token $BOT_TOKEN" \
117130
-H "Accept: application/vnd.github+json" \
@@ -130,4 +143,4 @@ jobs:
130143
-d '{"labels": ["milestone-merge"]}' \
131144
"https://api.github.com/repos/${{ github.repository }}/issues/$new_pr_number/labels"
132145
fi
133-
done
146+
done

0 commit comments

Comments
 (0)