feat(client): add WAITAOF command#3272
Open
sisyphusse1-ops wants to merge 1 commit into
Open
Conversation
Adds support for the WAITAOF command (introduced in Redis 7.2) which blocks the current client until the specified number of local and replica AOF fsyncs have been performed, or the given timeout is reached. Closes redis#2458
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
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.
What
Adds support for the
WAITAOFcommand (introduced in Redis 7.2).WAITAOFblocks the current client until the specified number of local and replica AOF fsyncs have been performed, or the given timeout (in milliseconds) is reached.The reply is a two-element array
[numLocalSynced, numReplicasSynced]matching the Redis spec.Why
Closes #2458.
How
packages/client/lib/commands/WAITAOF.ts— new command, modeled directly onWAIT.tsfor consistency.packages/client/lib/commands/WAITAOF.spec.ts— unit test fortransformArgumentsplus atestWithClientend-to-end check that mirrors the existingWAIT.spec.ts.packages/client/lib/commands/index.ts— wires upWAITAOFandwaitAofexports next toWAIT/wait, with matching JSDoc.Tested
npm run buildis clean.npm run lint:changedreports no warnings on the three changed files.The end-to-end test uses the same
redislabs/client-libs-test:8.8-m03server image the rest of the suite already pulls.Checklist
npm testpass with this change (including linting)? Yes — builttsc --buildcleanly andlint:changedis green on the three touched files;mochaagainstWAITAOF.spec.tsandWAIT.spec.tspasses.WAIT.Note
Low Risk
Adds a new client command and wiring with a small surface area; risk is limited to argument/reply typing and export naming (
waitAof) without affecting existing command behavior.Overview
Adds Redis 7.2+
WAITAOFsupport to the client, including a new command implementation that serializesWAITAOF <numLocal> <numReplicas> <timeout>and returns a two-number array reply.Exposes the command via
index.tsas bothWAITAOFand the convenience aliaswaitAof, and adds a mocha spec that validates argument transformation and an end-to-endclient.waitAofcall.Reviewed by Cursor Bugbot for commit 61a3916. Bugbot is set up for automated code reviews on this repo. Configure here.