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

supabase / supabase-py / 41640930194 / 1
98%
main: 98%

Build:
DEFAULT BRANCH: main
Ran 03 Nov 2026 01:06PM UTC
Files 18
Run time 0s
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:03PM UTC coverage: 97.977%. Remained the same
41640930194.1

push

github

web-flow
fix(realtime): forget channels in remove_all_channels (#1925)

## What

`AsyncRealtimeClient.remove_all_channels()` sent `phx_leave` for every
channel and closed the socket, but never removed the channels from
`self.channels`. The socket closes right away, so the leave replies that
would normally drop them never arrive, and `get_channels()` kept
returning every "removed" channel. On top of that, it iterated
`self.channels.items()` directly, so a leave reply processed mid-removal
(`on_close` → `_remove_channel`) raised `RuntimeError: dictionary
changed size during iteration`.

Fixes SDK-1674. Also reported as #1678 (SDK-1970).

## Changes

- `remove_all_channels()` now loops over a snapshot of the channels,
unsubscribes each one, and removes it with `_remove_channel` (the same
path `remove_channel()` uses). If an unsubscribe raises, the loop still
removes every channel and closes the socket, then re-raises the first
error.
- Leaves are sent one at a time rather than concurrently like
realtime-js. If the connection drops during removal, concurrent sends
would each start their own reconnect, and `connect()` has no guard
against that. Sending sequentially keeps it to one.
- New `tests/test_remove_all_channels.py`, with no live server: a fake
connection patched into `realtime._async.client.connect` records sent
messages and can answer leaves with a `phx_reply`. Covers an empty
`get_channels()` afterwards, a leave per channel, the socket being
closed, a fresh channel for a reused topic, leave replies arriving
during removal, and removal continuing past an unsubscribe that raises.
All four tests fail on `main`.

## realtime-js behaviour

#1678 was closed because realtime-js supposedly doesn't clear its
channels either. It does, though not with a literal `this.channels =
[]`. `removeAllChannels()` in
[`packages/core/realtime-js/src/RealtimeClient.ts`](https://github.com/supabase/supabase-js/blob/ecab7fb69/packages/core/realtime-... (continued)

1017 of 1038 relevant lines covered (97.98%)

0.98 hits per line

Source Files on job run-ubuntu-latest-3.15-functions - 41640930194.1
  • Tree
  • List 18
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 41640930194
  • 22090f06 on github
  • Prev Job for on main (#41635530197.10)
  • Next Job for on main (#41641729152.12)
  • 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