Skip to content

Conversation

@edgurgel
Copy link
Member

@edgurgel edgurgel commented Nov 4, 2025

What kind of change does this PR introduce?

New V2 serializer that is a super set of the Phoenix V2 JSON Serializer. It has 2 special types of messages:

  • User Broadcast Push
  • User Broadcast

The clients will be able to send a new User Broadcast Push which allows for binary or JSON payloads. It allows for a more efficient handling of the user payload as well.

The backend will be able to then broadcast the User Broadcast Push as User Broadcast for the serializers with V2 while also being able to convert to the V1 Broadcast that Phoenix V1 JSON Serializer supports as long as the user payload is JSON.

If a binary payload is sent and there is a websocket using V1 listening it won't receive such message as only JSON is supported by V1.

This PR also add a new GitHub workflow to run integration tests with deno. Currently pointing to a realtime-js preview release for now.

And finally I fixed the Realtime Channel integration tests to run async as I'm now running them twice with each serializer and it was ultra slow to have them running synchronously:

Finished in 464.6 seconds (158.7s async, 305.9s sync)

Additional context

Connected to supabase/supabase-js#1829

@edgurgel edgurgel force-pushed the feat/realtime-v2-serializer branch 2 times, most recently from 7f6f1e8 to ae956e0 Compare November 4, 2025 21:42
@coveralls
Copy link

coveralls commented Nov 4, 2025

Coverage Status

coverage: 87.096% (+0.2%) from 86.856%
when pulling eb5ed53 on feat/realtime-v2-serializer
into 9120f89 on main.

@edgurgel edgurgel force-pushed the feat/realtime-v2-serializer branch 2 times, most recently from 44fcfaf to c9cf984 Compare November 5, 2025 21:56
@edgurgel edgurgel force-pushed the feat/realtime-v2-serializer branch from 8b49635 to 7eaf28d Compare November 7, 2025 00:25
@edgurgel edgurgel marked this pull request as ready for review November 7, 2025 00:25
@supabase supabase deleted a comment from blacksmith-sh bot Nov 7, 2025
@blacksmith-sh

This comment has been minimized.

@blacksmith-sh

This comment has been minimized.

@supabase supabase deleted a comment from blacksmith-sh bot Nov 7, 2025
Copy link
Member

@filipecabaco filipecabaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our lib/realtime_web/channels/realtime_channel/message_dispatcher.ex is getting very complex we should take sometime to improve readability but later

@edgurgel edgurgel force-pushed the feat/realtime-v2-serializer branch from 7f9ccff to eb5ed53 Compare November 9, 2025 09:09
@blacksmith-sh
Copy link
Contributor

blacksmith-sh bot commented Nov 9, 2025

Found 2 test failures on Blacksmith runners:

Test View Logs
test new/2 starts a new rate counter with sum limit to log (Realtime.RateCounterTest) View Logs
test socket disconnect on jwt_secret the socket closes and sends a system message (Real
time.Integration.RtChannelTest)
View Logs


Fix in Cursor

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.

4 participants