Commit cacfac4
committed
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_01XpTx2tbq3pZRYAdoGt6E6Y1 parent ceb4877 commit cacfac4
1 file changed
Lines changed: 58 additions & 3 deletions
Lines changed: 58 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 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 | + | |
10 | 53 | | |
11 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
12 | 67 | | |
13 | 68 | | |
14 | 69 | | |
| |||
0 commit comments