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 code for XREAD and XREADGROUP and add test case #187

Merged
merged 4 commits into from
Sep 1, 2023

Conversation

zuiderkwast
Copy link
Collaborator

The code for finding keys in XREAD and XREADGROUP commands was untested and incorrect. Here it is fixed and a test case is added.

Fixes #186

@zyhuf
Copy link

zyhuf commented Sep 1, 2023

image
It seems that the 'startfrom' variable has lost its significance in the code. Should it be removed? Please confirm the code logic.
@zuiderkwast

@bjosv
Copy link
Collaborator

bjosv commented Sep 1, 2023

LGTM!
I'll guess it would be nice to add a test for XREAD as well?

command.c Show resolved Hide resolved
@zuiderkwast
Copy link
Collaborator Author

I'll guess it would be nice to add a test for XREAD as well?

OK, done. Also changed the test for XREADGROUP so the group name and the consumer name are "streams", to make sure we don't mistake those for the STREAMS keyword (i.e. if we don't respect startfrom we would get the wrong result).

Copy link
Collaborator

@bjosv bjosv left a comment

Choose a reason for hiding this comment

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

Nice.

@zuiderkwast zuiderkwast merged commit 075ee49 into Nordix:master Sep 1, 2023
32 checks passed
@zuiderkwast zuiderkwast deleted the fix-xreadgroup-special-code branch September 1, 2023 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to find keys of command XREADGROUP
3 participants