refactor(realtime)!: internalize RealtimePresence - #1707
Merged
Merged
Conversation
BREAKING CHANGE: RealtimePresence, PresenceOpts, PresenceEvents, PresenceChooser, PresenceOnJoinCallback, PresenceOnLeaveCallback, and the RealtimeChannel.presence field are internal. Registering a callback through channel.presence silently disabled the channel presence streams because the internal forwarders occupied the same single callback slot. Use RealtimeChannel.onPresenceSync/onPresenceJoin/onPresenceLeave and presenceState() instead. The Presence payload class stays public.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Tr00d
approved these changes
Aug 13, 2026
spydon
deleted the
lukasklingsbo/sdk-1477-v3-internalize-realtimepresence-and-its-callback
branch
August 14, 2026 09:52
spydon
added a commit
that referenced
this pull request
Aug 14, 2026
## What Marks `Binding` and `BindingCallback` as `@internal` and removes them from the barrel export of `realtime_client`. ## Why They are the raw registration primitives underneath the channel listeners, and their only consumers, `RealtimeChannel.onEvents` and `RealtimeChannel.off`, have always been `@internal`. The raw-callback escape hatch underneath the v3 stream API should not be public. This also removed a stray import of the package barrel from `lib/src/message.dart`. The ticket also covered `RealtimeChannel.joinPush` leaking the internal `Push` type, but that field is already annotated `@internal`, so no change was needed there. ## Notes - Stacked on #1706; based on `feat/realtime-streams-v3`. Independent of #1707. - Deregisters the `Binding` symbols from `sdk-compliance.yaml`; local symbol and drift checks pass. - Adds a migration entry. ## Tests All realtime unit tests (195) and the integration suite (both protocol versions, run locally against a real Realtime server) pass, plus `supabase` (134) and analyzer/DCM across the workspace. Resolves SDK-1478
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Marks
RealtimePresence, its helper types (PresenceOptions,PresenceEvents,PresenceChooser,PresenceOnJoinCallback,PresenceOnLeaveCallback), and theRealtimeChannel.presencefield as@internal, and stops exporting them from the barrel (realtime_presence.dartnow only exports thePresencepayload class, which stays public).Why
RealtimePresenceis presence bookkeeping that leaked into the public API, and it hides a footgun:onJoin/onLeave/onSyncare single-slot callback setters, and the constructor installs the forwarders that feed the channel presence streams through those same slots. A user callingchannel.presence.onJoin(...)therefore silently disabled the channel'sonPresenceJoin/onPresenceLeave/onPresenceSyncevents.Everything the class offered is available on the channel: the presence streams for events and
presenceState()for the current state. A migration entry documents the before/after.Notes
feat/realtime-streams-v3.sdk-compliance.yaml; local symbol and drift checks pass.Tests
All realtime unit tests (195) and the integration suite (both protocol versions, run locally against a real Realtime server) pass, plus
supabase(134) and analyzer/DCM across the workspace.Resolves SDK-1477