Skip to content

fix(realtime): forward an explicit send() timeout of 0 - #2869

Open
MohammedAlkindi wants to merge 1 commit into
supabase:masterfrom
MohammedAlkindi:fix/realtime-send-timeout-zero
Open

MohammedAlkindi wants to merge 1 commit into
supabase:masterfrom
MohammedAlkindi:fix/realtime-send-timeout-zero

Conversation

@MohammedAlkindi

Copy link
Copy Markdown

Reopens #2647, which closed when I deleted my fork by mistake. The commits are unchanged.

🔍 Description

What changed?

The websocket branch of send() now resolves opts.timeout with ??, like the other two paths.

Why was this change needed?

0 is falsy, so that branch replaced a caller's timeout: 0 with the channel default while the other paths forwarded it.

📸 Screenshots/Examples

httpSend()                 opts.timeout ?? this.timeout
send(), REST fallback      opts.timeout ?? this.timeout
send(), websocket branch   opts.timeout || this.timeout

🔄 Breaking changes

Only an explicit timeout: 0 on the websocket path behaves differently.

  • This PR contains no breaking changes

📋 Checklist

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

📝 Additional notes

Reverting the fix makes the added test fail.

send()'s websocket branch resolved the timeout with ||, so a caller
passing timeout: 0 got the channel default instead. httpSend() and the
REST fallback in the same method already use ??.
@MohammedAlkindi
MohammedAlkindi requested review from a team as code owners November 16, 2026 18:48
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • An explicitly set timeout of 0 is now respected when sending a channel message.

RealtimeChannel.send now falls back to the channel timeout only when opts.timeout is nullish. A new test verifies that an explicit opts.timeout of 0 reaches the underlying push call.

Suggested labels: realtime-js

Change: Bug fix

Merge Risk: Minimal · up to fe54f

An explicit timeout of 0 passed to the channel send is now honored instead of being replaced by the channel default. The change is small and covered by a test. No merge-blocking risk is evident.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a65ce4a6-349e-4ad1-be0c-3779dc14dd09
Commits

Reviewing files that changed from the base of the PR and between 13211d9 and fe54fb2.

Files selected for processing: 2

  • packages/core/realtime-js/src/RealtimeChannel.ts
  • packages/core/realtime-js/test/RealtimeChannel.push.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

This branch has not been deployed

No deployments
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.

1 participant