Group channel not created properly

I am trying to create a group channel through the following code:

// Code starts here

export async function openOneToOneChannel(user1, user2) {
  try {
    if (!sb) {
      await createSBClient(user1.id);
    }
    let params = new sb.GroupChannelParams();
    params.isPublic = false;
    params.isEphemeral = false;
    params.isDistinct = true;
    params.addUserIds([user1.id, user2.id]);
    params.customType = '1-1';
    let channel = await sb.GroupChannel.createChannel(params)
    return channel;
  } catch (error) {
    console.log('openOneToOneChannelError', error);
  }
}

// Code ends here
The code return channel object successfully but the channel contain only the initiator/sender as a member of the channel. It returns:

“joinedMemberCount”:1,
“memberCount”:1,
"members”:[1]

rather it should create a channel and add the receiver as a member as well. The correct channel should have:

“joinedMemberCount”:2,
“memberCount”:2,
"members”:[2]

Can you please let me know what can possibly go wrong here ?

@yousafiqbal1994,

Welcome to the Sendbird Community! Can you DM me your AppID and Channel URL for an channel where this occurred?

I attempted to recreate this behavior in my environment but was not able to using the following code:

const sb = SendBird.getInstance();
    let channelName = uuid.v4();
    console.log(sb.currentUser);
    let params = new sb.GroupChannelParams();
    params.isPublic = false;
    params.isEphemeral = false;
    params.isDistinct = false;
    params.isSuper = false;
    params.addUserIds([sb.currentUser.userId, invitedUser]);
    params.name = channelName;

    sb.GroupChannel.createChannel(params, (newChannel, error) => {
      dispatch(sbGetChannelList());
      dispatch(sbGetChannel(newChannel.url));
    });

Sure, I will do share that is DM

Details sent in DM @Tyler please check.

Was that fixed? I have the same issue

Hi @Wojciech_Matyja,

Welcome to the Sendbird Community.

The issue in this instance was specific to the customer, so the resolution would not necessarily be helpful for you. If you DM me your Application ID and an example, I’ll take a look with you.

Maybe it is :slight_smile: The problem is, that when I’m trying to create a channel with people who don’t have an account in sendbird, I receive a channel with one person (me) instead of some error or sth. There is no problem, when I’m creating a channel with people who are already connected to sendbird. Is that expected behavior?

Hi @Wojciech_Matyja,

This would be expected behavior. We can’t invite a user to a channel that doesn’t exist, but we do create the channel with any users that do exist.

But is it expected, that the channel gets created? There is no error or anything, just a channel with one user.

Hi @Wojciech_Matyja,

We do consider this expected behavior. The reason for this is the channel is built in two phases.

  1. The channel is created with no users
  2. The users are invited or added into the channel (depending on preferences).

Because the channel is already created, its returned, and the users that exist are shown.