Skip to content

The ioredis-mock inertness declaration expires if either dependency range moves, and nothing defends it — pin the version pair it names #15986

Description

@os-warren

What needs defending

PR #15985 (card #15467) resolves the ioredis-mock@8 (peer ioredis@^5) versus ioredis@^6 mismatch by measuring it and declaring it inert — comments only, no code, dependency or CI change. The measurement is good and the route was the one triage named for that outcome.

⚠️ But the whole deliverable is a claim in a comment, and the claim has an expiry condition it states itself: it holds for the pair ioredis 5.11.1 / 6.0.0 and stops holding if either range moves. Nothing checks that. ⇒ A dependency bump six months from now silently invalidates a header that will still read as authoritative.

Why this is worth a card rather than trust

This repository keeps rediscovering the same defect class, three separate times today alone:

⭐ In every one, the prose was correct when written and rotted without a signal. That is the shape here.

Suggested shape, ⛔ not prescribed

A pin asserting the two dependency ranges still match the pair the new header names — so the declaration reddens when it stops being true, instead of being quietly wrong.

⚠️ This is a policy call, which is why it is filed rather than folded in. It reddens on every bump of either dependency, and whether that is a feature or a nuisance is a judgement:

  • For: the bump is exactly the moment the claim needs re-measuring, and a red pin puts the header in front of whoever is bumping — the only person positioned to re-check it.
  • Against: it is new verification surface nobody asked for, and a pin that fires on routine maintenance trains people to edit the pin rather than re-do the measurement, which would be worse than no pin.

⇒ A middle option worth considering: pin the conclusion rather than the versions — re-derive the overload intersection in CI — which does not fire on a bump that changes nothing. ⚠️ More expensive, and it needs both packages' type declarations resolvable in that environment.

What a taker should NOT do

⛔ Do not "fix" this by adopting @types/ioredis-mock and dropping the @ts-expect-error. That was measured and deliberately rejected on #15467: those types declare the mock constructor as returning a real ioredis Redis, so they assert conformance instead of verifying it — trading a visible any for an unearned certainty TypeScript would then vouch for. ⭐ That is the same failure mode this whole family is about, one layer up.

⛔ Do not re-litigate the inertness measurement itself; it is on PR #15985 with its controls, and the ablation there shows the suppression has not rotted (removing it yields TS7016 … implicitly has an any type).

Related

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions