microsoft / microsoft/BotFramework-WebChat

createDirectLineSpeechAdapter 'userID' prop overwrites internal value, should be inaccessible

Open
#3,540 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog bug ExemptFromDailyDRIReport front-burner
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

Screenshots

'userID' not passed in as property
image

'userID' passed in as property

const adapters = await window.WebChat.createDirectLineSpeechAdapters( {
  fetchCredentials,
  userID: 'dl_abc123'
} );

image

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

  1. Open Web Chat using DL Speech
  2. Pass userID into the createDirectLineSpeechAdapters()
  3. 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]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with createAdapter.js and trace how createDirectLineSpeechAdapters() passes the userID property into the adapter. Reproduce the issue with DirectLine Speech by passing userID, then inspect the logged activity and verify that recipient.from.id remains the value assigned by DirectLine Speech.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.