I just wanted to add that I’m encountering some strange network issues when running web SPA, on the iOS simulator for versions 18.4 and 18.5 , but not on 17.0!
The network failures happen randomly and i can totally reproduce them after some tries.
When inspecting via Safari’s Web Inspector on the simulator, the failing requests show the following error:
“Failed to load resource: The network connection was lost.”
In the network panel, these failed requests show completely empty values for status, protocol, connection ID, IP, and transferred size. They also fail very quickly and never even show up in the server logs, which makes them really hard to diagnose.
Interestingly, this behavior seems to be specific to Safari on iOS and macOS. They work without any issues on Chrome or Android, no failures at all.
I suspect this might be related to how newer iOS versions handle network connections, particularly keep-alive connections. It’s possible that Safari is attempting to reuse a connection that the server has already closed, and doesn’t know how to recover gracefully from that.
Just to emphasize:
• This happens in Safari 18.4 and 18.5.
• Safari 17.0 runs the exact same app flawlessly.
• I haven’t tested any versions between 17.0 and 18.4 yet.
Not sure if related to this URLSession but the error is very similar...