Repository navigation
Deprecate releasing a realtime channel that isn't detached (RTS4b) - #1250
SimonWoolf wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughChannel release removes and marks the channel as released. It logs a deprecation warning for states other than INITIALIZED, DETACHED, or FAILED, then continues cleanup. Documentation describes the deprecation and planned error in the next major version. Tests cover release across channel states. ChangesChannel release behavior
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to Channel release continues its cleanup while warning for a captured state outside the permitted states. No material merge-blocking behavior is established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. A rabbit watched the channels flow Comment |
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified.
0 open findings
What changed in this PR
Deprecates releasing realtime channels that are not in terminal states while preserving current behavior.
Changes:
- Adds deprecation warnings for non-terminal channel releases.
- Updates Java and Kotlin documentation.
- Adds release and warning tests.
| File | Description |
|---|---|
pubsub-adapter/src/main/kotlin/com/ably/pubsub/Channels.kt |
Updates release KDoc. |
lib/src/test/kotlin/io/ably/lib/uts/unit/realtime/ChannelsCollectionTest.kt |
Adds release behavior and warning tests. |
lib/src/main/java/io/ably/lib/realtime/AblyRealtime.java |
Adds deprecation warning logic. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@coderabbitai review |
|
Spec 6.3.0 deletes RTS4a, under which release() detaches the channel and then removes it, and replaces it with RTS4e, under which releasing a channel that isn't INITIALIZED, DETACHED or FAILED raises 90011 instead. RTS4b lets SDKs that already implement the old behaviour keep it until their next major version, provided they log a deprecation warning when release() is called on a channel in any other state. Also add UTS-derived tests for RTS4c and RTS4d, and a test for the deprecation warning. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
17b57f4 to
3462e23
Compare
Implements the RTS4b deprecation from spec 6.3.0 (ably/specification#557).
Spec 6.3.0 replaces RTS4a, where
channels.release()implicitly detaches the channel, with RTS4e, where releasing a channel that isn'tINITIALIZED,DETACHEDorFAILEDis an error (90011). This SDK keeps the current behaviour until the next major version but now logs a deprecation warning whenrelease()is called on a channel in any other state. To avoid the warning, callchannel.detach()and wait for it to complete before callingchannels.release(name).AblyRealtime.Channels.releasefor non-terminal states.release()docs (javadoc and the pubsub-adapter KDoc).The behaviour change for the next major is in #1251. 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