-
Notifications
You must be signed in to change notification settings - Fork 11k
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
HSCAN in PHPRedis is not iterating properly #24222
Comments
Laravel uses Predis as a base line and it adjusts PhpRedis return values to same results in If you can, please submit a PR to 5.6 to fix the return value |
I hadn't specifically tested those as they weren't in the scope of feature I was working on but I would guess that's the case. I will work on getting a PR in place within the next few days. |
Thanks! I looks like |
I have fixes in place for all the scan methods, which I'll be polishing and pushing up, but have run into a few snags. PHPRedis scan apparently doesn't automatically prefix scope the scan command I will have to do some more testing but this could also apply to the other scans (z, s, and h). Is this something that should be handled in this PR, or should it be worked to be resolved in PHPRedis directly. For reference, phpredis/phpredis#548. Otherwise until that is resolved on PHPredis, I'm not sure if this issue can even move forward. |
Great to hear. Whatever gets us the closest experience to Predis we can handle internally. if PhpRedis gets an update, we can always adjust. |
So in further testing, I might have uncovered an additonal bug that was previously untested....or maybe is expected, but based on how the unit test is wired (that predis and phpredis and then prefixed phpredis all have the same assertions) I would expect each output to be identical. For example, prefixed connections: I do have fixes ready, but I don't just want to break unit tests or have incorrect assumptions about the fix in trying to solve something. My main issue is whether this is a bug or intended functionality for the prefixed connections. |
Puh, yeah I'd assume the same, if the connection has a prefix, it should add it to the scan. I'd suggest you break up the PRs, one for fixing the |
Would altering the assertions based on if the connection is prefixed be an acceptable bypass at this point to at least have the functions fixed and the unit tests pass? Either that or I could most likely just pass to the connections() method a param whether or not to add the prefixed connections. I'm guessing that committing default failed tests isn't the right way to handle this... |
I'd test two separate connections. |
* [6.x] Fix *scan methods for phpredis (#24222) * style(whitespace): add whitespace after operator
Description:
The hscan and perhaps additional commands are broken when using phpredis vs predis.
Predis has a completely different return syntax, which includes the cursor and results.
PHPRedis returns only the results and seems to use the $cursor ($it in their examples) by reference rather than by value some something ends up getting lost. Additionally, predis starts with $it/$cursor of 0, wheras PHPRedis starts with null.
Steps To Reproduce:
Using laravel and it's redis facade:
The text was updated successfully, but these errors were encountered: