feat: remove flushAll from public API#48
Merged
Merged
Conversation
lan17
marked this pull request as ready for review
July 15, 2026 17:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ignoredkeyPrefixand could delete unrelated data across every cluster primary. This change removes the capability rather than replacing it:DialCache.flushAll()flushAll()fromDialCacheRedisClientflushallroutingThis 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
DialCacheinstance with the same cache-key identity afterSCRIPT 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
DialCacheRedisClientwithout a flush method and asserts that neither public contract exposesflushAll.Validation
Validated on Node
v22.22.0:corepack pnpm checkcorepack pnpm test:integration: 46 passed across Redis 6.2, Valkey, and a three-node Redis Clustergit diff --check