You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(realtime)!: fail presence track and untrack while the channel is not joined - #2203
track() and untrack() now resolve with ChannelResponse.error without sending anything while the channel is not joined, instead of buffering the message until the join.
Matches the track spec: a buffered presence message could time out and still reach the server after the rejoin.
Adds a MIGRATION.md section.
SDK-3201
Summary by CodeRabbit
Bug Fixes
Presence updates sent before a channel is joined, including during rejoining, now return an error instead of being buffered or sent. Track presence again after the channel successfully subscribes.
Documentation
Updated the migration guide and API documentation with the presence update behavior and an example that waits for subscription before tracking.
No actionable comments were generated in the recent review.
Walkthrough
Presence updates now return ChannelResponse.error when the channel is not joined. The migration guide and tests describe behavior before subscription, during joining, and after a successful join.
Changes: Presence tracking behavior
Layer / File(s)
Summary
Reject presence updates while not joined packages/supabase_realtime/lib/src/realtime_channel.dart, packages/supabase_realtime/test/channel_test.dart, MIGRATION.md
send returns an error without sending a presence message when the channel is not joined. Tests cover calls before subscription, during joining, and after joining. The migration guide documents the behavior and shows tracking after the channel reports subscribed.
Presence track and untrack calls made while a channel is not joined now return an error and send nothing, instead of being buffered until the join. The change is documented in the migration guide and covered by new tests. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: presence track() and untrack() now fail with ChannelResponse.error while the channel is not joined. The raw summary confirms this: calls made before join now resolve w…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: presence track() and untrack() now fail with ChannelResponse.error while the channel is not joined. The raw summary confirms this: calls made before join now resolve with an error and send nothing, and send() rejects presence messages when canPush is false. The title uses the conventional fix(realtime)! prefix, and the ! marks a breaking behavior change, which matches the MIGRATION.md update. The title is specific and does not need to list the test or doc changes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
track()anduntrack()now resolve withChannelResponse.errorwithout sending anything while the channel is not joined, instead of buffering the message until the join.MIGRATION.mdsection.SDK-3201
Summary by CodeRabbit