Skip to content

Move to actioncable-client v2 - #485

Open
jeremy wants to merge 2 commits into
mainfrom
actioncable-client-v2
Open

jeremy wants to merge 2 commits into
mainfrom
actioncable-client-v2

Conversation

@jeremy

@jeremy jeremy commented Sep 22, 2026

Copy link
Copy Markdown
Member

basecamp/actioncable-go was renamed to basecamp/actioncable-client and became a multi-language repository. The Go client now lives in go/ as the module github.com/basecamp/actioncable-client/go/v2. This moves us from github.com/basecamp/actioncable-go v1.1.0 to github.com/basecamp/actioncable-client/go/v2 v2.0.2.

API changes absorbed

None needed at call sites. Between v1.1.0 and v2.0.2 the exported API only grew:

  • added ErrMessageTooBig, *HandshakeError, *CloseError, the StatusCloser interface, and a Version constant
  • nothing removed or renamed; the package is still actioncable

The imports now carry an explicit actioncable name, because the path ends in go/v2 and goimports (in make lint) asks for it.

Behavior verified

client.go, options.go, dispatcher.go and subscription.go are byte-identical between v1.1.0 and v2.0.2. That means WithStopOnError, which stops reconnecting on an authentication failure (#466, actioncable-client#9), works exactly as before.

  • TestAuthenticationFailureStopsAReconnect and TestOnlyAuthenticationFailuresStopReconnects pass against v2.0.2 with -race -count=1. With the WithStopOnError line removed, the first test fails with "client kept reconnecting after authentication failed", so it really does test the library's behavior.
  • make check passes.

The v2 behavior changes are all in the built-in WebSocket transport, and none of them affects us:

  • a refused upgrade returns *HandshakeError, with the same message as before
  • a server close frame returns *CloseError; a close frame with no code now gives *CloseError{Code: 1005} where it used to give io.EOF
  • a message that is too big wraps ErrMessageTooBig
  • the default User-Agent is actioncable-client, but we set our own in the header func

Nothing here compares transport errors to io.EOF or to message strings.

nix/package.nix: the vendorHash is updated to the hash the nix-build job computed for the new module.

Docs: the link in AGENTS.md (which was missing its scheme) and the two API-COVERAGE.md rows now point to actioncable-client.

Overlap with open PRs

Two open PRs change nearby lines: #473 changes the hey-sdk line in go.mod, which is right next to this one, and #344 and #185 change AGENTS.md in other sections. Whichever lands second may need a one-line rebase. None of them conflicts in the code.

basecamp/actioncable-go was renamed to basecamp/actioncable-client and its
Go module now lives at github.com/basecamp/actioncable-client/go/v2. Switch
the import path and require to v2.0.2.

The exported API is a superset of v1.1.0 and client.go is unchanged, so
WithStopOnError keeps stopping reconnects on an authentication failure.
Copilot AI balanced review requested due to automatic review settings September 22, 2026 22:05
@jeremy
jeremy requested a review from a team as a code owner September 22, 2026 22:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-22T22:11:43.520389Z f33fe8b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

The dependency bump leaves the Nix vendor hash stale, causing the required Nix build to fail.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Migrates Action Cable to its renamed v2 Go module while preserving existing watch behavior.

Changes:

  • Updates dependency/import paths to actioncable-client/go/v2.
  • Updates tests and Action Cable documentation.
  • Leaves the required Nix vendorHash update outstanding.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
internal/​cmd/​watch.go Updates Action Cable import.
internal/​cmd/​watch_test.go Updates test import.
internal/​cmd/​watch_new_test.go Updates new-mail test import.
internal/​cmd/​watch_calendar.go Updates calendar watch import.
internal/​cmd/​tui_watch.go Updates TUI watch import.
internal/​cmd/​tui_watch_test.go Updates TUI watch test import.
internal/​cable/​cable.go Migrates cable client import.
internal/​cable/​cable_test.go Migrates cable tests.
go.mod Replaces the v1 module with v2.
go.sum Updates module checksums.
API-COVERAGE.md Renames the documented client.
AGENTS.md Updates the project link and module description.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread go.mod
@jeremy

jeremy commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

@codex review

Copilot AI left a comment

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.

Copilot review overview

🟢 Approved

The new module exists, preserves the consumed API, updates every import, and includes synchronized checksum and Nix metadata.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: f33fe8bd46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants