MicrosoftDocs / msteams-docs

Source for the Microsoft Teams developer platform documentation.
https://aka.ms/teamsdev
Creative Commons Attribution 4.0 International
282 stars 503 forks source link

Bot teams app: After clicking send button, adaptive card showing a message at the bottom saying " 'Something went wrong. Please try again'" #11259

Open Amey819 opened 2 months ago

Amey819 commented 2 months ago

Steps to reproduce

The issue seems to be because of the lower timeout for the messages received from the user through adaptive card input. Is there a way to increase the timeout of this input message? image

In the screenshot as you see when we add dates, we run some diagnostics that can take longer than expected and before the results even return we get the error message as shown in the screenshot.

We would request some guidance on this issue.

Expected behavior

Expected behavior would be to increase the timeout and see the response return

Actual behavior

Actual behavior is that we see an error before the response returns

Error details

No response

Nivedipa-MSFT commented 2 months ago

@Amey819 - Thanks for reporting your issue. We are checking this internally, we will update you soon.

Amey819 commented 2 months ago

Hi @Meghana-MSFT Any update on this issue?

Nivedipa-MSFT commented 2 months ago

@Amey819 - You can configure your bot to support long-running messages. This can be done by setting the longRunningMessages property to true in your bot's configuration. This allows the bot to handle messages that take longer than the typical 10-15 second timeout imposed by most channels. Ref Doc: https://learn.microsoft.com/en-us/javascript/api/@microsoft/teams-ai/applicationoptions?view=msteams-client-js-latest

Please let us know if you have any further query here?

Amey819 commented 2 months ago

we don't use teams client for our bot, we use CloudAdapter available from bot framework and that connect to azure bot service which provides teams as one of the communication channels. Can you share any solution that works with CloudAdapter?

Nivedipa-MSFT commented 2 months ago

@Amey819 - We are checking this internally and update you soon.

Amey819 commented 1 month ago

Any Update @Nivedipa-MSFT ? This is currently blocking us from supporting few capabilities

Nivedipa-MSFT commented 1 month ago

@Amey819 - We are checking this with engineering team, we will let you know once we get any updates from them.

Amey819 commented 1 week ago

@Nivedipa-MSFT any update on this?

Nivedipa-MSFT commented 6 days ago

@Amey819 - Apologies for the delay. We are still checking this with engineering team, we will update you soon.

Nivedipa-MSFT commented 5 days ago

@Amey819 - There is no direct support of long running message in Bot framework SDK. Solution 1: use Teams AI SDK to handle adapter which support long running message. TeamsAdatper in AI SDK inherit from CloudAdapter in Bot Framework SDK. There is also a mapping for handling different invoke activities in AI SDK VS in Bot Framework SDK. teams-ai/getting-started/MIGRATION/01.JS.md at main · microsoft/teams-ai (github.com)

Solution 2: if you still want to stay with Bot Framework SDK, there is a possible work around to support long running message requiring customize coding. I will use nodejs as an example. Let me know if it works for you. Step 1: processActivity is the main way a bot receives incoming messages from client (user click the button) and defines a turn in the conversation (bot generate the response and send back to client). https://github.com/microsoft/botbuilder-js/blob/7112170fcfcf2b406e467ed2a9507249b7c2485a/libraries/botbuilder/src/botFrameworkAdapter.ts#L1189 Step 2: When customizing the turnContext, you can enable the long running message support via continuing the conversation and calling the handler with the new context. https://github.com/microsoft/teams-ai/blob/1e61623fec641c4d3a19fb0a6a1928ece3cb9305/js/packages/teams-ai/src/Application.ts#L1066

  1. use adapter.continueConversationAsnyc
  2. Copy the original activity to new context.

Could you please share the Adaptive Card payload being used in this case? The above solution provided is based on Adaptive Card invoke action.

If this issue is still reproducible recently, can you provide below information besides Adaptive Card payload? Bot Id, Tenant Id, most recent timestamp in UTC.

microsoft-github-policy-service[bot] commented 2 days ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 3 days. It will be closed if no further activity occurs within 3 days of this comment.