TryQuiet / quiet

A private, p2p alternative to Slack and Discord built on Tor & IPFS
https://www.tryquiet.org
GNU General Public License v3.0
1.94k stars 85 forks source link

Socket connection warnings on iOS when in background #2508

Open leblowl opened 4 months ago

leblowl commented 4 months ago

When the app goes to the background on iOS, we receive these warnings that fill up the logs:

nw_socket_handle_socket_event [C22:2] Socket SO_ERROR [61: Connection refused]
Connection 22: received failure notification
Connection 22: failed to connect 1:61, reason -1
Connection 22: encountered error(1:61)
nw_connection_copy_connected_local_endpoint_block_invoke [C22] Client called nw_connection_copy_connected_local_endpoint on unconnected nw_connection
nw_connection_copy_connected_remote_endpoint_block_invoke [C22] Client called nw_connection_copy_connected_remote_endpoint on unconnected nw_connection
Task <75C2CE6B-DD3B-4D35-8294-6FBA9E754B6B>.<34> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
Task <75C2CE6B-DD3B-4D35-8294-6FBA9E754B6B>.<34> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x300ca7a20 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), viable, interface: lo0, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <75C2CE6B-DD3B-4D35-8294-6FBA9E754B6B>.<34>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <75C2CE6B-DD3B-4D35-8294-6FBA9E754B6B>.<34>"
), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://127.0.0.1:11000/socket.io/?EIO=4&transport=polling&t=OzF7QOY, NSErrorFailingURLKey=http://127.0.0.1:11000/socket.io/?EIO=4&transport=polling&t=OzF7QOY, _kCFStreamErrorDomainKey=1}
0x114034300 - ProcessThrottlerTimedActivity::activityTimedOut:

and it appears to retry continuously. We close the connections between the backend and frontend when going to the background, so I'm not sure what connection it's referring to and why it's retrying.