Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: send correct command during auto-pipelining of .call() operations #1579

Merged
merged 2 commits into from May 17, 2022

Conversation

Fusl
Copy link
Contributor

@Fusl Fusl commented May 17, 2022

When using custom .call() operations (such as .call("FT.SEARCH", "index", ...)) in combination with auto-pipelining, the resulting redis command would not include the FT.SEARCH command itself.

call itself is defined as the result of generateFunction("call", "utf8") which shifts the command out of the args array into a separate variable commandName and then uses functionName (call), commandName (FT.SEARCH) and args (index, ...) to call executeWithAutoPipelining. executeWithAutoPipelining however completely ignores the commandName and assumes that the functionName is what we're actually trying to execute when it forwards the command to pipeline[functionName](...args);. As far as I can tell, we can't just use commandName instead of functionName in here since the pipeline object itself isn't prepared for arbitrary commands so we have to keep referring to it as call but we can unshift the actual commandName back into the arguments which will successfully make it into the command.

@luin luin merged commit e41c3dc into redis:main May 17, 2022
@luin
Copy link
Collaborator

luin commented May 17, 2022

Awesome! Thanks for the contribution!

github-actions bot pushed a commit that referenced this pull request May 17, 2022
## [5.0.5](v5.0.4...v5.0.5) (2022-05-17)

### Bug Fixes

* improve typing for redis.multi ([#1580](#1580)) ([f9f875b](f9f875b))
* send correct command during auto-pipelining of .call() operations ([#1579](#1579)) ([e41c3dc](e41c3dc))
@github-actions
Copy link

🎉 This PR is included in version 5.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

kylecannon pushed a commit to kylecannon/ioredis that referenced this pull request Dec 8, 2023
janus-dev87 added a commit to janus-dev87/ioredis-work that referenced this pull request Mar 1, 2024
## [5.0.5](redis/ioredis@v5.0.4...v5.0.5) (2022-05-17)

### Bug Fixes

* improve typing for redis.multi ([#1580](redis/ioredis#1580)) ([f9f875b](redis/ioredis@f9f875b))
* send correct command during auto-pipelining of .call() operations ([#1579](redis/ioredis#1579)) ([e41c3dc](redis/ioredis@e41c3dc))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants