microsoft / microsoft/BotFramework-WebChat

Error thrown and uncaught while speaking " " (empty space) on Safari using Cognitive Services

Open
#3,780 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

(Reported internally via Teams on behalf of customer)

Screenshots

image

Version

Possibly 4.12.0

Describe the bug

When using Cognitive Services to speak on an activity with speak field of an empty space " ", AudioContext.decodeAudioData will throw an exception, because the TTS-ed wavedata is empty (0 bytes in length, instead of MP3).

Thus, AudioContext.decodeAudioData(ArrayBuffer.from([])) would throw an exception.

This only happens in Safari because Safari is using an older signature of AudioContext.decodeAudioData, a.k.a. callback signature.

image

Due to a bug on how we handle the callback signature, we throw an exception of null. It propagate up through here:

image

Since error is null, accessing error.stack will trigger an exception, which is uncaught.

Steps to reproduce

  1. On Safari, speak to a bot that will result in an activity with speak field set to " " (empty space)

Expected behavior

It should not narrate anything.

Additional context

[Bug]

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 at the AudioContext.decodeAudioData callback handling described in the issue, then trace how the null error reaches error.stack. Reproduce on Safari with an activity whose speak field is " "; done means it produces no narration and does not throw an uncaught exception.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.