Repository navigation
Raise when releasing a realtime channel that isn't detached (RTS4c-e) - #461
Merged
Merged
Conversation
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>
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 spec 6.3.0's
Channels#releasechange (ably/specification#557) for 2.0.Breaking change:
Ably::PubSub::Realtime::Channels#releaseno longer detaches the channel implicitly. If the channel is in any state other than initialized, detached or failed, it raisesAbly::Exceptions::InvalidStatewith 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). HTTPChannels#releaseis unchanged.Migration: detach the channel and wait for the detach to complete before releasing it:
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, becauserake generate_error_codesno longer understands the current ably-commonerrors.jsonformat. 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