Skip to content

Change the socket default for longpoll back to false - #6487

Merged
SteffenDE merged 1 commit into
phoenixframework:mainfrom
gpedic:set-endpoint-longpoll-default-back-to-false
Sep 23, 2025
Merged

Change the socket default for longpoll back to false#6487
SteffenDE merged 1 commit into
phoenixframework:mainfrom
gpedic:set-endpoint-longpoll-default-back-to-false

Conversation

@gpedic

@gpedic gpedic commented Sep 23, 2025

Copy link
Copy Markdown
Contributor

The default for longpoll was changed to true for no apparent reason by this PR #6072 about 7 months ago.

This can and has caused issues for us after updating Phoenix as we didn't expect longpoll to become enabled.
The default was false before since forever and still is in Phoenix.Socket, and is documented as such in the Phoenix.Endpoint docs.

The specific issue we ran into was that our sockets websocket was configured with session options while longpoll was not configured at all since it was not enabled previously. Every time the connection would fall back to longpoll it would fail to connect due to missing the session information. This would only happen from time to time so was an elusive issue track down.

socket "/live", Phoenix.LiveView.Socket,
    websocket: [connect_info: [session: @session_options]]

I would propose changing the default back to false as I think that is the expected behavior, unless there is a strong reason not to.

@SteffenDE
SteffenDE merged commit d7b6f24 into phoenixframework:main Sep 23, 2025
6 checks passed
@SteffenDE

Copy link
Copy Markdown
Member

Thank you @gpedic, it was a mistake and we should have caught it in code review!

@gpedic
gpedic deleted the set-endpoint-longpoll-default-back-to-false branch September 23, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants