Skip to content

Commit

Permalink
fix: wasm db close
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon <1432970085@qq.com>
  • Loading branch information
FGadvancer committed Jul 27, 2023
1 parent acf5d9c commit 995d610
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 42 deletions.
22 changes: 10 additions & 12 deletions testv2/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
package testv2

import (
"github.com/OpenIMSDK/protocol/group"
"github.com/OpenIMSDK/protocol/sdkws"
"github.com/OpenIMSDK/protocol/wrapperspb"
"open_im_sdk/open_im_sdk"
"open_im_sdk/pkg/constant"
"open_im_sdk/pkg/sdk_params_callback"
"testing"
"time"

"github.com/OpenIMSDK/protocol/group"
"github.com/OpenIMSDK/protocol/sdkws"
"github.com/OpenIMSDK/protocol/wrapperspb"
)

func Test_CreateGroupV2(t *testing.T) {
Expand Down Expand Up @@ -241,13 +239,13 @@ func Test_InviteUserToGroup(t *testing.T) {
t.Log("InviteUserToGroup success", ctx.Value("operationID"))
}

func Test_SyncGroup(t *testing.T) {
err := open_im_sdk.UserForSDK.Group().SyncGroupMember(ctx, "3179997540")
if err != nil {
t.Fatal(err)
}
time.Sleep(time.Second * 100000)
}
//func Test_SyncGroup(t *testing.T) {
// err := open_im_sdk.UserForSDK.Group().SyncGroupMember(ctx, "3179997540")
// if err != nil {
// t.Fatal(err)
// }
// time.Sleep(time.Second * 100000)
//}

func Test_GetGroup(t *testing.T) {
t.Log("--------------------------")
Expand Down
4 changes: 2 additions & 2 deletions testv2/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func GetUserToken(ctx context.Context, userID string) (string, error) {
jsonReqData, err := json.Marshal(map[string]any{
"userID": userID,
"platformID": 1,
"secret": "tuoyun",
"secret": "openIM123",
//"secret": "111111",
})
if err != nil {
Expand Down Expand Up @@ -106,7 +106,7 @@ func GetUserToken(ctx context.Context, userID string) (string, error) {
if result.ErrCode != 0 {
return "", fmt.Errorf("errCode:%d, errMsg:%s, errDlt:%s", result.ErrCode, result.ErrMsg, result.ErrDlt)
}
return result.Data.Token, nil
return result.Data.Token + "12321", nil
}

type onListenerForService struct {
Expand Down
56 changes: 28 additions & 28 deletions testv2/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,39 @@ import (
"testing"
)

func Test_SyncJoinGroup(t *testing.T) {
err := open_im_sdk.UserForSDK.Group().SyncJoinedGroup(ctx)
if err != nil {
t.Fatal(err)
}
}
//func Test_SyncJoinGroup(t *testing.T) {
// err := open_im_sdk.UserForSDK.Group().SyncJoinedGroup(ctx)
// if err != nil {
// t.Fatal(err)
// }
//}

func Test_SyncGroupMember(t *testing.T) {
groups, err := open_im_sdk.UserForSDK.Group().GetServerJoinGroup(ctx)
if err != nil {
t.Fatal(err)
}
for _, group := range groups {
err := open_im_sdk.UserForSDK.Group().SyncGroupMember(ctx, group.GroupID)
if err != nil {
t.Fatal(err)
}
}
//groups, err := open_im_sdk.UserForSDK.Group().GetServerJoinGroup(ctx)
//if err != nil {
// t.Fatal(err)
//}
//for _, group := range groups {
// err := open_im_sdk.UserForSDK.Group().SyncGroupMember(ctx, group.GroupID)
// if err != nil {
// t.Fatal(err)
// }
//}
}

func Test_SyncSelfGroupApplication(t *testing.T) {
err := open_im_sdk.UserForSDK.Group().SyncSelfGroupApplication(ctx)
if err != nil {
t.Fatal(err)
}
}
//func Test_SyncSelfGroupApplication(t *testing.T) {
// err := open_im_sdk.UserForSDK.Group().SyncSelfGroupApplication(ctx)
// if err != nil {
// t.Fatal(err)
// }
//}

func Test_SyncAdminGroupApplication(t *testing.T) {
err := open_im_sdk.UserForSDK.Group().SyncAdminGroupApplication(ctx)
if err != nil {
t.Fatal(err)
}
}
//func Test_SyncAdminGroupApplication(t *testing.T) {
// err := open_im_sdk.UserForSDK.Group().SyncAdminGroupApplication(ctx)
// if err != nil {
// t.Fatal(err)
// }
//}

func Test_SyncSelfFriendApplication(t *testing.T) {
err := open_im_sdk.UserForSDK.Friend().SyncAllSelfFriendApplication(ctx)
Expand Down

0 comments on commit 995d610

Please sign in to comment.