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

WebSocket connection immediately closed on macOS #221

Closed
brandom-msft opened this issue Jul 30, 2020 · 19 comments
Closed

WebSocket connection immediately closed on macOS #221

brandom-msft opened this issue Jul 30, 2020 · 19 comments
Assignees
Labels
bug Something isn't working pending close Ready for closure pending follow-up or prolonged inactivity

Comments

@brandom-msft
Copy link
Member

<Opening to track an issue raised by @compulim, his details pasted below>

We are testing Web Chat on macOS and we found the Web Socket connection closed immediately after it is connected.

We tried older versions of Web Chat and same. We are sure it was working on older versions before.

Do you know if there is any service interruption on your side related to macOS Safari WS connection to westus2.convai.speech.microsoft.com?

It seems only repro on macOS but not iOS, PC, and Android.

You can test Web Chat with a few clicks.
https://compulim.github.io/webchat-loader/

@compulim
Copy link
Contributor

compulim commented Jul 30, 2020

This only repro on Mac + Safari. It don't repro on Mac + Edge.

Screen Shot 2020-07-30 at 11 58 57 AM

This is what we are seeing. If you look at the timestamp on the right-hand side, the Web Socket connection get closed immediately on connect.

To try it out, click these 3 things on https://compulim.github.io/webchat-loader/

image

@glharper glharper self-assigned this Jul 31, 2020
@brandom-msft
Copy link
Member Author

@compulim What version of the SDK is this using? There have been fixes addressing Safari issues published with the 1.13 update

@compulim
Copy link
Contributor

compulim commented Aug 7, 2020

I just bumped to 1.13.1 with some hacks before #213 go live. 😛

And I am still seeing the connection get quickly terminated.

Screen Shot 2020-08-07 at 4 28 39 PM

@glharper
Copy link
Member

@compulim I'm actually getting a connection close with Edge/Win10 with 4.9.2 using westus and an internal key. The response I'm seeing is:
WebSocket connection to 'wss://westus.convai.speech.microsoft.com/api/v3?language=en-US&format=simple&Authorization=[...]&X-ConnectionId=DBBF6632F9B048C49C6C1D727CC6D26D' failed: Error during WebSocket handshake: Unexpected response code: 200
Could you email a good key for westus to glharper(at)microsoft or grab me on teams?

@collegewap
Copy link

collegewap commented Aug 13, 2020

Reproducible in Windows 10 + Chrome if I try the following:

  1. Select DirectLine Speech
  2. Click on Mock Bot
  3. Open in New window

image

Unable to replicate if I try the steps given in #221 (comment)

The difference I could see is in the token generation endpoint:

Not working: https://webchat-mockbot.azurewebsites.net/speechservices/token

Working: https://webchat-mockbot-streaming.azurewebsites.net/speechservices/token

@collegewap
Copy link

collegewap commented Aug 13, 2020

Also, I am facing the same issue with my subscription key

microsoft/BotFramework-WebChat#3407

Tried in https://compulim.github.io/webchat-loader/ and the same error

My region is eastus2

@steps371
Copy link

Also facing the same issue, which I logged on this ticket on the WebChat repo (99% sure it's a duplicate)

microsoft/BotFramework-WebChat#3307

@steps371
Copy link

I was able to fix our instance of the issue with the following:

I created a new Cognitive Service Speech resource in the same region as my Bot (I discovered bot was in western Europe, while cognitive resource was in west US).

I don't recall any documentation stating this constraint, so should likely be added as a disclaimer to relevant docs

@compulim
Copy link
Contributor

AFAIK, although Cognitive Services is region-based, Azure Bot Service is not. So mix-and-match them should be fine.

And I am only able to repro it on macOS Safari. But not other browsers, including Chrome on Windows, iOS Safari, or macOS Chrome.

@steps371
Copy link

@compulim that is strange, because we were experiencing the issue across multiple browsers on Mac, and creating a new cognitive speech resource appeared to have fixed the issue across browsers.

Maybe something changed in the cognitive services deployments?

@joeyreinders
Copy link

I've tried creating a new Cognitive Speech Resource, yet for me this didn't change a thing.
The WebSocket still closes immediately.

I have an other application which uses an old version of this library (version 1.2.1) and this one works fine.

@compulim
Copy link
Contributor

compulim commented Sep 8, 2020

Any updates?

@glharper
Copy link
Member

glharper commented Sep 9, 2020

@compulim I'm tracking this through #235, as that issue includes SDK facing code I can help debug.

@compulim
Copy link
Contributor

FYI, we are also seeing very similar issue on iOS 13.6.1. Connection get closed immediately after connect. And it works normally on other browsers connecting to the same bot and using same SDK.

image

In a few weeks ahead, we will bump to latest version of Speech SDK and see if anything will improve.

@compulim
Copy link
Contributor

compulim commented Nov 4, 2020

FYI, we are still seeing the issue on 1.13.1.

@brandom-msft
Copy link
Member Author

@compulim 1.14 has gone live, can you update and let me know what you see with that?

@compulim
Copy link
Contributor

compulim commented Nov 4, 2020

Do you know anything changed for the connection code in 1.14.0?

We have been testing multiple versions of Speech SDK for the last few months and still seeing the same issue. Maybe it's a good indication that your team should jump into repro-ing it. FYI, it only repro with the DLSpeech, but not other connection types.

@brandom-msft
Copy link
Member Author

brandom-msft commented Nov 6, 2020

@compulim 1.14 did have a large set of changes as it was one of our longer releases.

From the behavior seen here, it doesn't appear to be a BF SDK issue nor a JS SDK client issue. There have been similar issues reported like #235 above, I'm inclined to think this is a service issue. Can you try with a different cognitive services subscription to test that hypothesis? Then, if that's the case, we can involve the service team for some support.

@glharper glharper assigned brandom-msft and unassigned glharper Nov 20, 2020
@compulim
Copy link
Contributor

compulim commented Apr 2, 2021

I no longer see this issue when I test it on macOS Safari 14.0.3 today. Probably patched on the service side?

@microsoft microsoft deleted a comment Apr 20, 2021
@glharper glharper added pending close Ready for closure pending follow-up or prolonged inactivity and removed in review Acknowledged and being looked at now labels Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending close Ready for closure pending follow-up or prolonged inactivity
Projects
None yet
Development

No branches or pull requests

7 participants