Nordix / hiredis-cluster

C client library for Valkey/Redis Cluster. This project is used and sponsored by Ericsson. It is a fork of the now unmaintained hiredis-vip.
BSD 3-Clause "New" or "Revised" License
86 stars 42 forks source link

Fix code for XREAD and XREADGROUP and add test case #187

Closed zuiderkwast closed 1 year ago

zuiderkwast commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

zuiderkwast commented 1 year ago

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).