Repository navigation
v2/address-pr712-review - #728
Conversation
Since the legacy host options were removed, getFallbackHosts has no failing branch, so its error result was always nil. Drop it, along with validate(), which only existed to surface that error from NewHTTPClient, and the error handling at the call sites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Channels.Release returns 90011 when the channel isn't INITIALIZED, DETACHED or FAILED, but the constant was the only error code kept out of server/pubsub and device/pubsub, so callers had to compare against a bare number. Re-export it from both entry points like the other error codes, and name it in the Release doc comment and UPDATING.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Fallback host lookup and callers internal/ably/options.go, internal/ably/export_test.go, internal/ably/http_client.go, internal/ably/realtime_conn.go, internal/ably/options_test.go |
getFallbackHosts and its test wrapper now return only host slices. HTTP and realtime connection code no longer handles lookup errors. Tests use the single-value result and retain their host assertions. |
Channel Release Error Export
| Layer / File(s) | Summary |
|---|---|
Release error documentation and exports internal/ably/realtime_channel.go, device/pubsub/api.go, server/pubsub/api.go, server/pubsub/reexport_test.go, UPDATING.md |
Both pubsub packages export ErrChannelReleaseInvalidState. The release documentation names the error constant, and the re-export test includes it in its checks. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor
Possibly related PRs
- ably/ably-go#718: This PR adds the error constant to the same pubsub re-export contract.
- ably/ably-go#719: This PR also changes fallback-host handling and removes a failing path from
getFallbackHosts.
Suggested reviewers: sacoo7, lmars
Merge Risk: 
Minimal · up to 06198
-
The change preserves fallback behavior and consistently exposes the existing release error without establishing a material merge risk.
Pre-merge checks: 
3 · 
1 · 
1
-
Failed checks: 1 warning · 1 inconclusive Passed checks: 3 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 9 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · 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.
A rabbit checks the host list twice,
Then finds no error in the slice.
A named release code joins the line,
Through both pubsub doors it shines.
The docs now tell its code and state.
Follow-ups to the review comments on #712.
getFallbackHostsno longer returns an errorgetFallbackHostsnow returns just[]string.validate()is removed. It existed only to return that error fromNewHTTPClient.No behaviour change.
ErrChannelReleaseInvalidStateis exportedErrChannelReleaseInvalidStateis now re-exported from both entry points, like the otherErr…constants.server/pubsub/reexport_test.go.Releasedoc comment andUPDATING.mdnow name the constant.Summary by CodeRabbit