Commit 5b41477
docs(service-cluster-redis): record the measured ioredis 5-vs-6 gap in the contract test header, and drop a live-Redis path that never existed (#15985)
* docs(service-cluster-redis): record the measured ioredis 5-vs-6 gap in the contract test header, and drop a promised live-Redis path that never existed
The contract test runs `ioredis-mock@8.13.1` (peer `ioredis: ^5`) against a
package depending on `ioredis@^6`, with the untyped import suppressed by
`@ts-expect-error`. This commit changes no code and no dependency: it writes
down the measurement that was missing, so the next reader starts where this
one finished.
Measured against ioredis 5.11.1 (newest release satisfying the mock's `^5`
peer) and 6.0.0 (the version resolved in this workspace):
- all 14 Redis commands this package issues carry every v5 overload verbatim
into v6's RedisCommander.d.ts; `set` is a strict superset there (v6 adds
IFEQ/IFNE/IFDEQ/IFDNE), and nothing used here was removed or re-shaped
- v6's RESP3 reply mapping is opt-in: the class defaults its ReplyMapping
parameter to "legacy", ChainableCommander defaults to "resp2", and
duplicate() with no override inherits the caller's mapping. This package
never passes replyMapping, so every reply shape it sees is the v5 one
- the three RedisOptions keys client.ts sets (lazyConnect,
maxRetriesPerRequest, enableAutoPipelining) are declared identically
The peer mismatch is therefore real but inert on the surface these suites
drive. The header now says so, names the version pair the claim rests on, and
states that the claim expires if either range in package.json moves.
Also recorded: these suites reach the mock only through the injected client
and the pub/sub duplicate, never through createRedisClient(), so
`new Redis(url, options)` — this package's only contact with ioredis's
constructor and connection surface, and the area v6 changed most — is
exercised by nothing in this file. That is why the gap is inert here, and it
is not a reason to trust the double.
The header additionally promised `RUN_REAL_REDIS=1` + `REDIS_URL` and
"conditional describe.skipIf blocks at the bottom". No such blocks exist, and
both names occurred nowhere in the package outside that one sentence. The
false promise is removed rather than left standing as an escape hatch nobody
can take.
The `@ts-expect-error` stays. Removing it fails typecheck with TS7016 —
ioredis-mock ships no `types` field and no .d.ts of its own — so the
suppression has not rotted. Its comment now also records what it costs: with
the module untyped the client is `any` and satisfies ioredis's Redis type
without being checked against it, which is the second reason a v5-vs-v6
divergence could not surface here. `@types/ioredis-mock` would type the seam
but only asserts `new(): ioredis.Redis` rather than describing the mock, so
adopting it would trade an honest `any` for an unearned certainty; that trade
is left to a maintainer.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y
* docs(service-cluster-redis): narrow three contract-test header sentences to the populations actually measured
Review found three sentences in the header whose stated population was wider
than the measurement behind them. All three are corrected here; the diff stays
comments-only (proved: every added and removed line is a comment line, with a
control showing the filter admits code).
1. The "no live-Redis path" parenthetical claimed both names appeared nowhere
in the package. Re-scanned the WHOLE package rather than `src/`:
`RUN_REAL_REDIS` and `skipIf` do occur nowhere outside that sentence, so the
escape hatch genuinely never existed — but `REDIS_URL` occurs at
`README.md:42`, as the env var a caller feeds to `createRedisClient()`. The
sentence now says exactly that instead of over-reaching.
2. `multi` was listed among the commands carrying their v5 overloads verbatim
into `RedisCommander.d.ts`. That is false for `multi` specifically: it is
declared there in NEITHER version (measured 0 and 0, against a control
member `exec` reading 1 and 1); it lives on `Transaction`. Measured on its
real home, it DID change — all four overloads went from returning
`ChainableCommander` to returning it parameterised by a reply mapping. It is
removed from the verbatim list and given its own bullet stating why the
change is inert here: the parameter defaults to "resp2", the class defaults
to "legacy" and extends `Transaction` at "resp2", so a client built without
`replyMapping` resolves `multi()` to the non-RESP3 instantiation.
3. "v6's one substantive change reachable from this package" was wrong in the
other direction: v6 also changes connection defaults that are NOT opt-in —
`protocol: 3` (no such option in v5) and `keepAlive` 0 to 30000. The
sentence is scoped to "the surface these suites drive", which is what was
measured, and the connection-default changes are named as
changed-but-unexercised, since no suite here calls `createRedisClient()`.
Two further wording fixes, each closing a way the note could read as true when
it is not:
- the expiry clause now also fires on a RESOLVED-version move under an
unchanged caret range, which a lockfile bump alone will do; as written it
expired only when a range moved
- the unmet-peer warning is scoped to a resolving install, since a frozen
re-link prints nothing
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2024eca commit 5b41477
1 file changed
Lines changed: 78 additions & 3 deletions
Lines changed: 78 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
6 | 14 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
10 | 73 | | |
11 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
12 | 87 | | |
13 | 88 | | |
14 | 89 | | |
| |||
0 commit comments