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

Commands that return arrays use zero-based indexing when executed within lua scripts #691

Open
jayalfredprufrock opened this issue Feb 16, 2019 · 1 comment
Labels

Comments

@jayalfredprufrock
Copy link

Super excited to see support for lua scripts which was the one thing preventing me from using this library in my unit tests! Many thanks to @nbarrera and @stipsan for all the work on that front.

While integrating, I've got a few tests failing (that pass when using an actual ioredis connection) and I think I tracked it down to commands that have an array response (i.e. zrange). It seems that the table/array returned from such commands uses zero-based indexing instead of the expected 1-based indexing.

Here is a small test case to show what I'm talking about https://runkit.com/embed/orgqbiq0910j

It wasn't immediately clear to me where/how to fix this or I would just submit a PR.

@stipsan
Copy link
Owner

stipsan commented Jul 30, 2019

Hey! It turns out the problem got flipped after we released

image

in v4.13.1.

I'll circle back later and check this out if nobody else can meanwhile 😃

@stipsan stipsan pinned this issue Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants