BotFramework-WebChat
BotFramework-WebChat copied to clipboard
createDirectLineSpeechAdapter 'userID' prop overwrites internal value, should be inaccessible
Screenshots
'userID' not passed in as property
'userID' passed in as property
const adapters = await window.WebChat.createDirectLineSpeechAdapters( {
fetchCredentials,
userID: 'dl_abc123'
} );
Version
CDN v4.10.1
Describe the bug
createAdapter.js exports the create()
function which includes the userID
property. This property is used internally by the adapter where it is assigned a value from DL Speech which fills the recipient.from.id
activity property. It is not intended to be an accessible property when implementing the createDirectLineSpeechAdapters()
method. In support of this, a console message is displayed in the browser indicating userID
(and username
) are not supported.
If the property is passed into createDirectLineSpeechAdapters()
, which utilizes the create()
function, the passed in property value overwrites the value internally assigned by DL Speech.
Steps to reproduce
- Open Web Chat using DL Speech
- Pass
userID
into thecreateDirectLineSpeechAdapters()
- By logging the activity, observe the
recipient.from.id
value has been overwritten
Expected behavior
recipient.from.id
property in activity should maintain value assigned by DL Speech.
[Bug]
@compulim, I started creating a PR that would address this issue by clearing any value passed into the userID
property before being read by the adapter. However, after speaking with Pooja on the Services team, regarding IcM #205385137, she indicated that she had spoken with you on this subject. She suggested from that conversation that accessing the userID
is OK and the bug is related to the console logged message stating it and username
are not supported.
Can you clarify whether the property or the message is the bug? I can submit a PR correcting either, once I know.
Searching codebase of Web Chat, I can't see any of our code are trying to overwrite recipient.from.id
.
Do you think it's a service-side issue?
tl;dr can you look at the HTTP/WS traffic to see if it is expected or not?
@corinagum my investigations:
I modified 03.a/index.html
with userID: 'dl_abcde'
.
Then I talk to MockBot with dump-activity
command, I am seeing activity.from.id
is dl_abcde
:
However, I am seeing this warning:
note to dev: warning screencap - userId not supported should be removed
@stevkan when you say recipient.from.id
property in activity should maintain value assigned by DL Speech., do you mean activity.from.id
or activity.recipient.id
?
@stevkan ping