microsoft / AdaptiveCards

A new way for developers to exchange card content in a common and consistent way.
https://adaptivecards.io
MIT License
1.75k stars 550 forks source link

Ensuring a submit action can only be done once #1512

Open bradrlaw opened 6 years ago

bradrlaw commented 6 years ago

Is there any mechanism to ensure a submit action is only done once from a card? Perhaps a mechanism to disable / hide after first successful use would be useful. Without this, bots have to incorporate logic to try to handle multiple submissions on the form even after the user may have moved farther along in the conversation. We have run into UX issues with this with several deployments, primarily using the web channel.

Kartik1607 commented 6 years ago

+1 This is a must have. We have ran into quite some exceptions due to this. During the time user clicks the submit button, and out bot does whatever was needed, the user had pressed the button a few more times. Then we get those activities at a dialog which was expecting a message and the bot throws an exception.

We had to explicitly add code to handle these cases. We can hide the button in a custom build after clicking but that would only work for webchat channel. At one point we got so frustrated with this issue that we were considering to abandon the adaptive card where ever we needed a submit button, and instead, get the information in a series of message exchanges between the user and the bot.

jpjpjp commented 4 years ago

This is an old request, but I'll add to it as well. On Webex Teams we see many Bot Developers who ask for the ability for "the buttons to be disabled after they have been clicked". The obvious use case for this is in poll scenarios where after a user chooses "yes" or "no", you want to restrict any further votes from that client.

Today we suggest that developers either delete the card, or write application logic to ignore subsequent button presses, but this seems like something that clients could do automatically in order to simplify application logic.

One approach might be to add some kind of a "actionSubmitButtonClickBehavior" property to the card? For example if this is set to "disableAfterFirstClick", the client would simply disable all Action.Submit buttons on the card as part of processing the first button click.

ameeee commented 3 years ago

Did anyone apply a solution for this?

xTEddie commented 3 years ago

Any updates on this?

vinbala commented 3 years ago

This is a MUST HAVE feature. Literally a pain point when using Adaptive Card on bots, it just breaks the flow. Need capability to disable adaptive cards or option to restrict submissions to be done only once.

alvarezskinner commented 3 years ago

+1 - Have worked in several projects where there was this requirements to prevent the flow of the conversation getting messed up. Would be incredible useful to have this mechanism in place.

namanimsft commented 3 years ago

+1. we are extensively using Adaptive Cards in our bot and got multiple bugs in production on getting duplicate records. This fix definitely should help everybody.

noturtype commented 3 years ago

+1 This is necessary to keep the flow on-track. Causing issues in testing when users scroll up and can click on obsolete cards.

edwardlee4948 commented 2 years ago

+1 I need this as soon as possible.

stevendewaele commented 1 year ago

+1 Need it as soon as possible. this gives a very unprofessional feeling for the conversation. You are able to click twice which results in faulty data or errors in the background.

Tommo56700 commented 1 year ago

+1 How is this not a thing already?

mhauschild commented 1 year ago

+1 are there any roadmap details about when this will be planned out?

Laisten commented 1 year ago

+1 Please provide this mandatory feature