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

Add messageBack support #1402

Closed
6 tasks done
compulim opened this issue Nov 27, 2018 · 13 comments
Closed
6 tasks done

Add messageBack support #1402

compulim opened this issue Nov 27, 2018 · 13 comments
Assignees
Labels
front-burner p0 Must Fix. Release-blocker size-m 1-3 days
Milestone

Comments

@compulim
Copy link
Contributor

compulim commented Nov 27, 2018

Background

It will support:

  • displayText (optional string for text to display on transcript)
  • image (optional image for the button)
  • text (optional string to send back to the bot, invisible to the user by default)
  • title (optional string for the text of the button)
  • value (optional JSON to send back to the bot, invisible to the user)

The user can specify both text and value, although they are mostly duplicated in nature (one as a string, another as a JSON object).

Although all properties are optional, we have a fallback rule if property is missing:

  • title will fallback to displayText if it is missing

In the meanwhile, we are not deprecating imBack or postBack. All 3 card actions are supported and there is no plan to add a deprecation warning.

Investigations

  • Adaptive Card: how other channels behave? Do they still use postBack or moved to messageBack?
  • Do we need a UI to tell the user what they actually sent (text vs. displayText)?
    • Should we tell the user about the actual text property?
    • How about preserve history story?
      • If displayText is not sent to the bot, we might lose it when history is restored.
      • It could be a Web Chat specific feature, i.e. store it in channel data.
    • Answer: No, we don't need to tell the user what is actually sent.
  • How to surface retry logic if the messageback activity failed without text/displayText?
    • Post back is broken today, but I want to make sure messageback don't break again.
    • If you have no clues on this, I can run it thru our UX designers.
    • Answer: For visible response, use the standard "send retry" status. For invisible response, modify the button to let the user to retry clicking on it.

To-do

  • Implement in suggested actions
  • Need investigation: Implement in Adaptive Card (card actions)
  • Talk to Adaptive Cards team to see if they can help on the UX for "retry postback"
@compulim compulim added 4.3 p0 Must Fix. Release-blocker labels Nov 27, 2018
@compulim
Copy link
Contributor Author

@bwamie this is the work item for messageBack.

@dandriscoll
Copy link
Member

Why is value dropped?

@corinagum corinagum added p1 Painful if we don't fix, won't block releasing Approved front-burner and removed p0 Must Fix. Release-blocker labels Nov 28, 2018
@compulim compulim added this to the v4.3 milestone Nov 28, 2018
@compulim
Copy link
Contributor Author

@dandriscoll When I talk to @bwamie, he said messageBack will only have two properties: text and title. Direct Line service do accept value property, but it may drop the actual content.

@compulim
Copy link
Contributor Author

@bwamie do you know how other channels works with form submissions on Adaptive Cards?

@compulim
Copy link
Contributor Author

Updated the bug description to capture our offline meeting.

@tomlm
Copy link

tomlm commented Dec 5, 2018

It should match the semantics described in the spec
https://docs.microsoft.com/en-us/azure/bot-service/bot-service-activity-spec?view=azure-bot-service-4.0

Message Back
A messageBack action represents a text response to be sent via the chat system. Message Back uses the following fields:

  • type ("messageBack")
  • title
  • image
  • text
  • displayText
  • value (of any type)

R7350: Senders SHOULD NOT include value fields of primitive types (e.g. string, int). value fields SHOULD be complex types or omitted.
R7351: Channels MAY reject or drop value fields not of complex type.
R7352: When activated, channels MUST send an activity of type message to all relevant recipients.
R7353: If the channel supports storing and transmitting text, the contents of the text field of the action MUST be preserved and transmitted in the text field of the generated message activity.
R7352: If the channel supports storing and transmitting additional programmatic values, the contents of the value field MUST be preserved and transmitted in the value field of the generated message activity.
R7353: If the channel supports preserving a different value in the chat feed than is sent to bots, it MUST include the displayText field in the chat history.
R7354: If the channel does not support R7353 but does support recording text within the chat feed, it MUST include the text field in the chat history.

@compulim
Copy link
Contributor Author

compulim commented Dec 5, 2018

@tomlm Few questions:

Updated with answers

Will tick the item when they are answered.

  • There are multiple R7532/R7535, and which one is R7534 referring to?
    • Answer: Will fix.
  • R7532: Is it a typo? "an activity of type messageBack" or "an activity of type message"?
    • Answer: Not a typo. imBack and postBack is an activity of type message.

And still few open questions, copied from "Investigations" section from the top and cleaned up a bit.

  • Adaptive Card: how other channels behave? Do they still use postBack or moved to messageBack?
  • Do we need a UI to tell the user what they actually sent (text vs. displayText)?
    • Should we tell the user about the actual text property?
    • How about preserve history story?
      • If displayText is not sent to the bot, we might lose it when history is restored.
      • It could be a Web Chat specific feature, i.e. store it in channel data.
    • Answer: No, we don't need to tell the user what is actually sent.
  • How to surface retry logic if the messageback activity failed without text/displayText?
    • Post back is broken today, but I want to make sure messageback don't break again.
    • If you have no clues on this, I can run it thru our UX designers.
    • Answer: For visible response, use the standard "send retry" status. For invisible response, modify the button to let the user to retry clicking on it.

@dandriscoll
Copy link
Member

The spec link is old :-(

I'll fix the numbering bug.

@corinagum corinagum added the size-m 1-3 days label Dec 7, 2018
@compulim compulim added p0 Must Fix. Release-blocker and removed p1 Painful if we don't fix, won't block releasing labels Dec 18, 2018
@compulim compulim modified the milestone: v4.3 Dec 18, 2018
@compulim compulim added the community-help-wanted This is a good issue for a contributor to take on and submit a solution label Dec 18, 2018
@compulim compulim removed community-help-wanted This is a good issue for a contributor to take on and submit a solution labels Dec 18, 2018
@v-kydela
Copy link

@compulim
@corinagum

No display text

It looks like messageBack displayText is strangely only supported with suggested actions and not hero cards. Can this issue be reopened?

@marcasmar94
Copy link

Any updates/workaround for making messageBack works on HeroCard/Adaptive cards buttons ?
Thank you

@sharatssj4
Copy link

Any updates on making messageBack work on HeroCards?

@compulim
Copy link
Contributor Author

@v-kydela can you file a new issue? This issue is closed because the messageBack is (mostly) implemented.

In the new issue, can you put a sample hero card JSON? And link it to this bug so @marcasmar94 and @sharatssj4 can vote on that bug to make it more prominent.

@v-kydela
Copy link

@compulim - It seems to have been fixed after I left my last comment. I don't know where that work was tracked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front-burner p0 Must Fix. Release-blocker size-m 1-3 days
Projects
None yet
Development

No branches or pull requests

7 participants