[Webkit-unassigned] [Bug 228296] REGRESSION (iOS 15): Websocket connection instance in javascript client getting closed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 20 02:42:05 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=228296

--- Comment #38 from Jorge Manrubia <jorge at hey.com> ---
We found a reliable way to reproduce the problem with web sockets getting in a broken state that only gets fixed by restarting the browser/app.

It has to do with closing Websockets that are in a "connecting" state.

You can try the following snippet in the Javascript console of any app with a WebSocket endpoint. Just update the URL. In this case, you can test in this demo page:

```
let socket = null
let iterations = 0
let intervalHandle = setInterval(function () {
  if (socket) {
    socket.close()
  }
  socket = new WebSocket("wss://libwebsockets.org/")
  iterations += 1

  if (iterations > 50) {
    clearInterval(intervalHandle)
  }
}, 25)
```

It tries several iterations because it's not totally deterministic. But with 50 it always reproduces the issue for me.

After running the script in the console, you will see some errors about "WebSocket is closed before the connection is established", which are expected. Then reload the page, and you can observe how the Websockets connections fail to establish. You need to restart Safari to fix.

Reproduce with Safari 15.1 on macOS Monterey, and also with Safari Technology Preview 135.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211220/036562e1/attachment-0001.htm>


More information about the webkit-unassigned mailing list