microsoft/botbuilder-js

"handleTeamsMessagingExtensionBotMessagePreviewSend" method not hitting in my code.

ChetanSharma-msft opened this issue · 5 comments

"handleTeamsMessagingExtensionBotMessagePreviewSend" method not hitting in my code.

Versions

What package version of the SDK are you using.: "botbuilder": "^4.18.0",
What nodejs version are you using: NodeJS 18
What browser version are you using: Edge
What os are you using: Windows

Describe the bug

"handleTeamsMessagingExtensionBotMessagePreviewSend" method not hitting in my code.
https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/msgext-action-preview/nodejs/bots/teamsMessagingExtensionsActionPreviewBot.js#L50-L74

To Reproduce

Steps to reproduce the behavior:

  1. Setup the sample: https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/msgext-action-preview/nodejs
  2. Add the debugger to this code section: https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/msgext-action-preview/nodejs/bots/teamsMessagingExtensionsActionPreviewBot.js#L50-L74
  3. Invoke Message Extension Action and try to send the card.
  4. "handleTeamsMessagingExtensionBotMessagePreviewSend" method is not hitting.

We have checked the bot builder JS code and found that this method is marked as protected.
Will it work or we should remove the code from the sample?

Expected behavior

It should call the "handleTeamsMessagingExtensionBotMessagePreviewSend" method.

Screenshots

NA

Additional context

NA

Will it work or we should remove the code from the sample?

Since that isn't an SDK sample, I can't say much about it. However, that method being protected is appropriate. That would only get called if the Activity.name == 'composeExtension/submitAction' and the Activity.value is BotMessagePreviewActionType "send".

You could see if it's making it handleTeamsMessagingExtensionSubmitAction. That would what it falls through to if the expected Activity value isn't present.