Skip to content

Allow LiveView channels to resume after a connection loss - #4488

Draft
SteffenDE wants to merge 4 commits into
mainfrom
sd-resumable-transport
Draft

SteffenDE wants to merge 4 commits into
mainfrom
sd-resumable-transport

Conversation

@SteffenDE

Copy link
Copy Markdown
Member

ColocatedCSS checked for Phoenix ~> 1.8.0 only, which fails to compile
with Phoenix 1.9.
Phoenix 1.9 can resume a socket over a new connection, without rejoining
its channels. Phoenix.LiveView.Socket implements Phoenix.Socket.resume/3
to check the session of the new connection: the resume is accepted only
when its live_socket_id matches the one of the first connection, or
neither has one. Otherwise, the client connects again and its LiveViews
mount again. Sockets that use Phoenix.LiveView.Socket run the same check
before their own resume/3. The new connect_info is used by LiveViews
that mount afterwards.

While the client cannot resume its socket, LiveViews show the same state
as for a lost connection, and clear it after the resume.
@SteffenDE
SteffenDE force-pushed the sd-resumable-transport branch from eb44e55 to 14b5acb Compare October 30, 2026 13:32

This branch has not been deployed

No deployments
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.

1 participant