Skip to content

LiveView falls back to Longpolling too often #5720

@PJUllrich

Description

@PJUllrich

Environment

Elixir: 1.15.7
Erlang: 26.1.2
Phoenix: 1.7.11
LiveView: 0.20.5
Bandit: 1.2.0
macOS: Sonoma 14.3

Actual behavior

Ever since I upgraded to Phoenix 1.7.11 and enabled longpolling by default, LiveView falls back to longpolling 60-90% of the time instead of opening a WebSocket. I experienced this with my production servers running on Fly, but also in Localhost. I updated the longPollFallbackMs option from the recommended 2500 to 5000, 10_000, and even 15_000, but could observe no change in behaviour. Previously, I had no issues with establishing a WebSocket connection in any of my environments and if I disable longpolling by removing the longPollFallbackMs option, it establishes a WebSocket connection without issues.

I also experienced an issue with Bandit, which might be related. Please see the error and my configuration here: mtrudel/bandit#299

Expected behavior

I expect LiveView to fall back to longpolling almost never, especially not in Localhost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions