Skip to content

DOC-7177 Document ioredis smart client handoffs (SCH) - #4252

Open
andy-stark-redis wants to merge 2 commits into
mainfrom
DOC-7177-ioredis-sch
Open

andy-stark-redis wants to merge 2 commits into
mainfrom
DOC-7177-ioredis-sch

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Documents smart client handoffs (SCH) for ioredis, added in v6.1.0 by redis/ioredis#2165.

  • content/develop/clients/ioredis/connect.md: new Connect using Smart client handoffs (SCH) section (same anchor as the other clients).
  • content/develop/clients/sch.md: ioredis row in the support table (v6.1.0 standard routing, no OSS Cluster API) and a relatedPages entry.

🤖 Generated with Claude Code


Note

Low Risk
Documentation-only changes with no runtime or security impact.

Overview
Documents Smart client handoffs (SCH) for ioredis (v6.1.0+), aligning it with the other Redis client connect guides.

The ioredis connect page gets a new Connect using Smart client handoffs (SCH) section with a connection example and option reference (maintNotifications, maintEndpointType, relaxed timeouts, RESP3, cluster/Sentinel limitations, WatchError, and PrivateLink/PSC notes). Minor fixes on the same page: front matter description corrected to Node.js/JavaScript, and the TLS example uses readFileSync consistently for the CA cert.

The SCH overview page links to the new anchor and adds an ioredis row (standard routing v6.1.0; OSS Cluster API not supported).

Reviewed by Cursor Bugbot for commit 2059dc6. Bugbot is set up for automated code reviews on this repo. Configure here.

Add a "Connect using Smart client handoffs (SCH)" section to the ioredis
connect page (same anchor as the other clients) and an ioredis row to the
SCH support table on sch.md. Written against ioredis v6.1.0-beta.1
(redis/ioredis#2165); parked until stable v6.1.0 ships.

Verified against the installed [email protected] package, not the
release notes: option names, defaults, and the MaintNotifications /
MaintEndpointType unions come from the shipped .d.ts; the example
type-checks (tsc --strict --skipLibCheck; without skipLibCheck the
library's own .d.ts fails on untyped redis-errors, an upstream gap).
No live handoff was tested: that needs a Redis Cloud/Software
maintenance event.

Scope facts from built/Redis.js and MaintenanceManager.js:
- Cluster connections (ConnectionPool, subscribers, cluster/index) force
  maintNotifications "disabled", so the OSS Cluster API cell is "-".
- Sentinel, Unix socket, custom Connector, subscriber and monitor
  connections still register and open the relaxed-timeout window on
  MIGRATING/FAILING_OVER/MOVING; only the handoff is skipped
  (canHandoffConnection / resolveMaintConfiguredEndpoint return
  false/null) and they reconnect normally. A WebFetch summary of
  Redis.ts claimed these were not registered at all - wrong.
- RESP3 is the default since v6.0.0 (RedisOptions.js protocol: 3), so
  unlike node-redis the example omits a protocol option.
- Error classes are exported as CommandTimeoutDuringMaintenanceError and
  SocketTimeoutDuringMaintenanceError (.name matches). The option JSDoc
  says "CommandTimeoutDuringMaintenance"; docs use the importable name.
- A handoff invalidates WATCH and EXEC rejects with WatchError
  ("Retry it with a fresh WATCH") - not documented for node-redis.

Rejected: documenting the "ioredis:maintenance" diagnostics_channel
(DataHandler.js publishes each raw notification on it). No other
client's SCH section documents observability hooks; add if asked.

Unpark watch: re-diff built/redis/RedisOptions.d.ts,
built/maintNotifications/index.d.ts and built/index.d.ts at the v6.1.0
tag; cluster support landing before GA would change the table cell and
the version note.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@andy-stark-redis andy-stark-redis added do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead. labels Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7177

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 6 related items from repository history (1 new this commit):

Memory updated at 2059dc6

@andy-stark-redis andy-stark-redis self-assigned this Oct 13, 2026
@andy-stark-redis andy-stark-redis added the clients Client library docs label Oct 13, 2026
…nits

- Frontmatter description said "Python"; now "Node.js/JavaScript",
  matching ioredis/_index.md.
- TLS example mixed readFileSync and fs.readFileSync; all three now use
  bare readFileSync, matching the node-redis connect page.
- SCH relaxed-timeout options state "in milliseconds" explicitly
  (confirmed by the RedisOptions.d.ts JSDoc).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@andy-stark-redis

Copy link
Copy Markdown
Contributor Author

Unpark reflection (2026-11-24): predicted vs actual

The park snapshot held. ioredis v6.1.0 went stable on 2026-11-23 and contains #2165 (behind_by: 0 against merge d8ae3cb2). Four of the five pinned files have the same blob SHAs at the stable tag as at beta.1 (RedisOptions.ts, maintNotifications/index.ts, lib/index.ts, cluster/ConnectionPool.ts), so the MEDIUM-confidence identifiers did not move. The fifth, lib/Redis.ts, changed, but the diff is reconnect, SELECT and monitor fixes only. The handoff logic is untouched. The cluster exclusion, the highest-risk checklist item, still holds.

Checks run against [email protected] in a scratch project:

  • The section's example compiles under tsc --strict --skipLibCheck, and an invalid maintEndpointType is rejected by the types.
  • Runtime defaults are protocol 3, maintNotifications "auto", maintEndpointType "auto", and 10000 for both relaxed timeouts.
  • WatchError, CommandTimeoutDuringMaintenanceError and SocketTimeoutDuringMaintenanceError are exported, and .name equals the class name.

No doc edits were needed: the page already said v6.1.0, and no bannerText was ever added. The branch is 642 commits behind main, but git merge-tree reports a clean merge, so it needs no rebase and was not force-pushed.

Not re-verified: the bodies of canHandoffConnection and resolveMaintConfiguredEndpoint (only confirmed absent from the beta.1 → v6.1.0 diff), and a live handoff, which needs a Redis Cloud or Redis Software maintenance event. Without --skipLibCheck the library's own .d.ts still fails on the untyped redis-errors module at v6.1.0, which is an upstream issue and does not affect the page.

@andy-stark-redis
andy-stark-redis requested a review from a team November 24, 2026 11:14
@andy-stark-redis andy-stark-redis removed do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead. labels Nov 24, 2026
@andy-stark-redis andy-stark-redis changed the title DOC-7177 Document ioredis smart client handoffs (SCH) [PARKED] DOC-7177 Document ioredis smart client handoffs (SCH) Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant