Not authorized. "User must be a member. When user already member in GroupChannel

[Problem/Question]
Hi guys,

Using Javascript SDK we keep getting error
{error: true, message: “Not authorized. “User must be a member.”.”, code: 400108}

By looking at Dashboard We can confirm that both users are on same group channel

// Detailed description of issue.

On Javascript SDK I see error like below when openning channel:


Request URL:

https://api-e550ba55-b9b8-4d4a-a56f-4b5779d26c19.sendbird.com/v3/group_channels/sendbird_group_channel_187358046_2ea0f7745100ff932d07fc6d1012c24fc8cee6f0/mute/01GF8TZDZ1NDZKHMDSKS264SG6?

{error: true, message: “Not authorized. “User must be a member.”.”, code: 400108}

Group channel id: sendbird_group_channel_187358046_2ea0f7745100ff932d07fc6d1012c24fc8cee6f0


// If problem, please fill out the below. If question, please delete.
[SDK Version]
// What version of the SDK are you using?
@sendbird/chat”: “^4.9.12”,
@sendbird/uikit-react”: “^3.6.8”,

[Reproduction Steps]
// Please provide reproduction steps and, if possible, code snippets.
The code We use for joining a channel:

  const handleJoinChannel = async (channelUrl) => {
    // console.debug("6.handleJoinChannel:: start load channel mesage collection", currentTime());
    // updateState({ ...state, loading: true });
    // console.info("handleJoinChannel fireeee")
    if (state.messageCollection && state.messageCollection.dispose) {
      state.messageCollection?.dispose();
    }

    if (state.currentlyJoinedChannel?.url === channelUrl) {
      return null;
    }
    const { channels } = state;
    const channel = channels.find((channel) => channel.url === channelUrl);
    // 1.Call markAsRead() when User opens an individual channel.
    channel.markAsRead();
    // channel.markAsDelivered();
    const onCacheResult = (err, messages) => {
      updateState({
        ...stateRef.current,
        currentlyJoinedChannel: channel,
        messages: messages.reverse(),
        loading: false,
      });
    };

    const onApiResult = (err, messages) => {
      updateState({
        ...stateRef.current,
        currentlyJoinedChannel: channel,
        messages: messages.reverse(),
        loading: false,
      });
    };

    const collection = loadMessages(channel, messageHandlers, onCacheResult, onApiResult);
    // console.debug("7.handleJoinChannel:: finish load channel mesage collection", currentTime());
    updateState({ ...state, messageCollection: collection, isSendToAllSubscribers: false });
  };

[Frequency]
// How frequently is this issue occurring?
it’s like a bi-weekly issue, But when it happens to a groupchannel, it stay there.

[Current impact]
// How is this currently impacting your implementation?

When sending message on that channel I also get another error:

{"exception":{"values":[{"type":"SendbirdError","value":"Sender is still in pending status.","stacktrace":{"frames":[{"filename":"/assets/app/app-387c469d8bf85bd42dcc2c9cd3e0e292.js?vsn=d",

Hi @Hoang_Le_Gia,
On checking our logs, we could see that the member state is still “invited” for one of the members. Both of the users must be in “joined” state.

You can accept the invitation from the platform API.
Link: https://sendbird.com/docs/chat/platform-api/v3/channel/inviting-a-user/accept-an-invitation-channel

1 Like