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

Response timeouts with DirectLineSpeech #3773

Closed
hrazmsft opened this issue Mar 3, 2021 · 8 comments · Fixed by #3776
Closed

Response timeouts with DirectLineSpeech #3773

hrazmsft opened this issue Mar 3, 2021 · 8 comments · Fixed by #3776
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete.

Comments

@hrazmsft
Copy link

hrazmsft commented Mar 3, 2021

Screenshots

image

Version

NPM: botframework-webchat": "^4.11.0

image

Describe the bug

After connecting a bot with DirectLineSpeech, every activity (except of the first one), no matter if text or speech, receive timeout while waiting for reply. In other platforms (emulator, postman, azure portal emulator) there is no timeout and all the responses are quick.

Steps to reproduce

  1. Render WebChat component with DirectLineSpeech support.
  2. Send one message to the bot (text or speech)
  3. The response should be quick
  4. Send another message to the bot (text or speech)
  5. The response has timeout

Expected behavior

The response should be quick like the first response

Additional context

None

[Bug]

@hrazmsft hrazmsft added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-reported Required for internal Azure reporting. Do not delete. labels Mar 3, 2021
@corinagum
Copy link
Contributor

@hraz-msft I tested this out on our sample and my behavior is slightly different from yours - when you say timeout, does the response eventually show up? Or no?

For me these timeout messages are non-blocking.

Sounds like a channel issue - Support team could someone help debug? Thanks.

@corinagum corinagum added customer-replied-to Required for internal reporting. Do not delete. support Internal request for assistance from the Support Team labels Mar 3, 2021
@corinagum corinagum removed the support Internal request for assistance from the Support Team label Mar 3, 2021
@tomlm
Copy link

tomlm commented Mar 3, 2021

yes, it does show up, but 3 seconds later

@compulim
Copy link
Contributor

compulim commented Mar 4, 2021

After some investigations: since Direct Line Speech works quite differently at the protocol level, the delay that applies to Direct Line protocol could not applies to DLSpeech protocol.

Essentially, DLSpeech does not tell Web Chat if the protocol has successfully sent a message or not (a.k.a. no send receipt, no read receipt). In other words, Web Chat never know the ID of the activity just sent. That means, activities sent from user will not have an ID.

Thus, since the activity from the bot has a reply-to-ID, we can never match that ID in our transcript. Thus, we can never sequence the transcript correctly. The delay is meaningless in DLSpeech protocol.

@hrazmsft
Copy link
Author

hrazmsft commented Mar 4, 2021

Look, only the WebChat component has that delay and that delay is happening from the second activity. In other platforms there is no such delay for the same bot

@compulim
Copy link
Contributor

compulim commented Mar 4, 2021

The delay is required for accessibility, and it was introduced for Direct Line protocol.

DL protocol is a distributed system: message comes in a very random order. But accessibility and screen reader doesn't work that way. It requires message to be injected on the screen in a time-sensitive manner.

As an accessible UI component which complies to WCAG 2.1, Section 508, and EN 301 549, Web Chat is required to re-sequence the message from a chaotic order. We need to inject those messages on screen in an order meaningful to people who can't see the screen.

To re-sequence the message, delay is required. It is similar to how packet defragmentation works in other systems, such as, TCP/IP.

Unfortunately, Speech SDK (used by DLSpeech protocol) doesn't give us ID, send receipt, or read receipt. It means, Web Chat has no way to verify whether a message has been sent over Web Socket, has reached the bot, or it failed due to intermittent network connectivity.

Also, DLSpeech does not fill in the details of an outgoing activity, such as conversation ID, timestamp, sender ID, activity ID, etc. And it doesn't support a lot of features that is common in transcript-based UI, such as attachments, resuming conversation, proactive messages, piggybacking data, etc.

As we mentioned in this introductory article, DLSpeech is a protocol designed for a non-transcript-based UI, such as home assistant, smart display, automotive dashboard, navigation system, etc. We have a demo here to show how to better utilize the protocol.

@hrazmsft
Copy link
Author

hrazmsft commented Mar 4, 2021

Maybe @tomlm or @damarqmsft can give more data. But the weird thing is that other platforms has no delay or timeout (emulators and azure portal WebChat)

@damarqmsft
Copy link

Maybe @tomlm or @damarqmsft can give more data. But the weird thing is that other platforms has no delay or timeout (emulators and azure portal WebChat)

Emulator and portal webchat are not using DLSpeech and they might not be implementing the delay. The problem here is we were waiting for a confirmation that would never come via DLSpeech (it comes only with Direct Line).

William's PR should fix it.

@compulim
Copy link
Contributor

compulim commented Mar 4, 2021

This will be released as a daily build tomorrow ~3-4 AM.

https://github.com/microsoft/botframework-webchat/releases/daily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants