Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client.getConversationByUniqueName and Client.getConversationBySid cannot find conversations created by other users

Note: I'm using @twilio/conversations version 1.1.0 in node project. I'm transitioning from using Programmable Chat to Conversations.

I'm seeing calls to Client.getConversationByUniqueName and Client.getConversationBySid are not returning existing channels that were created by other users.

Example:

User 'A' (with its own unique identity and token) successfully created conversation 'myConvo1'using the following code:

client.createConversation({
   uniqueName: 'myConvo1',
   friendlyName: 'myConvo1',
 });

User 'B' (with its own unique identity and token) cannot find that conversation using: Client.getConversationByUniqueName('myConvo1') OR Client.getConversationBySid(sid) (just passing in the sid I get from the initial createConversation call).   I see these errors respectively:

Not Found    at ​​​Upstream.actualSend​​​
      ​./node_modules/@twilio/conversations/node_modules/twilsock/lib/services/upstream.js:135

Conversation with SID CHc4565e40a32f4bffaf490bae2cff45db is not found. 
      at ​​​conversations.syncListRead.promise.then.then.conversation​​​ ​./node_modules/@twilio/conversations/lib/client.js:283

However, I can access this conversation fine with the same functions if I'm using User A's token/identity. Also, when I call this from User B's Client:

client.createConversation({
       uniqueName: 'myConvo1',
       friendlyName: 'myConvo1',
     });

I get this error: Conversation with provided unique name already exists. So all of this leads me to believe the conversation is out there, but it's just not available for other users to join.

Note 2: I've been referencing the docs below. I don't see any explicit examples on how to find and join channels, so I may be missing something or approaching this wrong.

https://media.twiliocdn.com/sdk/js/conversations/releases/1.1.0/docs/Client.html

https://www.twilio.com/docs/conversations

like image 271
mwest-cs Avatar asked Oct 30 '25 22:10

mwest-cs


2 Answers

Could this be the reason, where Twilio Conversations only supports private channels, not public channels like Programmable Chat?

Public vs. Private Channel Use Cases with Twilio Programmable Chat

Migrating to Conversations from Programmable Chat

like image 89
Alan Avatar answered Nov 04 '25 21:11

Alan


I created multiple Service ID's and using one specific(XXXX-Chat-Dev) Chat Service ID, but application took the Default Chat Service ID which I didn't mentioned in backend.

Fixed by deleting the Default Chat Service ID in Twilio.

Chat Service ID

Cheers!

like image 35
Vamsi konanki Avatar answered Nov 04 '25 21:11

Vamsi konanki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!