Phoenix LiveView socket falls over to longpoll immediately

Fresh Phoenix LiveView project, very basic, where on some devices (consistently mobile Safari on wifi and 5g both, but desktop all browser are fine) is experiencing an issue where the socket connection seems to fail immediately, swaps over to long polling but in general the app is quite unresponsive / laggy as a result.

Server logs for the above:

2026-02-11T19:39:29Z app[48e2362b306478] lhr [info]19:39:29.881 request_id=GJNIeplHSBON-SYAAAVh [info] GET /about
2026-02-11T19:39:29Z app[48e2362b306478] lhr [info]19:39:29.883 request_id=GJNIeplHSBON-SYAAAVh [info] Sent 200 in 2ms
2026-02-11T19:39:30Z app[d8d3746c1d2218] lhr [info]19:39:30.380 [info] CONNECTED TO Phoenix.LiveView.Socket in 24µs
2026-02-11T19:39:30Z app[d8d3746c1d2218] lhr [info]  Transport: :websocket
2026-02-11T19:39:30Z app[d8d3746c1d2218] lhr [info]  Serializer: Phoenix.Socket.V2.JSONSerializer
2026-02-11T19:39:30Z app[d8d3746c1d2218] lhr [info]  Parameters: %{"_csrf_token" => "GANkez0WMS0-FxsHYlkpEEE0CRwiMwYGIs7BTSRyWbiVW5jrla9HhBYs", "_live_referer" => "undefined", "_mount_attempts" => "0", "_mounts" => "0", "_track_static" => %{"0" => "https://llmwelcome.dev/assets/css/app-904ee6a34a5258f33b66559c6e054c7d.css?vsn=d", "1" => "https://llmwelcome.dev/assets/js/app-564c0762ef3fe17e909e34c2879608c0.js?vsn=d"}, "vsn" => "2.0.0"}
2026-02-11T19:39:39Z app[48e2362b306478] lhr [info]19:39:39.984 [info] CONNECTED TO Phoenix.LiveView.Socket in 24µs
2026-02-11T19:39:39Z app[48e2362b306478] lhr [info]  Transport: :longpoll
2026-02-11T19:39:39Z app[48e2362b306478] lhr [info]  Serializer: Phoenix.Socket.V2.JSONSerializer
2026-02-11T19:39:39Z app[48e2362b306478] lhr [info]  Parameters: %{"_csrf_token" => "GANkez0WMS0-FxsHYlkpEEE0CRwiMwYGIs7BTSRyWbiVW5jrla9HhBYs", "_live_referer" => "undefined", "_mount_attempts" => "0", "_mounts" => "0", "_track_static" => %{"0" => "https://llmwelcome.dev/assets/css/app-904ee6a34a5258f33b66559c6e054c7d.css?vsn=d", "1" => "https://llmwelcome.dev/assets/js/app-564c0762ef3fe17e909e34c2879608c0.js?vsn=d"}, "vsn" => "2.0.0"}

There are no messages for the websocket:

I’ve compared this to other Phoenix LiveView projects and I can’t see any differences in router, dependencies, Dockerfile, fly.toml etc. - other projects don’t experience the same issue. (I’ve been clearing the phx:fallback:_e value between attempts too).

I’ve recreated the app entirely on fly.io and the issue persists.

If I disable longpoll fallback, the websocket succeeds but it takes 4-8s for the page to respond to navigation (then its instant for a while)

The websocket only appears in network tab 4+s after the page loads

I’m losing my mind - any ideas?

Ok, this seems silly, but removing this from the layout seems to have fixed the issue

      <div class="pointer-events-none fixed inset-0 -z-10 overflow-hidden">
        <div class="absolute -top-32 left-1/2 h-72 w-72 -translate-x-1/2 rounded-full bg-primary/20 blur-[120px] [[data-theme=dark]_&]:bg-primary/10" />
        <div class="absolute bottom-0 right-10 h-64 w-64 rounded-full bg-secondary/20 blur-[120px] [[data-theme=dark]_&]:bg-secondary/10" />
      </div>

Claude was keen on having gradients in the background…