https://discord.gg/botpress logo
WhatsApp integration sends a response to the wrong...
# 🤝help
b
wkspace_01JV2J73SAFDHC7HGWKQ85KEAX My problem is the following: 1. The admin writes a message to the bot via WhatsApp (conv_01KBCY1WM8A5JZMMZK971H7HR2) 2. The bot replies to the user in the same conversation (conv_01KBCY1WM8A5JZMMZK971H7HR2) 3. The admin sends the following message (conv_01KBCY1WM8A5JZMMZK971H7HR2) 4. The bot replies in another conversation with the same user (conv_01K8QKEHS1FQGXFN0YXYYZ3NEA) 5. The admin writes a third message, but it ends up in a different conversation Dialogue (conv_01K8QKEHS1FQGXFN0YXYYZ3NEA) 6 and so on in a circle - the admin and bot messages randomly end up in different dialogues. It jumps between (conv_01K8QKEHS1FQGXFN0YXYYZ3NEA) and (conv_01KBCY1WM8A5JZMMZK971H7HR2) Ending dialogues doesn't help Updating doesn't help Clearly the problem is on your end
Important: Add the ability to delete dialogs in the admin panel! Currently, this is only possible by deleting the integration. We need to add the ability to delete a specific dialog in the admin panel.
l
I believe this has been reported waiting for a fix, will update you when I can 🫡
w
hi peter - i use whatsapp as well but not directly through the integration
i ran into a similar problem with yours, sending a message through the API using the same user and conversation created new ones
but the solution for me was using the internal integration ids, not the botpress ones
you probably have different conversation or user ids in your tags
and the user/conversations are being created because they're referencing the botpress ids and not the integration ones
this is hard to explain and understand and is not really documented but i hope this helped somewhat
b
Could you give a little more detail with an example? How to use this?
w
i use the messaging api to handle messaging. here's what happens: i receive a whatsapp message > i pass to botpress my conversation and user ids. botpress then creates its own internal conversation and user ids, and any future requests from it will always return those internal ids
but they also return a TAG from the messaging api, with my INTERNAL ids
so i need to query the messaging api always with my internal ids, not with botpress ids
if i do use those, the conversation and user get duplicated
but WHY? here's the important part
every conversation and user are linked to a channel. in your case, the whatsapp integration
so if you ever want to interact with the user or conversation, you have to do it using the whatsapp integration id
if you do it through the chat api (which i suppose is what you're doing, because it's the most obvious choice) it's just gonna duplicate the assets but link them to the chat api instead
b
Yes, that wasn't obvious, thank you. Why didn't the BotPress team solve this problem?
w
i don't know if this is even recognized as a problem
and also i wouldn't know because as my name suggests i don't work here
but i hope that wall of text can help you
l
You can always create a #1111026806254993459 I present them all to our head of product monthly 💪🏻
I'm having the same problem again today. Now I'm seeing that even writing to a variable isn't working in the emulator. Do you plan to solve this?
l
Will be taking a look at your bot! Will get back with any insights today
This is an emulator-specific issue — the emulator isn't passing a conversation ID when the state save is triggered, so every write to conversation variables silently fails. What to check: Is the bot being tested via the emulator with a fresh/reset conversation? The emulator sometimes starts a session without a fully initialized conversation object.
10 Views