chore(realtime)!: mark the transport internals @internal - #1674
Open
spydon wants to merge 4 commits into
Open
Conversation
RealtimeClient and RealtimeChannel exposed ten members that exist only to drive the websocket, not to be called: the send buffer and its state change callback registry, the message ref counter and its generator, the heartbeat and reconnect timers, the pending heartbeat ref, the raw push, and the channel's canPush and trigger. push already took Message, which is @internal, so it could not be called from outside the package regardless. The rest were public only because they are fields on a class that is itself public. Drops them from the capability matrix, where the backfill had registered them in the top-level supporting_symbols list for want of a better home. BREAKING CHANGE: RealtimeClient.sendBuffer, stateChangeCallbacks, ref, makeRef, push, heartbeatTimer, reconnectTimer and pendingHeartbeatRef, and RealtimeChannel.canPush and trigger, are no longer part of the public API.
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 |
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.
Stacked on #1673. Follow-up to the audit in that PR: of the 536 entries in the top-level
supporting_symbolslist, ten were realtime transport internals that had no business being public in the first place. They were registered there for want of a better home, which was the wrong answer.What becomes
@internalRealtimeClient.sendBufferRealtimeClient.stateChangeCallbacksopen/close/error/messagelistener registry behindonOpenand friendsRealtimeClient.refRealtimeClient.makeRefRealtimeClient.pushRealtimeClient.heartbeatTimerTimerdriving heartbeatsRealtimeClient.pendingHeartbeatRefRealtimeClient.reconnectTimerRetryTimerbehind reconnect backoffRealtimeChannel.canPushRealtimeChannel.triggerpushis the clearest case: it already tookMessage, which #1671 marked@internal, so it could not be called from outside the package regardless. Its signature said internal while its name said public.The rest are fields on a class that happens to be public, so Dart's underscore rule made them public by default. None appears in any documented flow. Every one of them has a public counterpart that is the supported way in:
onOpen/onClose/onError/onMessageinstead ofstateChangeCallbacks,heartbeatIntervalMsinstead ofheartbeatTimer,reconnectAfterMsinstead ofreconnectTimer,sendBroadcastMessageinstead ofpush.Matrix changes
Ten symbols leave the scan, so they leave
sdk-compliance.yamltoo:supporting_symbolslist.RealtimeClient.reconnectTimerdrops fromrealtime.configuration.reconnect_backoff, andheartbeatTimer/pendingHeartbeatReffromrealtime.configuration.heartbeat_interval. Both features keep their real evidence (reconnectAfterMs,heartbeatIntervalMs), andreconnect_backoffno longer needs asupporting_symbolslist at all.Public surface 1774 → 1764. Coverage stays at 100%.
Breaking
Marked
chore(realtime)!with aBREAKING CHANGEfooter. It is a genuine public API removal, though the practical risk is low: none of these is documented,pushwas already uncallable, and v3 is the right window. Anyone reaching for them was working around a missing public API, which is worth an issue rather than a lint suppression.Test plan
dart analyze packages/: No issues found. This is the gate that matters here:invalid_use_of_internal_memberfires for any cross-package use, and thesupabaseandsupabase_flutterpackages both consumeRealtimeClientandRealtimeChannel. Neither touches any of the ten.realtime_clienttests: 205 passed.@internalpermits same-package use, so the existing tests that drivemakeRef,pushandtriggerstill compile and run.supabasetests: 134 passed, including the realtime stream integration tests.supabase_fluttertests: 65 passed.check-drift:✅ No capability matrix drift detected.check-api-symbolsagainst chore: register the remaining public API in the capability matrix #1673 as base:✅ All new public API symbols are covered in the capability matrix.This is the check that would have caught a stale registration, since the ten removed symbols were all registered on the base.dart format packages/: 0 changed.