Botframework-webchat: SuggestedActions that are accidentally sent to the bot are being rendered for the user

Created on 24 Jul 2018  路  4Comments  路  Source: microsoft/BotFramework-WebChat

The v4 Emulator which uses 0.13.1-master.6da7b6c will show the user SuggestedActions that were sent to the bot. Testing this using the iFrame also renders the same result, SuggestedActions that should be only "seen" by the bot are showing for the user.

On other channels like Skype, if the suggestedAction to field is populated with the bot's id, the SuggestedActions do not render for the user.

Example code from BB-Py #100:

activity = Activity(
    type=ActivityTypes.message,
    channel_id=activity.channel_id,
    conversation=activity.conversation,
    from_property=activity.recipient,
    recipient=activity.from_property,
    service_url=activity.service_url
)

replies = [
    {
        "title": "Test1",
        "type": ActionTypes.im_back,
        "value": "Test1",
    },
    {
        "title": "Test2",
        "type": ActionTypes.im_back,
        "value": "Test2",
    }
]

activity.text = "My text"
# The following line is where the problem code in the bot exists: `to` uses
# `activity.from_property.id` instead of `activity.recipient.id`
activity.suggested_actions = SuggestedActions(actions=replies, to=[activity.from_property.id])

The activity's SuggestedActions show up for the user in WebChat and in the v4 Emulator, whereas this code sent to another channel would not work. Sending this activity to Skype results in the text, "My text" appearing, but not the SuggestedActions.

Bug Good first bug P2 S front-burner

All 4 comments

For activities with "receipient = bot" and contains suggested actions, Web Chat should not show suggested actions. Is that right?

Notes to fixer

  • [ ] ~Modify activityWithSuggestedActions.ts:10 to filter out activities not targeting the current user~

    • ~The "from me" check can be found at History.tsx~

    • ~We need a "to me" check, and we may need to re-architect that code~

  • [ ] ~Add tests~

Will fix in v4.

@tonyanziano hey are you working on this atm? Could you let us know your status? :)

Fix in the code is already in. Just needs a test.

Note from Tony: this is already in codebase and test needs to be written. Leaving as 4.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vikramdadwal picture vikramdadwal  路  3Comments

electrobabe picture electrobabe  路  4Comments

mmalaiarasan-conga picture mmalaiarasan-conga  路  3Comments

compulim picture compulim  路  3Comments

Stardox picture Stardox  路  3Comments