Skip to content

chore(deps): bump ioredis to 6.0.0 and pin the RESP2 wire protocol - #241

Merged
Musiker15 merged 1 commit into
mainfrom
chore/ioredis-6-resp2
Aug 17, 2026
Merged

chore(deps): bump ioredis to 6.0.0 and pin the RESP2 wire protocol#241
Musiker15 merged 1 commit into
mainfrom
chore/ioredis-6-resp2

Conversation

@Musiker15

Copy link
Copy Markdown
Member

Bumps ioredis from 5.11.1 to 6.0.0 and sets protocol: 2 on the client.

Why not just merge #238

ioredis 6 has two breaking changes: it requires Node 20+ and it negotiates RESP3 by default. The engine requirement is already met (>=22), the protocol switch is the open question.

CI cannot answer it:

  • apps/web/src/lib/rate-limit.test.ts mocks getRedis entirely, so no test ever opens a connection.
  • The CI service is redis:7 on redis://localhost:6379, the default user without ACL or password. Production connects as the ACL user msk_forms over an authenticated URL.

So a green run on #238 proves the bump typechecks and builds, nothing more.

The failure mode is what makes that uncomfortable. getRedis() is deliberately fail-open and rateLimit() swallows command errors, which is right for availability. It also means a rejected handshake produces no error page and no crash. Rate limiting on the public submit endpoint would quietly stop applying and leave a single log line.

What this does instead

protocol: 2 keeps the v5 wire format, so the bump carries no protocol change. The only consumer is the fixed-window EVAL in the rate limiter, which gains nothing from RESP3.

RESP3 is worth adopting, but as its own change with a check against the live server, not as a side effect of a version bump.

Verification

lint, typecheck, test and build pass locally. The typecheck also confirms protocol is a real option in the v6 types.

Worth a look after deploy: hit a public form twice in quick succession and confirm the 429 still fires, or check redis-cli -u "$REDIS_URL" --scan --pattern 'rl:*' for live keys.

ioredis 6 negotiates RESP3 by default and requires Node 20+. The engine
requirement is already satisfied (>=22), but the protocol switch is not
covered by CI: the Redis client is fully mocked in the unit tests, and the
CI service runs the default user on localhost, while production connects as
an ACL user over an authenticated URL.

That combination is the problem. getRedis() is deliberately fail-open, so a
handshake that the server rejects would not surface as an error page or a
crash. Rate limiting on the public submit endpoint would simply stop
applying, leaving only a log line behind.

Set protocol: 2 to keep the v5 wire format. The only consumer is the fixed
window EVAL in the rate limiter, which gains nothing from RESP3, so there
is no reason to take that risk as a side effect of a version bump. RESP3
can be adopted later as its own change, verified against the live server.

Supersedes #238, which bumps the same dependency without the pin.
@Musiker15
Musiker15 force-pushed the chore/ioredis-6-resp2 branch from 620f698 to ed4e7ef Compare August 17, 2026 21:16
@Musiker15
Musiker15 merged commit 3a0733b into main Aug 17, 2026
4 checks passed
@Musiker15
Musiker15 deleted the chore/ioredis-6-resp2 branch August 17, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant