Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive Card content is cleared on submit #1701

Closed
sachabruttin opened this issue Jul 31, 2019 · 5 comments · Fixed by #1930
Closed

Adaptive Card content is cleared on submit #1701

sachabruttin opened this issue Jul 31, 2019 · 5 comments · Fixed by #1930
Assignees
Labels
4.6 Bot Services equired for internal Azure reporting. Do not delete. Do not change color. Bug Your classic code defect customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete.

Comments

@sachabruttin
Copy link

Version

4.5.2

Describe the bug

Since version 4.5.0 the adaptive cards are behaving incorrectly. Version 4.5.1 and 4.5.2 have fixes for the issues #1680 and #1683 but the experience is still not at the same level as 4.4.2.

On 4.5.2 the form content is cleared on submit. Sometimes the data are correctly sent back to the bot, sometimes not.

Screenshots

See the difference between 4.4.2 and 4.52

Version 4.4.2

emulator-4 4 2

Version 4.5.2

emulator-4 5 2

Expected behavior

Form value must not be cleared on Adaptive Card

[bug]

@sachabruttin sachabruttin added the Bug Your classic code defect label Jul 31, 2019
@tonyanziano
Copy link
Contributor

HI @sachabruttin ,

Thanks for reporting.

I was aware of the form being cleared when the submit button was pressed, however, I did not realize that it was possible that the activity did not contain the form data when sent to the bot.

I'll investigate.

@tonyanziano tonyanziano self-assigned this Jul 31, 2019
@sgellock sgellock added customer-reported Required for internal Azure reporting. Do not delete. customer-replied-to Required for internal reporting. Do not delete. Bot Services equired for internal Azure reporting. Do not delete. Do not change color. labels Aug 8, 2019
@tonyanziano
Copy link
Contributor

tonyanziano commented Aug 13, 2019

Hello @sachabruttin ,

I've been trying to reproduce the issue, and as expected the forms inside of the Adaptive Cards do clear on Submit, however, I could not reproduce the scenario in which the form data was not being sent to the bot.

The form being cleared is a current limitation of the way we render Web Chat within the Emulator, but the data should be correctly relayed to your bot upon pressing submit.

Do you happen to have steps for a reliable repro of the form data not being correctly transmitted to the bot?

@sachabruttin
Copy link
Author

Hello @tonyanziano

This not easy to reproduce because it occurs randomly. Please check these 2 videos.

clean-before-submit

I suspect the form data is not correctly submitted because the card is cleared before I click on the submit button.

On the next one, the dropdown is cleared just after I have selected a value...
dropdop-clean-onselect

As previously state, all these behaviors were not present on the 4.4.x release. Is there something that prevents you from rollback the rendering of the Adaptive Cards to the working one?

@tonyanziano
Copy link
Contributor

tonyanziano commented Aug 14, 2019

@sachabruttin Thank you for posting the recordings. From the looks of those gifs, it looks the root of the issue is still due to the forms being cleared and not the actual transmission of the form values to the bot.

What I can see from both your gifs is that both forms are cleared at the same time as a

POST 200 directline.postActivity

appears in the log panel. I think the arrival of the activity causes Web Chat to re-render and clear any filled out adaptive card forms.

===

Regarding the possibility of rolling back the change, we made significant changes to the structure of the DOM structure and logic responsible for mounting Web Chat in order to land some new feature work for the JSON & Bot State inspectors.

I'll take another look through the commits between releases v4.4.2 & v4.5.x and see if there is anything we can do to roll it back. Last time I tried to address this issue, I didn't have a lot of bandwidth so we applied #1681 & #1690 to try and fix the issue in the short term.

However, it appears that the fixes don't protect against all cases, so it might be worth investigating.

@tonyanziano
Copy link
Contributor

tonyanziano commented Aug 14, 2019

Notes to fixer:

  • re-render looks like it's caused by any state changes at all to the chat document associated with the livechat
  • potential fix could be to flatten out different parts of inner chat document structure into separate state slices so that a change within the chat document doesn't affect every component connected to the chat at the root level (ex. highlighting an activity within a chat re-renders the entire Web Chat)

@sgellock sgellock changed the title Adaptive Card content is cleard on submit Adaptive Card content is cleared on submit Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.6 Bot Services equired for internal Azure reporting. Do not delete. Do not change color. Bug Your classic code defect customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete.
Projects
None yet
3 participants