Repository navigation
refactor(realtime)!: remove the automatic REST fallback in send() - #1698
Merged
spydon merged 3 commits intoAug 13, 2026
Conversation
`send()` posted the broadcast to the legacy `/api/broadcast` endpoint whenever the channel could not push over the socket, logging a warning that the behaviour would be deprecated. It made delivery depend on socket timing, so the same call could take two transports with two different sets of failure modes. Broadcasts now only go over the WebSocket, and `httpSend()` is the explicit REST path. Messages sent between `subscribe()` and the join completing are still buffered and flushed on join, so only channels that were never subscribed throw. Closes #1600
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthrough
ChangesRealtime broadcast delivery
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant RealtimeChannel
participant WebSocket
participant RealtimeServer
RealtimeChannel->>WebSocket: Create broadcast push
WebSocket->>RealtimeServer: Send after phx_join acknowledgement
RealtimeServer-->>WebSocket: Return push response
WebSocket-->>RealtimeChannel: Resolve or reject send
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Vinzent03
approved these changes
Aug 12, 2026
Tr00d
approved these changes
Aug 13, 2026
spydon
deleted the
lukasklingsbo/sdk-1469-v3-remove-the-automatic-rest-fallback-in-realtimechannelsend
branch
August 13, 2026 08:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
RealtimeChannel.send()used to silently post the broadcast to the legacy/api/broadcastendpoint whenever the channel could not push over the socket (canPush == false), logging a warning that the fallback would be deprecated. It is gone.sendBroadcastMessage()only ever sends over the WebSocket.subscribe()and the join completing are still buffered and flushed on join.httpSend()is the explicit REST path and works without subscribing.The dead
_broadcastBody()helper went with it.broadcastEndpointURLand_broadcastHeadersare still used byhttpSend().Why
The fallback made delivery depend on socket timing, so the same call could take two different transports with two different sets of failure modes. Now that
httpSend()exists as the explicit REST delivery path, the implicit one is not needed.Changes
packages/realtime_client/lib/src/realtime_channel.dart: drop the fallback branch and the_broadcastBody()helper, and document thatsendBroadcastMessage()requires a subscribed channel whilehttpSend()does not.packages/realtime_client/test/channel_test.dart: the fallback test is replaced by one assertingsend()throws when the channel was never subscribed, plus a new test covering the buffered-while-joining path.MIGRATION.md: v2 to v3 entry with the before/after for both transports.sdk-compliance.yaml: note the deviation fromsupabase-js, which still has the fallback insend(). Also drops the stale note onrealtime.channel.broadcast_http, which described the endpoint shape from beforehttpSend()moved to the per-event URL.Breaking change
Code that called
sendBroadcastMessage()on a channel it never subscribed to relied on the REST fallback and now throws. Switch those calls tohttpSend(), which requires a Realtime server running v2.97.0 or newer.Closes #1600
Summary by CodeRabbit
New Features
httpSend(), requiring Realtime server v2.97.0 or newer.Bug Fixes
Documentation