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

Uncaught exception in Speech re initialization #654

Closed
srijiths opened this issue Aug 29, 2017 · 5 comments
Closed

Uncaught exception in Speech re initialization #654

srijiths opened this issue Aug 29, 2017 · 5 comments
Labels
area-speech bug Indicates an unexpected problem or an unintended behavior.

Comments

@srijiths
Copy link

If we click on the Mic multiple times by mistake , there is an uncaught exception which is causing issues. Due to this issue , bot is getting in to a loop and never coming out with out a refresh page.

botchat.js:1426 Uncaught DOMException: Failed to execute 'start' on 'SpeechRecognition': recognition has already started.
at BrowserSpeechRecognizer.startRecognizing (http://IP/sample_files/botchat.js:5348:29)
at Function.SpeechRecognizer.startRecognizing (http://IP/sample_files/botchat.js:5253:39)
at SafeSubscriber._next (http://IP/sample_files/botchat.js:17787:48)
at SafeSubscriber.__tryOrSetError (http://IP/sample_files/botchat.js:1466:16)
at SafeSubscriber.next (http://IP/sample_files/botchat.js:1406:27)
at Subscriber._next (http://IP/sample_files/botchat.js:1344:26)
at Subscriber.next (http://IP/sample_files/botchat.js:1308:18)
at DoSubscriber._next (http://IP/sample_files/botchat.js:44464:24)
at DoSubscriber.Subscriber.next (http://IP/sample_files/botchat.js:1308:18)
at FilterSubscriber._next (http://IP/sample_files/botchat.js:16301:30)

@srijiths srijiths changed the title Uncaught exception on Speech re initialization Uncaught exception in Speech re initialization Aug 29, 2017
@danmarshall
Copy link
Contributor

@shahidkhuram - can you look into this?

@shahidkhuram
Copy link
Contributor

I can repro the issue. From a quick look it appears that stopping a recognizer isn't a synchronous operation so attempting to stop & start in quick succession is leading to this exception. stop() doesn't return a promise. One solution would be to throttle/debounce the start listening operation. I tried that quickly and I appears to resolve the problem. I'll try to send out a PR in the next day or so.

@billba
Copy link
Member

billba commented Aug 30, 2017

This is literally the sort of async nonsense that RxJS was designed to handle!

@compulim compulim added the bug Indicates an unexpected problem or an unintended behavior. label Sep 22, 2017
@compulim
Copy link
Contributor

Related to PR #657.

@compulim
Copy link
Contributor

Fixed in #881.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-speech bug Indicates an unexpected problem or an unintended behavior.
Projects
None yet
Development

No branches or pull requests

5 participants