Skip to content

Deprecate releasing a channel that isn't detached (RTS4b) - #2314

Open
SimonWoolf wants to merge 1 commit into
mainfrom
release-deprecate-implicit-detach
Open

SimonWoolf wants to merge 1 commit into
mainfrom
release-deprecate-implicit-detach

Conversation

@SimonWoolf

@SimonWoolf SimonWoolf commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Implements RTS4b from spec 6.3.0 (ably/specification#557). Calling channels.release(name) on a realtime channel that isn't INITIALIZED, DETACHED or FAILED still detaches it and then removes it. It now also logs a warning that this is deprecated and will be an error in the next major version, and that you should call channel.detach() and wait for it to complete before releasing. The release docstring is updated to match.

Tests check that releasing an attached channel logs the warning and that releasing a detached channel doesn't.

The next-major change is in #2315. Reference ably-js PRs: ably/ably-pubsub-js#2322 (deprecation) and ably/ably-pubsub-js#2323 (next major).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Deprecations
    • Releasing a channel outside the initialized, detached, or failed states is deprecated and will become an error in the next major version. Releasing an attached channel still detaches and removes it, with a warning.

Spec 6.3.0 deletes RTS4a, under which release detaches a channel before
removing it, and replaces it with RTS4e, under which release fails with
error 90011 for a channel not in the INITIALIZED, DETACHED or FAILED
state. RTS4b lets SDKs that already implement the old behaviour keep it
until their next major version, provided they log a deprecation warning
each time it takes effect.

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

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79c92433-aa4d-4379-870a-64599f119881
📥 Commits

Reviewing files that changed from the base of the PR and between 2072e0c and 4f7c90b.

📒 Files selected for processing (3)
  • Source/ARTRealtimeChannels.m
  • Source/include/Ably/ARTChannels.h
  • Test/AblyTests/Tests/RealtimeClientChannelsTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

release now logs a deprecation warning when called for a channel outside the Initialized, Detached, or Failed states. Tests verify release behavior and warning output for attached and detached channels.

Changes

Channel release behavior

Layer / File(s) Summary
Release state handling and warning
Source/ARTRealtimeChannels.m, Source/include/Ably/ARTChannels.h, Test/AblyTests/Tests/RealtimeClientChannelsTests.swift
The documentation says release in states other than Initialized, Detached, or Failed is deprecated and will become an error in the next major version. The implementation logs a warning before detaching in those states. Tests verify that releasing an attached channel logs one warning and removes it, while releasing a detached channel logs no warning and removes it.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 4f7c9

No merge-blocking issue is identified; the release deprecation warning is ready for normal merge checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: it deprecates releasing a channel that is not detached. The RTS4b reference adds useful specification context.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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

A rabbit checks the channel state,
Then logs a note before the gate.
Attached hops to detached ground,
Detached leaves without a sound.
The channel exits, tests look through,
And carrots wait in queues anew.

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

This branch was successfully deployed

4 active deployments
staging/pull/2314/markdown-api-reference — 4f7c90be Deployed Oct 9, 2026 by github-actions[bot]
staging/pull/2314/jazzydoc — 4f7c90be Deployed Oct 9, 2026 by github-actions[bot]
staging/pull/2314/AblyLiveObjects — 4f7c90be Deployed Oct 9, 2026 by github-actions[bot]
staging/pull/2314/features — 4f7c90be 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