Skip to content

Raise when releasing a realtime channel that isn't detached (RTS4c-e) - #461

Merged
SimonWoolf merged 1 commit into
integration/v2from
release-throw-unless-detached
Oct 9, 2026
Merged

SimonWoolf merged 1 commit into
integration/v2from
release-throw-unless-detached

Conversation

@SimonWoolf

Copy link
Copy Markdown
Member

Implements spec 6.3.0's Channels#release change (ably/specification#557) for 2.0.

Breaking change: Ably::PubSub::Realtime::Channels#release no longer detaches the channel implicitly. If the channel is in any state other than initialized, detached or failed, it raises Ably::Exceptions::InvalidState with code 90011 and status 400, and leaves the channel attached and in the collection (RTS4e). Releasing a nonexistent channel is a no-op (RTS4c). Releasing an initialized, detached or failed channel removes it synchronously (RTS4d). HTTP Channels#release is unchanged.

Migration: detach the channel and wait for the detach to complete before releasing it:

client.channels.get('example').detach do
  client.channels.release('example')
end

This is documented in UPDATING.md. 1.x logs a deprecation warning for this case (#460).

90011 is used as a literal rather than a Codes:: constant, because rake generate_error_codes no longer understands the current ably-common errors.json format. 90011 is registered in ably/ably-common#367.

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 Channels#release detaches the
channel before removing it, with RTS4c-e: release now removes a channel
only if it is initialized, detached or failed, and otherwise raises
error 90011 (status 400) and leaves the channel alone, so that a channel
is never released while it could still receive messages from Ably.

1.x logs a deprecation warning for this case (RTS4b); this is the
breaking change for 2.0, documented in UPDATING.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@ttypic ttypic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SimonWoolf
SimonWoolf merged commit 81e56ef into integration/v2 Oct 9, 2026
39 of 46 checks passed
@SimonWoolf
SimonWoolf deleted the release-throw-unless-detached branch October 9, 2026 16:16

This branch was successfully deployed

2 active deployments
staging/pull/461/docs — ef53e8c6 Deployed Oct 9, 2026 by github-actions[bot]
staging/pull/461/features — ef53e8c6 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.

2 participants