pubnub / javascript

PubNub JavaScript SDK docs https://www.pubnub.com/docs/sdks/javascript
Other
553 stars 401 forks source link

Unable to add a Channel with a period to a Channel Group #234

Closed drewrawitz closed 2 years ago

drewrawitz commented 2 years ago

Hello,

I'm trying to follow the documentation for adding channels to a channel group, and even using the exact same code outlined in the docs:

pubnub.channelGroups.addChannels({
   channels: ["chats.room1", "chats.room2", "alerts.system"],
   channelGroup: "cg_user123"
})

from: https://www.pubnub.com/docs/channels/subscribe#channel-groups

I get the following error:

text: '{"status": 400, "message": "Reserved character in input parameters.", "service": "channel-registry", "error": true}'`

If I remove the periods and just do ['chatsroom1', 'chatsroom2', 'alertssystem'] then it works just fine. Any reason why this would be erroring out? I'm under the impression that the period in channel names is valid, and even recommended.

Any help is appreciated. Thanks!

ghost commented 2 years ago

Correct, you cannot use a period in channel groups for pubnub, you can try using underscore or another character instead. Here is the documentation for reference -> https://www.pubnub.com/docs/channels/subscribe#channel-groups

drewrawitz commented 2 years ago

@raipubnub I did use an underscore for the channel group. The periods are in the channels which is used as an example in the docs link we both referenced.

phairow commented 2 years ago

Oh, I apologize, I didn't read the details. Was thinking this was the channel group naming issue.

ghost commented 2 years ago

I asked around and it looks like you can enable the ability to add channels with a . to channel groups by contacting the support team. https://support.pubnub.com. This may get enabled by default in the future but for existing accounts with the issue you can check with support for now.