Skip to content

Conversation

filipecabaco
Copy link
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)

@coveralls
Copy link

coveralls commented Oct 8, 2025

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
22 checks passed
@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 <noreply@anthropic.com>
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