Skip to content

feat(realtime): realtime explicit REST call - #1751

Merged
filipecabaco merged 1 commit into
masterfrom
feat/explicit-realtime-rest-call
Oct 9, 2025
Merged

filipecabaco merged 1 commit into
masterfrom
feat/explicit-realtime-rest-call

Conversation

@filipecabaco

Copy link
Copy Markdown
Member

🔍 Description

Added new public method for explicit usage of REST API for broadcast

What changed?

New method httpSend added

Why was this change needed?

Our current approach leads users to use broadcast without knowing.

🔄 Breaking changes

  • New log warning to inform that users are using REST when using send while not connected.

📋 Checklist

  • I have read the Contributing Guidelines
  • My PR title follows the conventional commit format: <type>(<scope>): <description>
  • I have run npx nx format to ensure consistent code formatting
  • I have added tests for new functionality (if applicable)
  • I have updated documentation (if applicable)

@filipecabaco
filipecabaco requested review from a team as code owners October 8, 2025 22:20
@coveralls

coveralls commented Oct 8, 2025 •

Copy link
Copy Markdown

Coverage Status

coverage: 95.455% (+13.0%) from 82.5%
when pulling 050687a on feat/explicit-realtime-rest-call
into 00c4a11 on master.

@filipecabaco
filipecabaco merged commit 4d7ebbd into master Oct 9, 2025
@filipecabaco
filipecabaco deleted the feat/explicit-realtime-rest-call branch October 9, 2025 16:37
grdsdev added a commit to supabase/supabase-flutter that referenced this pull request Oct 9, 2025
Added new `httpSend` method to RealtimeChannel class that explicitly uses the REST API endpoint for sending broadcast messages, regardless of WebSocket connection state.

Changes:
- Added `httpSend` method with proper error handling and timeout support
- Added deprecation warning to `send` method when falling back to REST
- Comprehensive test coverage for the new method

This addresses the issue where users may unknowingly use REST API fallback when WebSocket is not connected. The new method provides explicit control over message delivery mechanism.

Ported from: supabase/supabase-js#1751

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
grdsdev added a commit to supabase/supabase-flutter that referenced this pull request Nov 12, 2025
Added new `httpSend` method to RealtimeChannel class that explicitly uses the REST API endpoint for sending broadcast messages, regardless of WebSocket connection state.

Changes:
- Added `httpSend` method with proper error handling and timeout support
- Added deprecation warning to `send` method when falling back to REST
- Comprehensive test coverage for the new method

This addresses the issue where users may unknowingly use REST API fallback when WebSocket is not connected. The new method provides explicit control over message delivery mechanism.

Ported from: supabase/supabase-js#1751

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
grdsdev added a commit to supabase/supabase-py that referenced this pull request Nov 3, 2026
## Description

Ports explicit REST broadcast support from
[supabase-js#1751](supabase/supabase-js#1751) to
`realtime`, following the current supabase-js implementation and the
`realtime.channel.broadcast_http` capability in supabase/sdk.

### What changed

- New `AsyncRealtimeChannel.http_send(event, payload, timeout=None)`. It
POSTs to `/api/broadcast/{topic}/events/{event}` (`?private=true` for
private channels) and returns once the server accepts the message (HTTP
202).
- Works without a subscribed channel or an open websocket. `bytes`
payloads are sent as `application/octet-stream`.
- A 404 raises an error naming the Realtime server v2.97.0+ requirement.
- Adds `httpx[http2]` as a realtime dependency.
- `sdk-compliance.yaml`: `realtime.channel.broadcast_http` is now
`implemented`.
- README example, mocked unit tests, and integration tests against the
local Supabase stack. `timeout` is in seconds, like the client timeout,
and keyword-only.

### Differences from supabase-js

- No "falling back to REST" warning on `send_broadcast()`: Python has no
implicit REST fallback.
- The `persist` option is not supported.

## Test plan

- `make realtime.tests` (integration tests need the local Supabase
stack)
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