Skip to content

Make channels.release() fail unless the channel is detached (RTS4c-e) - #2315

Open
SimonWoolf wants to merge 1 commit into
integration/v2from
release-throw-unless-detached
Open

SimonWoolf wants to merge 1 commit into
integration/v2from
release-throw-unless-detached

Conversation

@SimonWoolf

Copy link
Copy Markdown
Member

Implements RTS4c–e from spec 6.3.0 (ably/specification#557), which replaces RTS4a.

Breaking change:

  • RealtimeChannels.release(_:) and release(_:callback:) are replaced by a synchronous, throwing release(_:) (release:error: in Objective-C).
  • If no channel has the name, it does nothing (RTS4c).
  • An initialized, detached or failed channel is removed before the call returns (RTS4d).
  • In any other state it throws an ErrorInfo with 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 get for the same name in that window returned a channel that was about to be removed.

Migration: call channel.detach and wait for its callback before calling try 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

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>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e6dfdff6-a481-48f7-92b5-7795eab63022
📥 Commits

Reviewing files that changed from the base of the PR and between fea3c5a and c03bbcb.

📒 Files selected for processing (12)
  • Docs/migration-guides/v2.md
  • LiveObjects/Sources/AblyLiveObjects/Internal/DefaultInternalPlugin.swift
  • Source/ARTRealtimeChannels.m
  • Source/ARTWrapperSDKProxyRealtimeChannels.m
  • Source/PrivateHeaders/Ably/ARTRealtimeChannels+Private.h
  • Source/include/AblyPubSubDevice/ARTChannels.h
  • Source/include/AblyPubSubDevice/ARTErrorInfo.h
  • Source/include/AblyPubSubDevice/ARTRealtimeChannels.h
  • Test/AblySoakTests/SoakTest.swift
  • Test/AblyTests/Test Utilities/TestUtilities.swift
  • Test/AblyTests/Tests/RealtimeClientChannelTests.swift
  • Test/AblyTests/Tests/RealtimeClientChannelsTests.swift
  • Autopilot · 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch was successfully deployed

4 active deployments
staging/pull/2315/markdown-api-reference — c03bbcbd Deployed Oct 9, 2026 by github-actions[bot]
staging/pull/2315/jazzydoc — c03bbcbd Deployed Oct 9, 2026 by github-actions[bot]
staging/pull/2315/AblyLiveObjects — c03bbcbd Deployed Oct 9, 2026 by github-actions[bot]
staging/pull/2315/features — c03bbcbd Deployed Oct 9, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant