Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SuggestedActions that are accidentally sent to the bot are being rendered for the user #1057

Closed
stevengum opened this issue Jul 24, 2018 · 4 comments · Fixed by #1706
Closed
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior. front-burner Good first bug p2 Nice to have size-s 1 days or less
Milestone

Comments

@stevengum
Copy link
Member

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.

@compulim
Copy link
Contributor

compulim commented Aug 1, 2018

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

Notes to fixer

Will fix in v4.

@sgellock sgellock added Approved p2 Nice to have labels Oct 30, 2018
@compulim compulim added this to the v4.2 milestone Oct 30, 2018
@tonyanziano tonyanziano assigned tonyanziano and unassigned corinagum Nov 20, 2018
@corinagum
Copy link
Contributor

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

@compulim compulim modified the milestones: v4.2, v4.4 Nov 28, 2018
@tonyanziano
Copy link
Contributor

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

@corinagum
Copy link
Contributor

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

@sgellock sgellock added 4.3 and removed 4.2 labels Dec 5, 2018
@compulim compulim modified the milestones: v4.2, v4.3 Dec 7, 2018
@compulim compulim added the size-s 1 days or less label Dec 8, 2018
@compulim compulim modified the milestone: v4.3 Dec 18, 2018
@compulim compulim added the bug Indicates an unexpected problem or an unintended behavior. label Dec 18, 2018
@compulim compulim added community-help-wanted This is a good issue for a contributor to take on and submit a solution and removed community-help-wanted This is a good issue for a contributor to take on and submit a solution labels Dec 18, 2018
@corinagum corinagum removed the Pending label Jan 17, 2019
@compulim compulim assigned compulim and unassigned justinwilaby Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. front-burner Good first bug p2 Nice to have size-s 1 days or less
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants