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

[Bug]: Firefox WebSocket HTTP/2 Issue: App Malfunction When Engine Started and Stopped Multiple Times #822

Closed
shareefalis opened this issue May 7, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@shareefalis
Copy link

shareefalis commented May 7, 2024

What happened?

On Firefox with WebSocket HTTP/2 enabled, our web app encounters errors in the streaming Speech-to-Text (STT) feature when the engine is started and stopped three times. Attempting to start the engine again results in a library error displayed in the console. Disabling HTTP/2 resolves this issue, restoring the app's functionality.

We prevent user error by enforcing a requirement for the user to wait until the engine reports a 'started' or 'stopped' state before allowing them to start or stop the engine.

Version

1.34.0

What browser/platform are you seeing the problem on?

No response

Relevant log output

Error: {"privSessionId":"3F9C187A3AC0452CB78903369A792D38","privReason":0,"privErrorDetails":"The number of parallel requests exceeded the number of allowed concurrent transcriptions.","privErrorCode":3}
@shareefalis shareefalis added the bug Something isn't working label May 7, 2024
@glharper
Copy link
Member

@shareefalis Thank you for using JS Speech SDK, and writing this issue up. Which region are you seeing this behavior? Could you try with eastus or eastus2?

@shareefalis
Copy link
Author

Hello Glenn, we are seeing this behavior on eastus2

@glharper
Copy link
Member

Hello Glenn, we are seeing this behavior on eastus2

It seems strange that disabling http2 websocket connections affects an error stating that "The number of parallel requests exceeded the number of allowed concurrent transcriptions." Could you describe what happens to the existing recognizer instance when you stop your app's engine?

@shareefalis
Copy link
Author

We assign a undefined value if the engine is stopped and we recreate the engine in start by a new SpeechRecognizer

@shareefalis
Copy link
Author

      this.setState(SpeechToTextClientStates.STOPPING_STATE);
      this.recognizer.stopContinuousRecognitionAsync(
        () => {
          this.setState(SpeechToTextClientStates.STOPPED_STATE);
          this.recognizer = undefined;
        },
        (err: string) => {
          this.setState(SpeechToTextClientStates.STOPPED_STATE, new Error(err));
          this.recognizer = undefined;
        },
      );

@glharper
Copy link
Member

Try calling this.recognizer.close() before setting it to undefined.

@shareefalis
Copy link
Author

I tried it. it works now.. Strange to why it is happening now with the new behavior

@glharper
Copy link
Member

I tried it. it works now.. Strange to why it is happening now with the new behavior

That close() call lets the backend service know that the client is ending the recognition session. Without it, it takes a few minutes (or more) of inactivity before the service gives up and closes the websocket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants