Skip to content

Commit

Permalink
fix: reset branch. (#1277)
Browse files Browse the repository at this point in the history
* fix: to start im or chat, ZooKeeper must be started first.

* fix: msg gateway start output err info

Signed-off-by: Gordon <[email protected]>

* fix: msg gateway start output err info

Signed-off-by: Gordon <[email protected]>

* chore: package path changes

Signed-off-by: withchao <[email protected]>

* fix: go mod update

Signed-off-by: Gordon <[email protected]>

* fix: token update

Signed-off-by: Gordon <[email protected]>

* chore: package path changes

Signed-off-by: withchao <[email protected]>

* chore: package path changes

Signed-off-by: withchao <[email protected]>

* fix: token update

Signed-off-by: Gordon <[email protected]>

* fix: token update

Signed-off-by: Gordon <[email protected]>

* fix: token update

Signed-off-by: Gordon <[email protected]>

* fix: token update

Signed-off-by: Gordon <[email protected]>

* fix: token update

Signed-off-by: Gordon <[email protected]>

* fix: token update

Signed-off-by: Gordon <[email protected]>

* fix: get all userID

Signed-off-by: Gordon <[email protected]>

* fix: msggateway add online status call

Signed-off-by: Gordon <[email protected]>

* refactor: log change

Signed-off-by: Gordon <[email protected]>

* refactor: log change

Signed-off-by: Gordon <[email protected]>

* chore: network mode change

Signed-off-by: Gordon <[email protected]>

* 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 <[email protected]>

* feat: remove go work sum

Signed-off-by: Gordon <[email protected]>

* 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 <[email protected]>

* fix: check msg-transfer script

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix:  script update

Signed-off-by: Gordon <[email protected]>

* fix: start don't kill old process

Signed-off-by: Gordon <[email protected]>

* cicd: robot automated Change

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: check component

Signed-off-by: Gordon <[email protected]>

* fix: pull message set isRead only message come from single.

Signed-off-by: Gordon <[email protected]>

* cicd: robot automated Change

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: multiple gateway kick user each other.

Signed-off-by: Gordon <[email protected]>

* fix: multiple gateway kick user each other.

Signed-off-by: Gordon <[email protected]>

* fix: multiple gateway kick user each other.

Signed-off-by: Gordon <[email protected]>

* fix: multiple gateway kick user each other.

Signed-off-by: Gordon <[email protected]>

* fix: multiple gateway kick user each other.

Signed-off-by: Gordon <[email protected]>

* fix: multiple gateway kick user each other.

Signed-off-by: Gordon <[email protected]>

* cicd: robot automated Change

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: multiple gateway kick user each other.

Signed-off-by: Gordon <[email protected]>

* fix: add ex field to update group info.

Signed-off-by: Gordon <[email protected]>

* cicd: robot automated Change

* cicd: robot automated Change

* refactor: change project module name.

Signed-off-by: Gordon <[email protected]>

* refactor: change project module name.

Signed-off-by: Gordon <[email protected]>

* refactor: change project module name.

Signed-off-by: Gordon <[email protected]>

* cicd: robot automated Change

* test: for pressure test.

Signed-off-by: Gordon <[email protected]>

* test: for pressure test.

Signed-off-by: Gordon <[email protected]>

* test: for pressure test.

Signed-off-by: Gordon <[email protected]>

* test: message log.

Signed-off-by: Gordon <[email protected]>

* cicd: robot automated Change

* fxi: component check output valid info.

Signed-off-by: Gordon <[email protected]>

* fxi: component check output valid info.

Signed-off-by: Gordon <[email protected]>

* test: send message test log.

Signed-off-by: Gordon <[email protected]>

* cicd: robot automated Change

* cicd: robot automated Change

* test: remove info log.

Signed-off-by: Gordon <[email protected]>

* feat: api of send message add sendTime field.

Signed-off-by: Gordon <[email protected]>

* fix: add callback for update user's info.

* cicd: robot automated Change

* fix: change callback command name.

* cicd: robot automated Change

* fix: single chat unread status change.

* fix: single chat unread status change.

* fix: single chat unread status change.

* fix: user status change.

* cicd: robot automated Change

* fix: user status change.

* fix: user status change.

* fix: user status change.

* cicd: robot automated Change

* fix: ws close when user logout.

* fix: remove repeat platform on online status.

* cicd: robot automated Change

* fix: api send messages for notification conversation .

* fix: api send messages for notification conversation .

* fix: api send messages for notification conversation .

* fix: api send messages for notification conversation .

* fix: api send messages for notification conversation .

* fix: api send messages for notification conversation.

* fix: api send messages for notification conversation.

* fix: api send messages for notification conversation.

* fix: api send messages for notification conversation.

* fix: api send messages for notification conversation.

* fix: api send messages for notification conversation.

* re: remove router of unsubscribeStatus.

* re: remove router of unsubscribeStatus.

* re: remove router of unsubscribeStatus.

* re: remove router of unsubscribeStatus.

* fix: reset branch

* fix: not support redis cluster. CROSSSLOT Keys in request don't hash to the same slot

* fix: update user.FaceURL do not trigger GroupMemberInfoSetNotification

* cicd: robot automated Change

* fix: api send messages for notification conversation.

* fix: api send messages for notification conversation.

---------

Signed-off-by: Gordon <[email protected]>
Signed-off-by: withchao <[email protected]>
Signed-off-by: Gordon <[email protected]>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: withchao <[email protected]>
Co-authored-by: Xinwei Xiong <[email protected]>
Co-authored-by: FGadvancer <[email protected]>
Co-authored-by: withchao <[email protected]>
  • Loading branch information
5 people authored Oct 24, 2023
1 parent 8a13017 commit cb03943
Show file tree
Hide file tree
Showing 91 changed files with 778 additions and 1,441 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ linters-settings:

nestif:
# minimal complexity of if statements to report, 5 by default
min-complexity: 6
min-complexity: 4

nilnil:
# By default, nilnil checks all returned types below.
Expand Down
1 change: 0 additions & 1 deletion cmd/openim-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/OpenIMSDK/protocol/constant"
"github.com/OpenIMSDK/tools/discoveryregistry"
"github.com/OpenIMSDK/tools/log"

"github.com/openimsdk/open-im-server/v3/internal/api"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
Expand Down
8 changes: 3 additions & 5 deletions go.work
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
go 1.19


use (
.
./test/typecheck
./tools/changelog
./tools/component
./tools/data-conversion
./tools/imctl
//./tools/imctl
./tools/infra
./tools/ncpu
./tools/openim-web
./tools/url2im
./tools/versionchecker
./tools/yamlfmt
./tools/component
./tools/url2im
./tools/data-conversion
)
9 changes: 4 additions & 5 deletions internal/msgtransfer/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ package msgtransfer

import (
"fmt"
"sync"

"github.com/openimsdk/open-im-server/v3/pkg/common/discovery_register"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

"github.com/openimsdk/open-im-server/v3/pkg/common/discovery_register"
"sync"

"github.com/OpenIMSDK/tools/mw"

Expand Down Expand Up @@ -65,7 +63,8 @@ func StartTransfer(prometheusPort int) error {
/*
client, err := openkeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema,
openkeeper.WithFreq(time.Hour), openkeeper.WithRoundRobin(), openkeeper.WithUserNameAndPassword(config.Config.Zookeeper.Username,
config.Config.Zookeeper.Password), openkeeper.WithTimeout(10), openkeeper.WithLogger(log.NewZkLogger()))*/if err != nil {
config.Config.Zookeeper.Password), openkeeper.WithTimeout(10), openkeeper.WithLogger(log.NewZkLogger()))*/
if err != nil {
return err
}
if err := client.CreateRpcRootNodes(config.Config.GetServiceNames()); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion internal/rpc/msg/as_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func (m *msgServer) MarkConversationAsRead(
for i := hasReadSeq + 1; i <= req.HasReadSeq; i++ {
seqs = append(seqs, i)
}

if len(seqs) > 0 {
log.ZDebug(ctx, "MarkConversationAsRead", "seqs", seqs, "conversationID", req.ConversationID)
if err = m.MsgDatabase.MarkSingleChatMsgsAsRead(ctx, req.UserID, req.ConversationID, seqs); err != nil {
Expand All @@ -164,7 +165,6 @@ func (m *msgServer) MarkConversationAsRead(
m.conversationAndGetRecvID(conversation, req.UserID), seqs, hasReadSeq); err != nil {
return nil, err
}

} else if conversation.ConversationType == constant.SuperGroupChatType ||
conversation.ConversationType == constant.NotificationChatType {
if req.HasReadSeq > hasReadSeq {
Expand All @@ -178,6 +178,7 @@ func (m *msgServer) MarkConversationAsRead(
req.UserID, seqs, hasReadSeq); err != nil {
return nil, err
}

}

return &msg.MarkConversationAsReadResp{}, nil
Expand Down
9 changes: 3 additions & 6 deletions internal/rpc/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ func (s *userServer) SubscribeOrCancelUsersStatus(ctx context.Context, req *pbus

// GetUserStatus Get the online status of the user.
func (s *userServer) GetUserStatus(ctx context.Context, req *pbuser.GetUserStatusReq) (resp *pbuser.GetUserStatusResp,
err error,
) {
err error) {
onlineStatusList, err := s.UserDatabase.GetUserStatus(ctx, req.UserIDs)
if err != nil {
return nil, err
Expand All @@ -301,8 +300,7 @@ func (s *userServer) GetUserStatus(ctx context.Context, req *pbuser.GetUserStatu

// SetUserStatus Synchronize user's online status.
func (s *userServer) SetUserStatus(ctx context.Context, req *pbuser.SetUserStatusReq) (resp *pbuser.SetUserStatusResp,
err error,
) {
err error) {
err = s.UserDatabase.SetUserStatus(ctx, req.UserID, req.Status, req.PlatformID)
if err != nil {
return nil, err
Expand All @@ -326,8 +324,7 @@ func (s *userServer) SetUserStatus(ctx context.Context, req *pbuser.SetUserStatu

// GetSubscribeUsersStatus Get the online status of subscribers.
func (s *userServer) GetSubscribeUsersStatus(ctx context.Context,
req *pbuser.GetSubscribeUsersStatusReq,
) (*pbuser.GetSubscribeUsersStatusResp, error) {
req *pbuser.GetSubscribeUsersStatusReq) (*pbuser.GetSubscribeUsersStatusResp, error) {
userList, err := s.UserDatabase.GetAllSubscribeList(ctx, req.UserID)
if err != nil {
return nil, err
Expand Down
6 changes: 2 additions & 4 deletions internal/tools/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ package tools
import (
"context"
"fmt"
"math"

"github.com/openimsdk/open-im-server/v3/pkg/common/discovery_register"
"github.com/redis/go-redis/v9"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

"github.com/openimsdk/open-im-server/v3/pkg/common/discovery_register"
"math"

"github.com/OpenIMSDK/tools/errs"
"github.com/OpenIMSDK/tools/log"
Expand Down
3 changes: 0 additions & 3 deletions pkg/authverify/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func CheckAccessV3(ctx context.Context, ownerUserID string) (err error) {
if opUserID == ownerUserID {
return nil
}

return errs.ErrNoPermission.Wrap(utils.GetSelfFuncName())
}

Expand All @@ -53,7 +52,6 @@ func CheckAdmin(ctx context.Context) error {
if utils.IsContain(mcontext.GetOpUserID(ctx), config.Config.Manager.UserID) {
return nil
}

return errs.ErrNoPermission.Wrap(fmt.Sprintf("user %s is not admin userID", mcontext.GetOpUserID(ctx)))
}

Expand All @@ -76,6 +74,5 @@ func WsVerifyToken(token, userID string, platformID int) error {
if claim.PlatformID != platformID {
return errs.ErrTokenInvalid.Wrap(fmt.Sprintf("token platform %d != %d", claim.PlatformID, platformID))
}

return nil
}
1 change: 0 additions & 1 deletion pkg/callbackstruct/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func (c CommonCallbackResp) Parse() error {
if c.ActionCode != errs.NoError || c.ErrCode != errs.NoError {
return errs.NewCodeError(int(c.ErrCode), c.ErrMsg).WithDetail(c.ErrDlt)
}

return nil
}

Expand Down
9 changes: 4 additions & 5 deletions pkg/common/cmd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ package cmd

import (
"fmt"

"github.com/OpenIMSDK/protocol/constant"
"github.com/spf13/cobra"

config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config"
"github.com/spf13/cobra"
)

type ApiCmd struct {
Expand All @@ -44,7 +42,8 @@ func (a *ApiCmd) GetPortFromConfig(portType string) int {
fmt.Println("GetPortFromConfig:", portType)
if portType == constant.FlagPort {
return config2.Config.Api.OpenImApiPort[0]
}
} else {

return 0
return 0
}
}
2 changes: 0 additions & 2 deletions pkg/common/cmd/cron_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ type CronTaskCmd struct {
func NewCronTaskCmd() *CronTaskCmd {
ret := &CronTaskCmd{NewRootCmd("cronTask", WithCronTaskLogName())}
ret.SetRootCmdPt(ret)

return ret
}

Expand All @@ -35,6 +34,5 @@ func (c *CronTaskCmd) addRunE(f func() error) {

func (c *CronTaskCmd) Exec(f func() error) error {
c.addRunE(f)

return c.Execute()
}
4 changes: 0 additions & 4 deletions pkg/common/cmd/msg_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type MsgGatewayCmd struct {
func NewMsgGatewayCmd() *MsgGatewayCmd {
ret := &MsgGatewayCmd{NewRootCmd("msgGateway")}
ret.SetRootCmdPt(ret)

return ret
}

Expand All @@ -44,7 +43,6 @@ func (m *MsgGatewayCmd) getWsPortFlag(cmd *cobra.Command) int {
if port == 0 {
port = m.PortFromConfig(constant.FlagWsPort)
}

return port
}

Expand All @@ -56,10 +54,8 @@ func (m *MsgGatewayCmd) addRunE() {

func (m *MsgGatewayCmd) Exec() error {
m.addRunE()

return m.Execute()
}

func (m *MsgGatewayCmd) GetPortFromConfig(portType string) int {
if portType == constant.FlagWsPort {
return config2.Config.LongConnSvr.OpenImWsPort[0]
Expand Down
2 changes: 0 additions & 2 deletions pkg/common/cmd/msg_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type MsgTransferCmd struct {
func NewMsgTransferCmd() *MsgTransferCmd {
ret := &MsgTransferCmd{NewRootCmd("msgTransfer")}
ret.SetRootCmdPt(ret)

return ret
}

Expand All @@ -39,6 +38,5 @@ func (m *MsgTransferCmd) addRunE() {

func (m *MsgTransferCmd) Exec() error {
m.addRunE()

return m.Execute()
}
27 changes: 21 additions & 6 deletions pkg/common/cmd/msg_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

type MsgUtilsCmd struct {
cobra.Command
// msgTool *tools.MsgTool
msgTool *tools.MsgTool
}

func (m *MsgUtilsCmd) AddUserIDFlag() {
Expand All @@ -31,36 +31,54 @@ func (m *MsgUtilsCmd) AddUserIDFlag() {

func (m *MsgUtilsCmd) getUserIDFlag(cmdLines *cobra.Command) string {
userID, _ := cmdLines.Flags().GetString("userID")

return userID
}

func (m *MsgUtilsCmd) AddFixAllFlag() {
m.Command.PersistentFlags().BoolP("fixAll", "f", false, "openIM fix all seqs")
}

func (m *MsgUtilsCmd) getFixAllFlag(cmdLines *cobra.Command) bool {
fixAll, _ := cmdLines.Flags().GetBool("fixAll")
return fixAll
}

func (m *MsgUtilsCmd) AddClearAllFlag() {
m.Command.PersistentFlags().BoolP("clearAll", "c", false, "openIM clear all seqs")
}

func (m *MsgUtilsCmd) getClearAllFlag(cmdLines *cobra.Command) bool {
clearAll, _ := cmdLines.Flags().GetBool("clearAll")
return clearAll
}

func (m *MsgUtilsCmd) AddSuperGroupIDFlag() {
m.Command.PersistentFlags().StringP("superGroupID", "g", "", "openIM superGroupID")
}

func (m *MsgUtilsCmd) getSuperGroupIDFlag(cmdLines *cobra.Command) string {
superGroupID, _ := cmdLines.Flags().GetString("superGroupID")

return superGroupID
}

func (m *MsgUtilsCmd) AddBeginSeqFlag() {
m.Command.PersistentFlags().Int64P("beginSeq", "b", 0, "openIM beginSeq")
}

func (m *MsgUtilsCmd) getBeginSeqFlag(cmdLines *cobra.Command) int64 {
beginSeq, _ := cmdLines.Flags().GetInt64("beginSeq")
return beginSeq
}

func (m *MsgUtilsCmd) AddLimitFlag() {
m.Command.PersistentFlags().Int64P("limit", "l", 0, "openIM limit")
}

func (m *MsgUtilsCmd) getLimitFlag(cmdLines *cobra.Command) int64 {
limit, _ := cmdLines.Flags().GetInt64("limit")
return limit
}

func (m *MsgUtilsCmd) Execute() error {
return m.Command.Execute()
}
Expand Down Expand Up @@ -113,7 +131,6 @@ func NewSeqCmd() *SeqCmd {
seqCmd := &SeqCmd{
NewMsgUtilsCmd("seq", "seq", nil),
}

return seqCmd
}

Expand Down Expand Up @@ -141,7 +158,6 @@ func (s *SeqCmd) GetSeqCmd() *cobra.Command {
// println(seq)
}
}

return &s.Command
}

Expand All @@ -157,7 +173,6 @@ func NewMsgCmd() *MsgCmd {
msgCmd := &MsgCmd{
NewMsgUtilsCmd("msg", "msg", nil),
}

return msgCmd
}

Expand Down
Loading

0 comments on commit cb03943

Please sign in to comment.