Repository navigation
feat: require caller-owned Redis clients - #67
Merged
Merged
Conversation
This was referenced Jul 18, 2026
lan17
marked this pull request as ready for review
July 18, 2026 22:15
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
This PR makes Redis connection ownership explicit and removes DialCache's lazy client factory.
Applications now create and connect a Redis client, adapt it to
DialCacheRedisClient, and pass it throughredis.client. DialCache borrows that client for cache operations but never creates, connects, drains, disposes, or closes it.Ownership contract
invalidateRemote()promises, including fallbacks that may still enqueue a Redis write.Scripthandles only; the application disposes the adapter after draining, then closes the GLIDE client.close()or lifecycle subsystem.Public API and migration
RedisConfig.clientis now required.RedisConfig.createClientis removed.RedisClientFactorytype is removed.createClientproperty receive an explicit migration error.Migration is straightforward: move the old factory body into application startup, retain the client handle, and pass the connected adapter as
redis.client. Direct clients already worked in previous releases, so applications can deploy the migrated construction before upgrading DialCache.This does not change cache keys, Redis frames, Lua protocols, metrics, hit/miss semantics, or fail-open behavior, so rolling upgrades and rollbacks remain wire-compatible.
Runtime impact
Redis operations now use the semantic client directly. This removes the retained factory promise and per-operation client resolution while leaving read, write, invalidation, and fallback behavior unchanged.
Validation
pnpm check: 179 tests, typecheck, coverage, build, declarations, and packed-package smokegit diff --checkResolves #20