From 4f1dacabfa5c16b3e4cd0c66d7b6ca87228d6f4a Mon Sep 17 00:00:00 2001 From: EthanForAi <128460220+EthanForAi@users.noreply.github.com> Date: Thu, 17 Aug 2023 20:43:58 +0800 Subject: [PATCH 1/3] Feat/686: add release process (#891) * feat: add pre-release process * docs: add release process --------- Co-authored-by: skiffer-git <44203734@qq.com> --- docs/conversions/version.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/conversions/version.md b/docs/conversions/version.md index 06b2e17cb..490c8e4a7 100644 --- a/docs/conversions/version.md +++ b/docs/conversions/version.md @@ -104,9 +104,21 @@ git merge release-v3.1 # Push the updates to the main branch git push origin main ``` +## Release Process + +``` +Publishing v3.2.0: A Step-by-Step Guide +(1) Create the tag v3.2.0-alpha.0 from the main branch. +(2) Bugs are fixed on the main branch. Once the bugs are resolved, tag the main branch as v3.2.0-rc.0. +(3) After further testing, if v3.2.0-rc.0 is deemed stable, create a branch named release-v3.2 from the tag v3.2.0-rc.0. +(4) From the release-v3.2 branch, create the tag v3.2.0. At this point, the official release of v3.2.0 is complete. + +After the release of v3.2.0, if urgent bugs are discovered, fix them on the release-v3.2 branch. Then, submit two pull requests (PRs) to both the main and release-v3.2 branches. Tag the release-v3.2 branch as v3.2.1. +``` Throughout this process, active communication within the team is pivotal to maintaining transparency and consensus on changes. ## Docker Images Version Management For more details on managing Docker image versions, visit [OpenIM Docker Images Administration](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md). + From 958afd61150f183e3aeb4ea228a02f5b2be6749a Mon Sep 17 00:00:00 2001 From: Gordon <46924906+FGadvancer@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:22:27 +0800 Subject: [PATCH 2/3] fix: start don't kill old process (#892) * fix: to start im or chat, ZooKeeper must be started first. * fix: msg gateway start output err info Signed-off-by: Gordon <1432970085@qq.com> * fix: msg gateway start output err info Signed-off-by: Gordon <1432970085@qq.com> * chore: package path changes Signed-off-by: withchao <993506633@qq.com> * fix: go mod update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * chore: package path changes Signed-off-by: withchao <993506633@qq.com> * chore: package path changes Signed-off-by: withchao <993506633@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: get all userID Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: msggateway add online status call Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * refactor: log change Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * refactor: log change Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * chore: network mode change Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: add api of get server time Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * feat: remove go work sum Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: pull message add isRead field Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: check msg-transfer script Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: start don't kill old process Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> --------- Signed-off-by: Gordon <1432970085@qq.com> Signed-off-by: withchao <993506633@qq.com> Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: withchao <993506633@qq.com> Co-authored-by: Xinwei Xiong <3293172751NSS@gmail.com> Co-authored-by: FGadvancer --- scripts/msg_gateway_start.sh | 10 +++++----- scripts/msg_transfer_start.sh | 12 ++++++------ scripts/push_start.sh | 10 +++++----- scripts/start_cron.sh | 10 +++++----- scripts/start_rpc_service.sh | 16 ++++++++-------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/scripts/msg_gateway_start.sh b/scripts/msg_gateway_start.sh index aa9c2f0ff..f5aa00a4e 100755 --- a/scripts/msg_gateway_start.sh +++ b/scripts/msg_gateway_start.sh @@ -50,11 +50,11 @@ if [ ${#rpc_ports[@]} -ne ${#ws_ports[@]} ]; then fi #Check if the service exists #If it is exists,kill this process -check=$(ps aux | grep -w ./${openim_msggateway} | grep -v grep | wc -l) -if [ $check -ge 1 ]; then - oldPid=$(ps aux | grep -w ./${openim_msggateway} | grep -v grep | awk '{print $2}') - kill -9 ${oldPid} -fi +#check=$(ps aux | grep -w ./${openim_msggateway} | grep -v grep | wc -l) +#if [ $check -ge 1 ]; then +# oldPid=$(ps aux | grep -w ./${openim_msggateway} | grep -v grep | awk '{print $2}') +# kill -9 ${oldPid} +#fi #Waiting port recycling sleep 1 cd ${msg_gateway_binary_root} diff --git a/scripts/msg_transfer_start.sh b/scripts/msg_transfer_start.sh index f287ff8fe..c0a24104a 100755 --- a/scripts/msg_transfer_start.sh +++ b/scripts/msg_transfer_start.sh @@ -37,12 +37,12 @@ prome_ports=($ports_array) #Check if the service exists #If it is exists,kill this process -check=`ps | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l` -if [ $check -ge 1 ] -then -oldPid=`ps | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'` - kill -9 $oldPid -fi +#check=`ps | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l` +#if [ $check -ge 1 ] +#then +#oldPid=`ps | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'` +# kill -9 $oldPid +#fi #Waiting port recycling sleep 1 diff --git a/scripts/push_start.sh b/scripts/push_start.sh index 37629c70f..d3c2f9a8f 100755 --- a/scripts/push_start.sh +++ b/scripts/push_start.sh @@ -44,11 +44,11 @@ prome_ports=($ports_array) #Check if the service exists #If it is exists,kill this process -check=$(ps | grep -w ./${push_name} | grep -v grep | wc -l) -if [ $check -ge 1 ]; then - oldPid=$(ps | grep -w ./${push_name} | grep -v grep | awk '{print $2}') - kill -9 $oldPid -fi +#check=$(ps | grep -w ./${push_name} | grep -v grep | wc -l) +#if [ $check -ge 1 ]; then +# oldPid=$(ps | grep -w ./${push_name} | grep -v grep | awk '{print $2}') +# kill -9 $oldPid +#fi #Waiting port recycling sleep 1 cd ${push_binary_root} diff --git a/scripts/start_cron.sh b/scripts/start_cron.sh index de964fff4..41b86b4a4 100755 --- a/scripts/start_cron.sh +++ b/scripts/start_cron.sh @@ -35,11 +35,11 @@ logs_dir="$OPENIM_ROOT/logs" #Check if the service exists #If it is exists,kill this process check=`ps | grep -w ./${cron_task_name} | grep -v grep| wc -l` -if [ $check -ge 1 ] -then -oldPid=`ps | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'` - kill -9 $oldPid -fi +#if [ $check -ge 1 ] +#then +#oldPid=`ps | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'` +# kill -9 $oldPid +#fi #Waiting port recycling sleep 1 diff --git a/scripts/start_rpc_service.sh b/scripts/start_rpc_service.sh index 51e13298f..a26f6cf87 100755 --- a/scripts/start_rpc_service.sh +++ b/scripts/start_rpc_service.sh @@ -78,14 +78,14 @@ for ((i = 0; i < ${#service_filename[*]}; i++)); do service_name="ps |grep -w ${service_filename[$i]} |grep -v grep" count="${service_name}| wc -l" - if [ $(eval ${count}) -gt 0 ]; then - pid="${service_name}| awk '{print \$2}'" - echo "${service_filename[$i]} service has been started,pid:$(eval $pid)" - echo "killing the service ${service_filename[$i]} pid:$(eval $pid)" - #kill the service that existed - kill -9 $(eval $pid) - sleep 0.5 - fi +# if [ $(eval ${count}) -gt 0 ]; then +# pid="${service_name}| awk '{print \$2}'" +# echo "${service_filename[$i]} service has been started,pid:$(eval $pid)" +# echo "killing the service ${service_filename[$i]} pid:$(eval $pid)" +# #kill the service that existed +# kill -9 $(eval $pid) +# sleep 0.5 +# fi cd $OPENIM_ROOT cd $BIN_DIR # Get the rpc port in the configuration file From 8b365ae49f2a6e148988f878f88d842851b016d1 Mon Sep 17 00:00:00 2001 From: Alan <68671759+hanzhixiao@users.noreply.github.com> Date: Fri, 18 Aug 2023 18:44:18 +0800 Subject: [PATCH 3/3] Searchmsg (#859) * fix:searchmsg Signed-off-by: hanzhixiao <709674996@qq.com> * fix:searchmsg Signed-off-by: hanzhixiao <709674996@qq.com> --------- Signed-off-by: hanzhixiao <709674996@qq.com> --- pkg/common/db/unrelation/msg.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/common/db/unrelation/msg.go b/pkg/common/db/unrelation/msg.go index ce51ca49c..a1594ecc8 100644 --- a/pkg/common/db/unrelation/msg.go +++ b/pkg/common/db/unrelation/msg.go @@ -19,6 +19,7 @@ import ( "encoding/json" "errors" "fmt" + "github.com/OpenIMSDK/tools/log" "time" "github.com/OpenIMSDK/protocol/msg" @@ -1166,9 +1167,7 @@ func (m *MsgMongoDriver) searchMessage(ctx context.Context, req *msg.SearchMessa if err != nil { return 0, nil, err } - if len(msgsDocs) == 0 { - return 0, nil, errs.Wrap(mongo.ErrNoDocuments) - } + log.ZDebug(ctx, "query mongoDB", "result", msgsDocs) msgs := make([]*table.MsgInfoModel, 0) for index := range msgsDocs { msgInfo := msgsDocs[index].Msg @@ -1207,7 +1206,9 @@ func (m *MsgMongoDriver) searchMessage(ctx context.Context, req *msg.SearchMessa } start := (req.Pagination.PageNumber - 1) * req.Pagination.ShowNumber n := int32(len(msgs)) - if start+req.Pagination.ShowNumber < n { + if start >= n { + return n, []*table.MsgInfoModel{}, nil + } else if start+req.Pagination.ShowNumber < n { msgs = msgs[start : start+req.Pagination.ShowNumber] } else { msgs = msgs[start:]