Skip to content

feat: implement HSETEX command - #335

Merged
fatal10110 merged 4 commits into
mainfrom
feat/hsetex-command
Jul 2, 2026
Merged

feat: implement HSETEX command#335
fatal10110 merged 4 commits into
mainfrom
feat/hsetex-command

Conversation

@fatal10110

Copy link
Copy Markdown
Owner

Summary

  • Add Redis 8.0 HSETEX support with EX/PX/EXAT/PXAT/KEEPTTL and FNX/FXX handling.
  • Add ioredis and node-redis integration coverage for happy paths, conditions, expiration, wrong-type, parser, and error cases.
  • Document the command and lock its compatibility gates for redis-8.0 / valkey-9.0.

Root cause

redis-8.0 hash-field TTL support already covered the read/delete side, but the write-side HSETEX command was still missing from the command registry and compatibility profile surface.

Validation

  • TEST_BACKEND=mock focused ioredis/node-redis HSETEX tests
  • TEST_BACKEND=real focused ioredis/node-redis HSETEX tests
  • TEST_BACKEND=mock REDIS_COMPAT=redis-7.4|redis-8.0|valkey-9.0 profile gates
  • npm run build
  • npm test
  • npm run test:integration:mock
  • npm run test:integration:real
  • npm run lint

Refs #299

Adds the Redis 8.0 HSETEX command for setting one or more hash fields
with optional FNX/FXX existence conditions and EX/PX/EXAT/PXAT/KEEPTTL
expiration handling, gated to redis-8.0+/valkey-9.0+. Part of the
redis-8.0 compatibility delta tracked by #299 (a large umbrella issue
covering unrelated Redis Stack module families that are out of scope
for this change).
ctx.db.getHash() returns the raw hash shape (no .hasField()); the
previous FNX/FXX check reimplemented field-expiry logic against it
instead of reusing TrackedHashData, which already handles this and is
available inside ctx.db.updateHash(). Checking the condition inside
that same callback also means a failed condition on a missing key
never persists an empty hash, without a separate getHash() pass.
@fatal10110
fatal10110 marked this pull request as ready for review July 2, 2026 05:36
@fatal10110
fatal10110 merged commit c6ad045 into main Jul 2, 2026
12 checks passed
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