• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-py / 41646648796 / 6
98%
main: 98%

Build:
DEFAULT BRANCH: main
Ran 03 Nov 2026 01:44PM UTC
Files 43
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Nov 2026 01:41PM UTC coverage: 98.503%. Remained the same
41646648796.6

push

github

web-flow
fix(realtime): serialize initial websocket handshakes (#1853)

## Why

Concurrent initial channel subscriptions can open two WebSockets on one
client. The second assignment loses the first socket, which remains
alive after `close()`.

Closes #1852.

## What changed

- Serialize the opening handshake and recheck the connection under a
lazy client lock.
- Add a real localhost WebSocket regression for concurrent
subscriptions, a sequential control, cancellation, and failed-handshake
retry.

## Scope

This covers initial connection ownership in the current Realtime API.
Reconnect policy and the v3 lifecycle rewrite in #1798 remain separate.
Legacy
[realtime-py#290](https://github.com/supabase/realtime-py/pull/290)
handles background-task cancellation rather than duplicate handshakes.

## Tradeoffs

Create the lock inside `connect()` so clients constructed before
`asyncio.run()` work on Python 3.9. Keep buffered-send setup outside the
lock because it can trigger a reconnect.

## Blast radius

Only the async Realtime client changes. No public signatures,
dependencies, or retry settings change.

## Verification

- New tests on untouched upstream fail twice with two sockets and one
orphan. The fix passes all four tests, including on Python 3.9. The
public wire reproduction now reports one socket and none after close.
- No-service package selection passes 28 tests. Existing AsyncPush
teardown diagnostics also occur on upstream. Mypy, Ruff, format, `make
ruff`, wheel and sdist build, and `git diff --check` pass.
- Full Supabase service tests are unverified. Isolated CLI startup fails
before services start because Docker image blobs return input/output
errors.

AI-assisted contribution. Reproductions and checks were run locally.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Concurrent connection attempts now share a single WebSocket
connection, prevent... (continued)

2962 of 3007 relevant lines covered (98.5%)

0.99 hits per line

Source Files on job run-ubuntu-latest-3.12-storage - 41646648796.6
  • Tree
  • List 43
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 41646648796
  • c5150d65 on github
  • Prev Job for on main (#41646438585.1)
  • Next Job for on main (#41648382876.15)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc