Skip to content

feat: remove flushAll from public API#48

Merged
lan17 merged 1 commit into
mainfrom
agent/remove-flush-all
Jul 15, 2026
Merged

feat: remove flushAll from public API#48
lan17 merged 1 commit into
mainfrom
agent/remove-flush-all

Conversation

@lan17

@lan17 lan17 commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

Remove the database-wide flush capability from DialCache's public and internal contracts.

This closes #13.

Design and API impact

DialCache.flushAll() was unsafe as a library operation because its Redis implementations ignored keyPrefix and could delete unrelated data across every cluster primary. This change removes the capability rather than replacing it:

  • remove DialCache.flushAll()
  • remove flushAll() from DialCacheRedisClient
  • remove local and Redis internal flush forwarding
  • remove node-redis cluster-primary administration and GLIDE flushall routing
  • update package-consumer types, mocks, tests, and README documentation

This is an intentional API break. The PR does not add namespace clearing, local clearing, a compatibility alias, or any release/versioning workflow change.

Test design

Raw Redis flushAll() remains only in isolated integration-test fixture setup.

The Redis Cluster recovery test now creates a fresh DialCache instance with the same cache-key identity after SCRIPT FLUSH. That forces real remote reads across cluster shards and verifies per-node script recovery without depending on a library flush API.

The packed TypeScript consumer both implements DialCacheRedisClient without a flush method and asserts that neither public contract exposes flushAll.

Validation

Validated on Node v22.22.0:

  • corepack pnpm check
    • strict typecheck
    • 5 release-version tests
    • 101 unit tests
    • ESM/CJS builds and declarations
    • packed ESM/CJS/type consumer
  • focused Redis Cluster integration test: 3 passed
  • corepack pnpm test:integration: 46 passed across Redis 6.2, Valkey, and a three-node Redis Cluster
  • git diff --check
  • production, README, and generated-declaration scan contains no flush capability

@lan17
lan17 marked this pull request as ready for review July 15, 2026 17:09
@lan17
lan17 merged commit 6710096 into main Jul 15, 2026
3 checks passed
@lan17
lan17 deleted the agent/remove-flush-all branch July 15, 2026 17:16
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.

Remove flushAll from DialCache and Redis adapter contracts

1 participant