microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.5k stars 2.44k forks source link

Action.ToggleVisibility - Something went wrong. Please try again. #6558

Closed ChernHwee closed 1 year ago

ChernHwee commented 1 year ago

Describe the bug

In the Microsoft teams application when I click the toggle visibility button, it displays as usual but the adaptive card shows "Something went wrong. Please try again." Initially, I suspect it is my code issue but when I ran the example it still shows "Something went wrong. Please try again."

To Reproduce

Steps to reproduce the behaviour:

  1. Go to https://adaptivecards.io/explorer/Action.ToggleVisibility.html
  2. Copy the example JSON
  3. Login into Microsoft teams
  4. Go to the Developer Portal
  5. Click on Design and build Adaptive Cards
  6. Create a new card
  7. Paste the example JSON
  8. Save and Send me this card
  9. Click any of the buttons

Expected behaviour

It should not show "Something went wrong". Please try again

Screenshots

image

stevkan commented 1 year ago

@ChernHwee - I was able to repro the issue successfully. When I take the adaptive card code and put it in the Developer Portal's Adaptive Cards editor, it marks all the action.toggleVisibility action types as invalid suggesting action.submit instead. Curiously, putting the card into the Adaptive Card's Designer also shows the same when testing against Teams.

I believe this to be a Teams specific issue. I'm guessing that the Designer relies on Teams code in order to accurately represent Teams look and functionality which would explain why the warning shows in both places. I haven't verified this to be true, however.

I'm checking to see what next steps might be and will get back to you with an update.

johnataylor commented 1 year ago

@stevkan any update on this?

clearab commented 1 year ago

That action isn't supported in Teams. You can find the list of supported actions here: https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-actions?tabs=json#adaptive-cards-actions.

As an alternative, you can use Action.ShowCard: https://adaptivecards.io/explorer/Action.ShowCard.html

ChernHwee commented 1 year ago

Thanks, I will try out Action.ShowCArd. Note: this action was supported in Teams previously. When the action/functionality is not supported please advise on how to fix it in error for backward compatibility.

johnmiroki commented 1 year ago

@clearab But Action.ToggleVisibility is among the Action types of Adaptive Card: https://adaptivecards.io/explorer/Action.ToggleVisibility.html

clearab commented 1 year ago

I do not believe that action was ever supported in Teams. The documentation listed above shows which actions are supported on their client. Every location that chooses to support Adaptive Cards has the option to support, override, or otherwise alter the behavior of the cards on that particular client. Most clients restrict some portion of the full Adaptive Cards protocol/schema in some manner - in general it is always best to check the documentation for the particular client you're sending cards to in order to ensure your card will work correctly.

If you'd like to discuss this further, I would suggest reaching out to the Teams group directly using one of the methods outlined here: https://learn.microsoft.com/en-us/microsoftteams/platform/feedback.

johnmiroki commented 1 year ago

@clearab Thanks for the clarification and for pointing me to the right direction. TBH, I feel Adaptive Card should expedite its pace for new features and adoption by all clients. In our case, we use AD extensively in our Teams app. The hope is for it to replace 90+% use of other js based UI SDK.

clearab commented 1 year ago

The dependency is a bit the other way around, Teams is choosing which portions of the AC schema and protocol to support. Adaptive Cards doesn't really have a lot of control over that portion.

However, almost all the focus currently is around full support for Action.Execute, as it is a single action which can reproduce essentially all of the functionality of the other actions. If you're investing heavily in adaptive cards (which is awesome, because adaptive cards are awesome), I'd recommend focusing on fully understanding and using Action.Execute - https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/universal-actions-for-adaptive-cards/overview

stevkan commented 1 year ago

Closing as resolved.