Repository navigation
Make channels.release() fail unless the channel is detached (RTS4c-e) - #2315
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 and removes it once the detach completes, with RTS4c-e. Under RTS4a the channel stayed in the collection while it detached, so a get for the same name in that window returned the channel that was about to be removed. release now removes an initialized, detached or failed channel before it returns, and otherwise fails with the newly registered error 90011 and leaves the channel as it is. Since nothing asynchronous remains, release:callback: and release: are replaced by release:error:, which Swift imports as a throwing release(_:). This drops the tests for issue 918, which covered a release waiting on a detach. 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 (12)
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), which replaces RTS4a.
Breaking change:
RealtimeChannels.release(_:)andrelease(_:callback:)are replaced by a synchronous, throwingrelease(_:)(release:error:in Objective-C).ErrorInfowith code 90011 (ErrorCode.channelReleaseInvalidState, newly added) and status 400, and leaves the channel untouched (RTS4e). It no longer detaches the channel for you.Under the old behaviour the channel stayed in the collection while it detached, so a
getfor the same name in that window returned a channel that was about to be removed.Migration: call
channel.detachand wait for its callback before callingtry channels.release(name). A section is added to the v2 migration guide.The issue #918 tests, which covered a release waiting on a detach, are removed because that situation can no longer happen.
90011 is registered in ably/ably-common#367. The current-major deprecation is in #2314. Reference ably-js PRs: ably/ably-pubsub-js#2322 (deprecation) and ably/ably-pubsub-js#2323 (next major).
🤖 Generated with Claude Code