I'm having a problem: the first 'message' send from WebChat to the Bot triggers a conversationUpdate event in the bot with a random user.id (same as conversation.id), but ignores the user.id set with BotChat.App({ user: {id: 1234 } })
In the bot, I'm registering:
rec { type: 'conversationUpdate',
...
address:
{ id: '8HfQaXGhDys',
channelId: 'directline',
user: { id: 'FdMyC2m7OD4GrTtlKbf4vN' },
conversation: { id: 'FdMyC2m7OD4GrTtlKbf4vN' },
... },
...
user: { id: 'FdMyC2m7OD4GrTtlKbf4vN' } }
Any idea how I can set the user.id for the first connection?
It's a little different than what you've described. The conversationUpdate activity isn't triggered when WebChat sends a message, it is triggered when WebChat starts the conversation by POSTing to the Direct Line /conversation endpoint.
Unfortunately, at present the only way the specified user is sent to the bot is in the from field of every message sent. And at the time WebChat first starts the conversation it hasn't sent any messages. So that information isn't available to conversationUpdate.
@dandriscoll it would be nice if we could POST user when creating the conversation, and use that info in conversationUpdate. Ditto for reconnecting to an existing conversation.
Closing this issue here as this is an issue with Direct Line and not WebChat.
Most helpful comment
It's a little different than what you've described. The
conversationUpdateactivity isn't triggered when WebChat sends a message, it is triggered when WebChat starts the conversation by POSTing to the Direct Line/conversationendpoint.Unfortunately, at present the only way the specified
useris sent to the bot is in thefromfield of every message sent. And at the time WebChat first starts the conversation it hasn't sent any messages. So that information isn't available toconversationUpdate.@dandriscoll it would be nice if we could POST
userwhen creating the conversation, and use that info inconversationUpdate. Ditto for reconnecting to an existing conversation.