microsoft / microsoft/BotFramework-WebChat

"disable adaptive cards" - sample does not work in Version 4.19.1 of botframework-webchat

Open
#5,847 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bot Services bug customer-reported
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

Is it an issue related to Adaptive Cards?

Yes, this is an Adaptive Card issue, however it only repro on Web Chat.

Is this an accessibility issue?

No

What version of Web Chat are you using?

Latest production

Which distribution are you using Web Chat from?

NPM

Which hosting environment does this issue primarily affect?

Web apps

Which browsers and platforms do the issue happened?

Browser: Chrome (latest)

Which area does this issue affect?

Attachment: Adaptive Card

Which theme pack does this issue affect?

I did not test it on other theme packs

What is the public URL for the website?

No response

Please describe the bug

The disabling of adaptive cards worked in Version 4.17.0. In Version 4.19.1 it's broken.

https://github.com/user-attachments/assets/7393a9e7-0342-4a48-b3be-46b1de63f9bb

Do you see any errors in console log?
No
How to reproduce the issue?
  1. Use the adaptive-cards sample: https://github.com/microsoft/BotFramework-WebChat/blob/main/samples/05.custom-components/l.disable-adaptive-cards/index.html
  2. use an chatbot with a adaptive cards dialog which sends subsequent adaptive cards
  3. send an adaptive card
What do you expect?

the before last adaptive card gets disabled

What actually happened?

the before last adaptive card doesn't get disabled

Context

It looks like the attachmentMiddleware is now called only once: when the adaptive card is initially rendered. In Version 4.17.0 the middleware was called for every new message in the bot. This behaviour change is probably the cause for the broken feature.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with samples/05.custom-components/l.disable-adaptive-cards/index.html and reproduce the issue using a bot dialog that sends successive Adaptive Cards. Inspect when attachmentMiddleware runs in the 4.19.1 Web Chat flow, comparing it with the reported 4.17.0 behavior. Done means the previous Adaptive Card is disabled after a new card is sent.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.