[Webkit-unassigned] [Bug 247943] REGRESSION (Safari 15.6.1-16.1): WebSocket in latest Safari does not emit onclose event when internet is turned off (wifi or cellular)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 16 06:16:49 PST 2022


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

--- Comment #5 from Mike <poremba at nolimit.sk> ---
For better testing if connection is still alive even after internet disconnect and connect I have connected debug tool website https://dev.bikeapp.sk/apple-bugs/debug/ to new web socket server for debug purposes. Now server sends ping messages each 5 seconds to client and client responds with pong. When client sends manually ping using console ws.send("ping"), server responds with pong. We can see it in network console in message frames.

I have tested Monterey 12.6.1 (21G217) with Safari v15.6.1 and yes it has the same behavior as v16.1. So regression is already between Catalina's Safari v15.6.1 and Monterey's Safari v15.6.1. Please see diff between this screen https://dev.bikeapp.sk/apple-bugs/2/Screen%20Shot%202022-11-15%20at%2013.26.52.png and this one https://dev.bikeapp.sk/apple-bugs/2/Screen%20Shot%202022-11-16%20at%2014.28.28%20missing%20onclose%20event.png I did not notice that Safari v15.6.1 could be different on Catalina and Monterey and here https://dev.bikeapp.sk/apple-bugs/2/ I have originally tested just Catalina where WebSocket onclose if correctly fired when internet is disconnected. I just added screen from Monterey's Safari v15.6.1.

Why new behavior is problematic...

1.) Yes, when disconnected and connected wifi again websocket connection is still working. I have did not notice this because origin websocket server implements ping/pong to detect zombie connections. Clients not responding to server's ping are terminated (considered stale/broken/zombie).

2.) Yes when disconnected for short time WS connection is still alive after connecting back. But when disconnected and connected after in about 2 minutes still not receiving CLOSE event and websocket connection on client sides seems to be active but in the fact it is not. See screen https://dev.bikeapp.sk/apple-bugs/2/Screen%20Shot%202022-11-16%20at%2013.16.33%20with%20note.png when sending "ping" from client, server does not respond with pong so connection is broken and client does no fire CLOSE event (for long time, maybe forever - must test it). You can see ping attempts in screen but no "pong" answer from server. So this regression breaks reconnect mechanism. What time should client consider connection working after turning internet off/on? It is always different when testing - not reliable. Client does not know if connection is alive or not so it is not reliable now. In the past when CLOSE was fired with each interned disconnection it was better and reconnection could be implemented easily thanks to onclose event. Now connection looks like working but it is not. You can send how many messages want but server is not receiving it and client is not errored.

-- 
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/20221116/70dbe128/attachment.htm>


More information about the webkit-unassigned mailing list