Skip to content

Use the default serializer when the socket falls back to LongPoll - #6922

Merged
SteffenDE merged 1 commit into
phoenixframework:mainfrom
ARAYN7011:fix/longpoll-fallback-serializers
Nov 24, 2026
Merged

SteffenDE merged 1 commit into
phoenixframework:mainfrom
ARAYN7011:fix/longpoll-fallback-serializers

Conversation

@ARAYN7011

Copy link
Copy Markdown
Contributor

Fixes #6920.

The Socket constructor ignores the encode/decode options for the LongPoll transport, but replaceTransport (used by the longPollFallbackMs fallback) only swapped the transport, so a socket that fell back to LongPoll kept the custom serializer. replaceTransport now re-picks the serializer for the new transport (and restores the custom one when switching back to a WebSocket).

Test plan:

  • npm test (new replaceTransport serializers tests fail before the change, pass after; full jest suite passes)
  • npx eslint on the touched files is clean

AI assistance: this change was written with Claude Code (AI).

@SteffenDE
SteffenDE merged commit 2134a15 into phoenixframework:main Nov 24, 2026
16 checks passed
@SteffenDE

Copy link
Copy Markdown
Member

Thanks!

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.

JS client: after the fallback to LongPoll, the socket keeps the custom encode and decode, which a LongPoll socket ignores

2 participants