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: Return table for HGETALL from custom Lua scripts #1151

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

jcostello-atlassian
Copy link
Contributor

This commit fixes a bug that causes HGETALL commands in Lua
to fail with ioredis-mock.

Redis returns an array reply for HGETALL. ioredis and ioredis-mock
convert this response to a JS object.

When using custom Lua scripts with ioredis, however, HGETALL returns
and array-like table. With this change, HGETALL will also return an
array-like table from Lua with ioredis-mock.

@jcostello-atlassian jcostello-atlassian changed the title Return table for HGETALL from custom Lua scripts fix: Return table for HGETALL from custom Lua scripts Feb 22, 2022
@jcostello-atlassian
Copy link
Contributor Author

Hi @stipsan, this is my first time contributing to ioredis-mock (sidenote: thank you for maintaining this repo!) Is there anything left to do here before the PR is ready for review? Not sure if all CI steps passed or if something got stuck again.

Copy link
Owner

@stipsan stipsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome, and thnx for your contribution🥳🎉✨

@stipsan
Copy link
Owner

stipsan commented Feb 23, 2022

Could you run npx prettier . --write locally and push the changes? That should fix the CI complaints ☺️ then we should be ready for merge & release!

This commit fixes a bug that causes HGETALL commands in Lua
to fail with ioredis-mock.

Redis returns an array reply for HGETALL. ioredis and ioredis-mock
convert this response to a JS object.

When using custom Lua scripts with ioredis, however, HGETALL returns
and array-like table. With this change, HGETALL will also return an
array-like table from Lua with ioredis-mock.
@stipsan stipsan enabled auto-merge (squash) February 24, 2022 00:20
@stipsan stipsan enabled auto-merge (squash) February 24, 2022 00:22
@stipsan stipsan merged commit 7737f1b into stipsan:main Feb 24, 2022
@stipsan
Copy link
Owner

stipsan commented Feb 24, 2022

🎉 This PR is included in version 7.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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