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

supabase / supabase-py / 41633202749
99%

Build:
DEFAULT BRANCH: main
Ran 03 Nov 2026 12:08PM UTC
Jobs 30
Files 169
Run time 1min
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 12:08PM UTC coverage: 96.041% (+0.06%) from 95.979%
41633202749

push

github

web-flow
fix(realtime): rejoin the channel after a presence callback is added while joined (#1686)

## What kind of change does this PR introduce?

Bug fix.

## What is the current behavior?

Adding a presence callback to a joined channel calls `_resubscribe()`.
It unsubscribes and then calls `subscribe()`, which raises because the
channel has already subscribed once. The channel has left the topic and
been removed from the client by then, and it is never joined again.

## What is the new behavior?

`_resubscribe()` now:

- waits for the leave to finish (reply, error or timeout),
- re-registers the channel on the client and creates a fresh join push,
so earlier subscribe callbacks are not called twice,
- subscribes again with the callback given to the first `subscribe()`,
- runs once when several presence callbacks are added in the same tick.

`unsubscribe()` behaves as before. It now delegates to a private
`_leave()` that returns the leave push.

## Additional context

Tests are in `src/realtime/tests/test_resubscribe.py`. They use a mocked
WebSocket that acknowledges joins and leaves. Without the change, the
tests fail because the second `phx_join` is never sent. With it they
pass.

Fixes #1684


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

## Summary by CodeRabbit

* **New Features**
* Adding the first presence callback to an already joined channel
enables presence through an automatic resubscription. If the connection
drops during the process, the channel rejoins with presence enabled when
it reconnects.
* **Bug Fixes**
* Additional presence callbacks no longer trigger unnecessary
resubscriptions when presence is already enabled.
* Resubscription waits for the channel to leave before rejoining and
stops if the operation is no longer active, including when the channel
is unsubscribed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Lukas Kli... (continued)

12881 of 13412 relevant lines covered (96.04%)

4.97 hits per line

Coverage Regressions

Lines Coverage ∆ File
22
92.36
3.31% src/realtime/_async/channel.py
Jobs
ID Job ID Ran Files Coverage
1 run-ubuntu-latest-3.15-supabase - 41633202749.1 03 Nov 2026 12:09PM UTC 20
96.84
GitHub Action Run
2 run-ubuntu-latest-3.13-auth - 41633202749.2 03 Nov 2026 12:09PM UTC 59
94.43
GitHub Action Run
3 run-ubuntu-latest-3.11-supabase - 41633202749.3 03 Nov 2026 12:08PM UTC 20
96.85
GitHub Action Run
4 run-ubuntu-latest-3.11-auth - 41633202749.4 03 Nov 2026 12:09PM UTC 59
94.43
GitHub Action Run
5 run-ubuntu-latest-3.12-auth - 41633202749.5 03 Nov 2026 12:09PM UTC 59
94.43
GitHub Action Run
6 run-ubuntu-latest-3.13-supabase - 41633202749.6 03 Nov 2026 12:08PM UTC 20
96.85
GitHub Action Run
7 run-ubuntu-latest-3.14-supabase - 41633202749.7 03 Nov 2026 12:08PM UTC 20
96.84
GitHub Action Run
8 run-ubuntu-latest-3.15-functions - 41633202749.8 03 Nov 2026 12:08PM UTC 18
97.98
GitHub Action Run
9 run-ubuntu-latest-3.14-functions - 41633202749.9 03 Nov 2026 12:08PM UTC 18
97.98
GitHub Action Run
10 run-ubuntu-latest-3.15-postgrest - 41633202749.10 03 Nov 2026 12:09PM UTC 39
97.7
GitHub Action Run
11 run-ubuntu-latest-3.11-realtime - 41633202749.11 03 Nov 2026 12:10PM UTC 17
93.21
GitHub Action Run
12 run-ubuntu-latest-3.14-auth - 41633202749.12 03 Nov 2026 12:09PM UTC 59
94.41
GitHub Action Run
13 run-ubuntu-latest-3.13-storage - 41633202749.13 03 Nov 2026 12:09PM UTC 40
95.71
GitHub Action Run
14 run-ubuntu-latest-3.14-realtime - 41633202749.14 03 Nov 2026 12:10PM UTC 17
92.67
GitHub Action Run
15 run-ubuntu-latest-3.12-postgrest - 41633202749.15 03 Nov 2026 12:09PM UTC 39
97.7
GitHub Action Run
16 run-ubuntu-latest-3.11-functions - 41633202749.16 03 Nov 2026 12:08PM UTC 18
97.98
GitHub Action Run
17 run-ubuntu-latest-3.13-realtime - 41633202749.17 03 Nov 2026 12:10PM UTC 17
93.12
GitHub Action Run
18 run-ubuntu-latest-3.12-storage - 41633202749.18 03 Nov 2026 12:09PM UTC 40
95.71
GitHub Action Run
19 run-ubuntu-latest-3.12-supabase - 41633202749.19 03 Nov 2026 12:08PM UTC 20
96.85
GitHub Action Run
20 run-ubuntu-latest-3.11-postgrest - 41633202749.20 03 Nov 2026 12:09PM UTC 39
97.7
GitHub Action Run
21 run-ubuntu-latest-3.12-functions - 41633202749.21 03 Nov 2026 12:08PM UTC 18
97.98
GitHub Action Run
22 run-ubuntu-latest-3.13-functions - 41633202749.22 03 Nov 2026 12:08PM UTC 18
97.98
GitHub Action Run
23 run-ubuntu-latest-3.15-realtime - 41633202749.23 03 Nov 2026 12:10PM UTC 17
92.67
GitHub Action Run
24 run-ubuntu-latest-3.14-postgrest - 41633202749.24 03 Nov 2026 12:09PM UTC 39
97.7
GitHub Action Run
25 run-ubuntu-latest-3.11-storage - 41633202749.25 03 Nov 2026 12:09PM UTC 40
95.71
GitHub Action Run
26 run-ubuntu-latest-3.15-storage - 41633202749.26 03 Nov 2026 12:11PM UTC 40
95.69
GitHub Action Run
27 run-ubuntu-latest-3.14-storage - 41633202749.27 03 Nov 2026 12:09PM UTC 40
95.69
GitHub Action Run
28 run-ubuntu-latest-3.13-postgrest - 41633202749.28 03 Nov 2026 12:09PM UTC 39
97.7
GitHub Action Run
29 run-ubuntu-latest-3.12-realtime - 41633202749.29 03 Nov 2026 12:10PM UTC 17
93.12
GitHub Action Run
30 run-ubuntu-latest-3.15-auth - 41633202749.30 03 Nov 2026 12:09PM UTC 59
94.41
GitHub Action Run
Source Files on build 41633202749
  • Tree
  • List 169
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #41633202749
  • 697170cd on github
  • Prev Build on main (#41632975450)
  • Next Build on main (#41634096736)
  • 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