Botframework-webchat: Reaction buttons example and activity id

Created on 10 Dec 2020  路  4Comments  路  Source: microsoft/BotFramework-WebChat

Version

4.11

Describe the bug

First, I'm not sure if this is the best category for my input.

In the sample for reaction buttons the activityId is passed in the MessageReaction object which does not seem to be part of the specification bot builder implementation.

Also, MessageRection.cs has a type property for the reaction which is not used in the sample to populate the reaction.

Steps to reproduce

See implementation in the sample

const handleUpvoteButton = useCallback(() => {
    postActivity({
      type: 'messageReaction',
      reactionsAdded: [{ activityID, helpful: 1 }]
    });
}, [activityID, postActivity]);

Expected behavior

Shoudn't the activityid be transported via the replyToId activity property and the reaction in the type of "MessageReaction"?

Like this:

    const addMessageReaction = (helpful: boolean) => {
        props.postActivity({
            type: 'messageReaction',
            reactionsAdded: [{ type: (helpful ? "ThumbsUp" : "ThumbsDown") }],
            replyToId: props.activityId
        });
    }

This way, it would be easier to handle the reactions out of the box with c# bot builder sdk:

image

[Bug]

Bot Services Bug P2 Sample backlog customer-replied-to customer-reported front-burner

All 4 comments

Thanks for bringing this up. I recall the same thought occurring to me in the past but I failed to follow-up. Your suggestion makes sense to me, and of course we don't enforce any of the code suggestions we make in our samples, so you are free to follow your example code. 馃檪

I will bring this up as team discussion to reach a consensus to decide if we want to update the sample. (Also needs prioritization.)

We will look to prioritize this in the upcoming release.

Assigning to Post R12.

I think the last time we discussed was to fix this shortly after we ship R12. Please correct me if I am wrong.

Originally filed by @5Heinzelmann:

https://microsoft.github.io/BotFramework-WebChat/05.custom-components/d.reaction-buttons/

Screenshots

Screenshot

Steps to reproduce

  1. Go to https://microsoft.github.io/BotFramework-WebChat/05.custom-components/d.reaction-buttons/
  2. Text Hi
  3. Text Help
  4. Wait a few seconds
  5. See error

Expected behavior

Bot answers with default help text and shows reaction buttons in front of each bot message.

Additional context

Same for Chrome and Firefox (I used chrome for Screenshot)

[Bug]

Was this page helpful?
0 / 5 - 0 ratings