-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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: XAUTOCLAIM after a TRIM with pending messages returns nil #2565
Conversation
@Calyhre Nice catch! but only edit: actually |
b9e50e4
to
518eb1a
Compare
@leibale Nice! I also noticed the issue disappeared in Redis V7.
I moved the fix to it's own method in |
518eb1a
to
eb2c37e
Compare
@leibale Alright, I think I ended up porting a very similar fix to the one you did on V5. Let me know what you think. I do have one doubt though: It seems right to me to reflect the differences between Redis versions (returning null or not based on Redis answer), but the end type is not version dependent. Using Redis V7, This might be complicated, but should the typing be dependent of the Redis server version? |
@Calyhre Thanks for working on that! I'll review it next week :) Regarding the differences between Redis versions - at the moment all the "command interfaces" are implemented with Redis 5-7.2 in mind. We might split the commands into their own sub-package at some point, then we'll be able to publish edit: BTW, in v5 we're adding support for RESP3, so if we wanna support all the "current" Redis versions it'll be |
Codecov ReportPatch coverage:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2565 +/- ##
==========================================
+ Coverage 95.70% 95.75% +0.04%
==========================================
Files 456 462 +6
Lines 4561 4567 +6
Branches 524 512 -12
==========================================
+ Hits 4365 4373 +8
Misses 127 127
+ Partials 69 67 -2
☔ View full report in Codecov by Sentry. |
@Calyhre |
Awesome thank you! And sorry for committing the hard coded redis test urls 🤦 |
@Calyhre I'll take PRs where all I need to do is remove "hard coded redis tests URLs" any day.. ;) Thank you! |
Description
Running a
XAUTOCLAIM
after aTRIM
while messages are pending results in Redis returning an array withnil
as the unique element.The generic transformer will then crash here trying to iterate on
null
withTypeError: .for is not iterable
You can reproduce the issue with this:
Checklist
npm test
pass with this change (including linting)?