Does URLSessionWebSocketTask just not tell you when it loses connection?
I'm getting the same error as this post. URLSessionWebSocketTask will instantly log lose of connection to Xcode's console, but none of the delegate methods are called.
"URLSessionWebSocketTask Errors not called | Apple Developer Forums" https://developer.apple.com/forums/thread/653599