Repository navigation
[Integration/v2] Keep the idempotentRestPublishing option name (spec TO3n) - #726
Conversation
Reverts the 2.0 rename of the idempotent-publishing option to IdempotentHTTPPublishing. The specification names the option idempotentRestPublishing (TO3n), and the proposal to rename it was dropped, so the option keeps its 1.x name: the IdempotentRESTPublishing field, the WithIdempotentRESTPublishing option and its re-exports in server/pubsub and device/pubsub. ably-java made the same revert. The HTTP name is removed with no deprecated alias, since it was never released. The migration guide drops the rename row and says the name is kept deliberately. The other REST to HTTP renames are unchanged.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Rename the option and setting internal/ably/options.go, device/pubsub/api.go, server/pubsub/api.go |
The public option and internal setting now use REST naming. The default and documented behavior remain unchanged. |
Update publishing usage and references internal/ably/http_channel.go, internal/ably/http_channel_integration_test.go, server/pubsub/api_test.go, UPDATING.md |
Publishing logic and tests use the renamed option. The updating guide identifies the option as an exception to the REST-to-HTTP naming change and removes the obsolete rename entry. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- ably/ably-go#718: Changes the same option name and migration-guide entry that this PR updates.
Suggested reviewers: ttypic
Merge Risk: 
Minimal · up to 5a13a
-
The intended option rename is consistently applied and presents no identified merge-blocking risk.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main change: the idempotent-publishing option keeps its REST-based name (spec TO3n) instead of the 2.0 HTTP rename. The changeset does this. It renames the HTTP-named options back to REST-named ones in internal/ably, device/pubsub, and server/pubsub, updates call sites and tests, and corrects UPDATING.md. The title is specific and short, and it contains the spec reference. It includes a branch tag, which is acceptable.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. 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 0 functions across 6 files. (1 skipped: 1 unsupported.)
-
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 REST-named switch,
Then watches message IDs stitch.
The tests retry, the docs align,
The default stays as it was designed.
The rabbit hops, the names now shine.
Comment @coderabbitai help to get the list of available commands.
| | `ably.NewREST` | `pubsub.NewHTTPClient` | | ||
| | `ably.WithIdempotentRESTPublishing` | `pubsub.WithIdempotentHTTPPublishing` | | ||
|
|
||
| `WithIdempotentRESTPublishing` (the `IdempotentRESTPublishing` option) deliberately |
There was a problem hiding this comment.
I don't think we should explicitly mention this
Summary
Reverts one 2.0 rename. The idempotent-publishing option goes back to its 1.x name:
WithIdempotentRESTPublishingand theIdempotentRESTPublishingfield.WithIdempotentHTTPPublishing/IdempotentHTTPPublishingare removed. Every otherRESTtoHTTPrename in 2.0 stays.Why
idempotentRestPublishing. TO3n on specmainreads:idempotentHttpPublishing(TO3s) was dropped fromFix recoveryKey docstrings and clarify that REC1b2 endpoint has no port specification#568, which now says: "An earlier version also
renamed
idempotentRestPublishingtoidempotentHttpPublishing(TO3s). That rename wasdropped [...] so
idempotentRestPublishing(TO3n) [...] are unchanged frommain."aca02977"Keep the idempotentRestPublishingoption name", part of Address integration/v2 review findings: server-leg UTS conformance, migration guide, door options ably-pubsub-java#1256. Its UPGRADING.md
gained this line:
What changes
internal/ably)IdempotentHTTPPublishing boolIdempotentRESTPublishing boolinternal/ably)WithIdempotentHTTPPublishingWithIdempotentRESTPublishingidempotentHTTPPublishing()idempotentRESTPublishing()server/pubsubre-exportpubsub.WithIdempotentHTTPPublishingpubsub.WithIdempotentRESTPublishingdevice/pubsubre-exportpubsub.WithIdempotentHTTPPublishingpubsub.WithIdempotentRESTPublishingThe default stays
true(// TO3n), and the doc comments are unchanged apart from the name.Files touched (rename only):
internal/ably/options.go(default, field, getter, option func)internal/ably/http_channel.go(getter call)internal/ably/http_channel_integration_test.go(two uses of the option)server/pubsub/api.go,device/pubsub/api.go(re-exports)server/pubsub/api_test.go(one use of the option)UPDATING.mdUPDATING.md edits:
Clientbullet now listsWithIdempotentRESTPublishingamong the HTTP optionsit keeps.
ably.WithIdempotentRESTPublishing→pubsub.WithIdempotentHTTPPublishingrow isremoved from "Renamed functions". The
ably.NewRESTrow stays.RESTprefix is nowHTTP" now starts "TheRESTprefix has beenremoved from the public API, except in one option name (see below)." Without that, it
would no longer be true.
What users see
WithIdempotentRESTPublishingkeeps its name; only the package changes, from
ablytopubsub(server/pubsubordevice/pubsub), like every other option.integration/v2branch who usesWithIdempotentHTTPPublishingmust switch toWithIdempotentRESTPublishing. The HTTPname no longer compiles.
Decisions
WithIdempotentHTTPPublishingis removed outright. 2.0 has notbeen released, so no released version ever had the HTTP name, and ably-java removed its
counterpart in the same way.
Out of scope
RESTtoHTTPrenames stay:HTTPClient,NewHTTPClient,HTTPChannels,HTTPChannel,HTTPPresence,HTTPRequest,HTTPPaginatedItems,HTTPPaginatedResponse,WithHTTPClient,WithHTTPRequestTimeout, and therest_*tohttp_*file renames.Rest*class names should map to GoHTTP*names.CHANGELOG.mdkeeps its historic 1.xIdempotentRestPublishingentry.Validation
gofmt -l .go build ./...go vet ./...with default,unitandintegrationtagsgo test -tags=unit ./...go test ./server/... ./device/... -count=1(incl.TestServerReExportsInternalAPI,TestDeviceReExportsInternalAPI)go test ./internal/ably/ -tags=integration -run '^(TestIdempotentPublishing|TestIdempotent_retry)$' -count=1replaceto this branch) callingWithIdempotentRESTPublishing(true)fromserver/pubsubanddevice/pubsubWithIdempotentHTTPPublishingundefined: server.WithIdempotentHTTPPublishinggo doc ./server/pubsub WithIdempotentRESTPublishing(and device)git grep -n -i 'idempotentHTTP|idempotent_http',git grep -n TO3sMerging
A separate PR is being prepared from branch
v2/module-path-version-godoc(not open yetat the time of writing). It adds the
/v2module suffix, which rewrites every import path.The two PRs will conflict textually in
server/pubsub/api.go,device/pubsub/api.go,UPDATING.mdand possibly test import lines. Whichever landssecond needs a small rebase: keep the
/v2import paths from that PR and theIdempotentRESTPublishingnames from this one. No other lines overlap.Links
main): Integration branch for v2 packages #712aca02977)Summary by CodeRabbit
WithIdempotentRESTPublishinginstead ofWithIdempotentHTTPPublishingin both device and server APIs. Its default and behavior remain unchanged.WithIdempotentHTTPPublishing.