microsoft / BotFramework-WebChat

A highly-customizable web-based client for Azure Bot Services.
https://www.botframework.com/
MIT License
1.59k stars 1.54k forks source link

First activity will have a bogus replyToId if it was from the bot #3707

Open compulim opened 3 years ago

compulim commented 3 years ago

Version

master (as of pre-R12)

Describe the bug

Although this is a SDK bug, I am filing it here because we have // TODO code to remove after that bug is fixed.

First activity will have a bogus replyToId if it was from the bot.

If this bug is not fixed, it might cause accessibility issues on our side.

Steps to reproduce

  1. Edit /__tests__/html/accessibility.delayActivity.withReplyToId.html
  2. Remove the // TODO line related to this bug
  3. Run the test

Expected behavior

It should succeed, reasons:

To fix #3431, we have to relax the delay for the very first bot message, since it may have a bogus ID, or it may have a valid ID, we can't tell whether the replyToId is valid or not. We assume the first one is bogus, so we don't add 5 seconds delay.

But that PR inevitably introduced another accessibility issue, which is less severe, IMO.

The // TODO line is to send a bot activity first, so the bot reply, "You said, ..." activity, is no longer the first bot activity, and it should subject to delay.

Additional context

Developers who are not familiar with how ABS works and how it order messages, should read this sequence diagram first.

https://github.com/microsoft/BotFramework-WebChat/blob/master/docs/media/direct-line-sequence-diagram.png

For accessibility, the order of the narration is based on time when we add the element to the tree. And not based on the actual position of the element in the tree.

[Bug]

compulim commented 3 years ago

Assigning to @Kaiqb for bringing more people from the SDK.

Kaiqb commented 3 years ago

@mrivera-ms - who can investigate this one from the SDK side?

mrivera-ms commented 3 years ago

@Kaiqb, I have added the issue that will track this in the dotnet repo.

Kaiqb commented 3 years ago

Link to the issue Monica created in dotnet repo: Issue #5310: First activity has fake replyToId value that is causing a bug in WebChat. We'll leave this issue open here because we'll have to remove code after the bug is fixed in the SDK.

mrivera-ms commented 3 years ago

@Kaiqb, @compulim, there is a PR in the dotnet repo to fix this issue that needs your comments. The SDK team has reviewed the PR but there are questions that need to be answered before it is approved. Please see the PR here.

corinagum commented 3 years ago

@mrivera-ms FYI for visibility, I am adding a note to our project board.