microsoft / BotFramework-WebChat

A highly-customizable web-based client for Azure Bot Services.
https://www.botframework.com/
MIT License
1.59k stars 1.53k forks source link

Bug: API Hook 'postActivity' Issue #5246

Open michalcislo opened 2 months ago

michalcislo commented 2 months ago

Is it an issue related to Adaptive Cards?

No

Is this an accessibility issue?

No

What version of Web Chat are you using?

Latest production

Which distribution are you using Web Chat from?

NPM

Which hosting environment does this issue primarily affect?

Web apps

Which browsers and platforms do the issue happened?

No response

Which area does this issue affect?

Hooks

Which theme pack does this issue affect?

I did not test it on other theme packs

What is the public URL for the website?

No response

Please describe the bug

I am experiencing issues with the API hook postActivity. Specifically:

API Hook postActivity Argument Type Mismatch: The hook specified in the API package does not work as described in the documentation. It appears to take a different argument type than what is mentioned.

Do you see any errors in console log?

No response

How to reproduce the issue?

API Hook postActivity Argument Type Mismatch:

  1. Follow the reaction button example as provided in the botframework-webchat documentation.
  2. Implement the code as shown in the example.
  3. Observe one of the errors: 'Type 'messageReaction' is not assignable to type 'message | typing | event | conversationUpdate | invoke'.' or 'Object literal may only specify known properties, and reactionsAdded does not exist in type...'

What do you expect?

The functionality to send an activity to the Azure bot with replyToId and reactionsAdded in order to further process the reaction to a given bot's message.

What actually happened?

The API postActivity hook, when used as described in the documentation, results in an error due to an argument type mismatch. It appears that the hook requires a different argument type than what is specified.

Do you have any screenshots or recordings to repro the issue?

No response

Adaptive Card JSON

No response

Additional context

botframework-webchat: 4.18.0 botframework-webchat-api: 4.18.0

SeanDonnellanJH commented 1 month ago

I am also experiencing this error: Type '"messageReaction"' is not assignable.

Copied the handleUpvoteButton right from here: https://github.com/microsoft/BotFramework-WebChat/tree/main/samples/05.custom-components/d.reaction-buttons#completed-code

michalcislo commented 1 month ago

Hi @compulim

Could you please guide us in that matter?

SeanDonnellanJH commented 1 week ago

Bump