feat: add cluster mode support and harden registration validation#33
Open
janisto wants to merge 8 commits intofastify:mainfrom
Open
feat: add cluster mode support and harden registration validation#33janisto wants to merge 8 commits intofastify:mainfrom
janisto wants to merge 8 commits intofastify:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends @fastify/valkey-glide to support managed cluster clients via a new clientMode option, tightens registration/option validation (including rejecting mixed default + namespaced registrations), and updates TypeScript typings, tests, and documentation accordingly.
Changes:
- Add
clientMode: 'standalone' | 'cluster'to create eitherGlideClientorGlideClusterClient, with runtime validation. - Enforce stricter registration rules (no mixed default + namespaced usage in the same Fastify instance tree) and validate
namespace(empty string rejected). - Update TS types +
tsdassertions, README examples/upgrade notes, and add/adjust unit tests.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
index.js |
Adds cluster client creation and mixed-mode detection using an internal namespace-container marker; adds option validation. |
types/index.d.ts |
Updates public TS types to represent fastify.valkey as a union (root client vs namespaced container) and adds cluster option typings. |
types/index.test-d.ts |
Updates tsd tests for the new typings and adds negative assertions that require narrowing. |
test/index.test.js |
Adds unit tests for empty namespace, mixed-mode rejection, and cluster client creation; fixes one close-client test access. |
README.md |
Adds upgrade notes and new examples (cluster + async/await usage). |
package.json |
Bumps package version and broadens the allowed @valkey/valkey-glide semver range. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
4 tasks
Fdawgs
reviewed
May 7, 2026
2 tasks
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.
Adds managed cluster support (clientMode: 'cluster'), strengthens runtime validation (invalid clientMode, empty namespace, and mixed default/namespaced registration rejection), updates typings/tests accordingly, and refreshes README with upgrade notes and corrected async usage/examples.
Fix #31
Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct