Repository navigation
feat!: make RealtimeChannels.release() async and surface platform errors - #610
Open
SimonWoolf wants to merge 1 commit into
Open
SimonWoolf wants to merge 1 commit into
SimonWoolf wants to merge 1 commit into
Conversation
Spec 6.3.0 replaces RTS4a, under which release() detaches a channel that is not already INITIALIZED, DETACHED or FAILED before removing it, with RTS4c-e: release() of a channel in any other state must fail with error 90011 and leave the channel in place. That check is done by the platform SDKs (ably-java, ably-cocoa) in their next major versions. release() previously fired the platform call without awaiting it and dropped the Dart-side channel unconditionally, so a platform error would have been lost as an unhandled async error while the Dart and platform collections diverged. It now returns a Future that completes with the platform's AblyException, and only removes the Dart-side channel once the platform release has succeeded. The state check is deliberately left to the platform SDK, because RealtimeChannel.state is updated asynchronously from platform events and so can lag behind the platform channel's state. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (6)
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 branch was successfully deployed
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.
Implements RTS4c–e from spec 6.3.0 (ably/specification#557) for the next major version.
Breaking change:
RealtimeChannels.release(name)now returnsFuture<void>. A realtime channel can only be released when it is INITIALIZED, DETACHED or FAILED. Releasing it in any other state no longer detaches it implicitly. Instead, the future completes with anAblyException(code 90011, statusCode 400) and the channel stays in the collection. Releasing a name that doesn't exist is a no-op.Migration:
await channel.detach();and thenawait realtime.channels.release(name);. This is documented inUPDATING.md.Implementation:
release()now awaits the platform call and only drops the Dart-side channel once the platform release succeeds. Previously the platform call was not awaited, so any error was lost and the Dart and platform channel collections diverged.RealtimeChannel.stateon the Dart side can lag behind the platform channel.Still to do: the Android and iOS handlers for
releaseRealtimeChannelmust pass the native release error back (Android: catchAblyExceptionand callhandleAblyException; iOS: return aFlutterErrorwith theARTErrorInfo). This depends on the ably-java and ably-cocoa next-major releases that implement RTS4e, which don't exist yet. With the current native pins (ably-android 1.6.0,Ably 1.2.53) release never fails.The current-major docs change is in #609. Reference ably-js PRs: ably/ably-pubsub-js#2322 (deprecation) and ably/ably-pubsub-js#2323 (next major).
🤖 Generated with Claude Code