Botframework-webchat: Setting userid on conversationUpdate

Created on 8 Feb 2017  路  2Comments  路  Source: microsoft/BotFramework-WebChat

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?

Most helpful comment

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.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

naveen-vijay picture naveen-vijay  路  4Comments

corinagum picture corinagum  路  3Comments

GewoonMaarten picture GewoonMaarten  路  3Comments

filipjakov picture filipjakov  路  4Comments

Kellym-Kainos picture Kellym-Kainos  路  4Comments