Skip to content

[Integration/v2] Keep the idempotentRestPublishing option name (spec TO3n) - #726

Merged
sacOO7 merged 1 commit into
integration/v2from
v2/keep-idempotent-rest-publishing
Oct 30, 2026
Merged

sacOO7 merged 1 commit into
integration/v2from
v2/keep-idempotent-rest-publishing

Conversation

@sacOO7

@sacOO7 sacOO7 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Reverts one 2.0 rename. The idempotent-publishing option goes back to its 1.x name:
WithIdempotentRESTPublishing and the IdempotentRESTPublishing field.
WithIdempotentHTTPPublishing / IdempotentHTTPPublishing are removed. Every other
REST to HTTP rename in 2.0 stays.

Why

  • The specification names this option idempotentRestPublishing. TO3n on spec main reads:

    (TO3n) idempotentRestPublishing boolean - defaults to false for clients with version < 1.2, otherwise true. If true, RSL1k applies

  • The spec proposal to rename it to idempotentHttpPublishing (TO3s) was dropped from
    Fix recoveryKey docstrings and clarify that REC1b2 endpoint has no port specification#568, which now says: "An earlier version also
    renamed idempotentRestPublishing to idempotentHttpPublishing (TO3s). That rename was
    dropped [...] so idempotentRestPublishing (TO3n) [...] are unchanged from main."
  • ably-java reverted its counterpart in commit aca02977 "Keep the idempotentRestPublishing
    option 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:

    ClientOptions.idempotentRestPublishing deliberately keeps its name, which is the specification's (TO3n).

  • The lead dev decided on 2026-10-29 to keep the option name aligned with TO3n.

What changes

Layer Before (this branch) After
Options field (internal/ably) IdempotentHTTPPublishing bool IdempotentRESTPublishing bool
Option func (internal/ably) WithIdempotentHTTPPublishing WithIdempotentRESTPublishing
Unexported getter idempotentHTTPPublishing() idempotentRESTPublishing()
server/pubsub re-export pubsub.WithIdempotentHTTPPublishing pubsub.WithIdempotentRESTPublishing
device/pubsub re-export pubsub.WithIdempotentHTTPPublishing pubsub.WithIdempotentRESTPublishing

The 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.md

UPDATING.md edits:

  • The device Client bullet now lists WithIdempotentRESTPublishing among the HTTP options
    it keeps.
  • The ably.WithIdempotentRESTPublishing → pubsub.WithIdempotentHTTPPublishing row is
    removed from "Renamed functions". The ably.NewREST row stays.
  • A note follows that table:

    WithIdempotentRESTPublishing (the IdempotentRESTPublishing option) deliberately
    keeps its name, which is the specification's (TO3n).

  • The intro of "The REST prefix is now HTTP" now starts "The REST prefix has been
    removed from the public API, except in one option name (see below)." Without that, it
    would no longer be true.

What users see

  • Users moving from 1.x: nothing to do for this option. WithIdempotentRESTPublishing
    keeps its name; only the package changes, from ably to pubsub (server/pubsub or
    device/pubsub), like every other option.
  • Anyone building against the unreleased integration/v2 branch who uses
    WithIdempotentHTTPPublishing must switch to WithIdempotentRESTPublishing. The HTTP
    name no longer compiles.

Decisions

  • No deprecated alias. WithIdempotentHTTPPublishing is removed outright. 2.0 has not
    been released, so no released version ever had the HTTP name, and ably-java removed its
    counterpart in the same way.

Out of scope

  • All other REST to HTTP renames stay: HTTPClient, NewHTTPClient, HTTPChannels,
    HTTPChannel, HTTPPresence, HTTPRequest, HTTPPaginatedItems,
    HTTPPaginatedResponse, WithHTTPClient, WithHTTPRequestTimeout, and the
    rest_* to http_* file renames.
  • Whether the IDL Rest* class names should map to Go HTTP* names.
  • CHANGELOG.md keeps its historic 1.x IdempotentRestPublishing entry.

Validation

Check Result
gofmt -l . empty
go build ./... pass
go vet ./... with default, unit and integration tags pass
go test -tags=unit ./... pass
go test ./server/... ./device/... -count=1 (incl. TestServerReExportsInternalAPI, TestDeviceReExportsInternalAPI) pass
Sandbox: go test ./internal/ably/ -tags=integration -run '^(TestIdempotentPublishing|TestIdempotent_retry)$' -count=1 pass on the first run
Scratch consumer module (replace to this branch) calling WithIdempotentRESTPublishing(true) from server/pubsub and device/pubsub builds
Same consumer using WithIdempotentHTTPPublishing fails as expected: undefined: server.WithIdempotentHTTPPublishing
go doc ./server/pubsub WithIdempotentRESTPublishing (and device) shows the REST name, default true, TO3n
git grep -n -i 'idempotentHTTP|idempotent_http', git grep -n TO3s empty
Independent review of the diff (separate reviewer, given only the diff and the scope) pass: rename-only plus the UPDATING.md edits, nothing out of scope touched

Merging

A separate PR is being prepared from branch v2/module-path-version-godoc (not open yet
at the time of writing). It adds the /v2 module suffix, which rewrites every import path.
The two PRs will conflict textually in server/pubsub/api.go, device/pubsub/api.go,
UPDATING.md and possibly test import lines. Whichever lands
second needs a small rebase: keep the /v2 import paths from that PR and the
IdempotentRESTPublishing names from this one. No other lines overlap.

Links

Summary by CodeRabbit

  • Updates
    • The idempotent publishing option is now named WithIdempotentRESTPublishing instead of WithIdempotentHTTPPublishing in both device and server APIs. Its default and behavior remain unchanged.
  • Documentation
    • Updated the API naming guidance and device option list to reflect the current option name. Removed the outdated entry stating that it was renamed to WithIdempotentHTTPPublishing.

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.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cdaa15c7-e804-466d-8d1e-a1931951b89c
Commits

Reviewing files that changed from the base of the PR and between 2fa1512 and 5a13a42.

Files selected for processing: 7
  • UPDATING.md
  • device/pubsub/api.go
  • internal/ably/http_channel.go
  • internal/ably/http_channel_integration_test.go
  • internal/ably/options.go
  • server/pubsub/api.go
  • server/pubsub/api_test.go

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

The idempotent publishing option and its internal setting were renamed from HTTP to REST. The publishing logic, tests, and updating guide now use the REST name. The option’s default and documented behavior remain unchanged.

Changes

REST Idempotent Publishing

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: Low

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: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 …
Docstring Coverage Passed 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. Documentat…
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.
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.

❤️ Share

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.

Comment thread UPDATING.md
| `ably.NewREST` | `pubsub.NewHTTPClient` |
| `ably.WithIdempotentRESTPublishing` | `pubsub.WithIdempotentHTTPPublishing` |

`WithIdempotentRESTPublishing` (the `IdempotentRESTPublishing` option) deliberately

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should explicitly mention this

@sacOO7
sacOO7 merged commit f85c478 into integration/v2 Oct 30, 2026
10 of 12 checks passed
@sacOO7
sacOO7 deleted the v2/keep-idempotent-rest-publishing branch October 30, 2026 08:38

This branch was successfully deployed

1 active deployment
staging/pull/726/godoc — 5a13a422 Deployed Oct 29, 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.

2 participants