-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CreateDirectConversation() channel ID issue #137
Comments
This was a last minute change that we unfortunately haven't reflected in the documentation yet. The reason for it was that channel IDs in PubNub have a hard limit on number of characters, and we run into situations where it was exhausted with the previous approach of concatenating user IDs. Since there are various ways to do that, can you tell us a bit more about your workflow of creating channels and granting access tokens? Are you using wildcards in your PAM implementation? Would adding an optional parameter of channelId to the |
Since the next version (0.3.0) channelId will be an optional parameter for that method. |
I've also updated the docs to describe how a channel ID is created: https://www.pubnub.com/docs/chat/chat-sdk/build/features/channels/create#input. |
@VIKI-09 Since yesterday's release you may optionally pass your own channelId. If you find the new feature problematic, please create a new issue. |
Many thanks! |
I encountered a problem while using the createDirectConversation() method. The documentation states that the id is formed as follows: "The channel ID is automatically created out of the user IDs, joined by & and preceded by the direct prefix. For example, the users' channel IDs with agent-12 and agent-13 will be direct.agent-12&agent-13."(https://www.pubnub.com/docs/chat/chat-sdk/build/features/channels/create#method-signature)
BUT, In fact, the Chat SDK creates the channelId using the hash function as follows: const channelId =
direct.${cyrb53a(
${sortedUsers[0]}&${sortedUsers[1]})}
(from the SDK source code). As a result, we get channel id like 'direct.1234567890, which is different from docs example pattern. Why is it implemented this way?This prevents me from obtaining predictable channel IDs in order to use them in the channel identifier pattern to generate an access token for a specific user. That is, I want to generate a token that will provide the user access only to the private chats to which he belongs.
The text was updated successfully, but these errors were encountered: