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

Redis::keys may return false? #2154

Closed
1 of 2 tasks
come-nc opened this issue Sep 22, 2022 · 3 comments
Closed
1 of 2 tasks

Redis::keys may return false? #2154

come-nc opened this issue Sep 22, 2022 · 3 comments

Comments

@come-nc
Copy link

come-nc commented Sep 22, 2022

Expected behaviour

Redis::keys should always return an array according to documentation.

Actual behaviour

It seems it returns false in some cases according to the trace we get here:
nextcloud/server#34155

I'm seeing this behaviour on

  • OS: Ubuntu 22.04
  • Redis:
  • PHP: php 8.1
  • phpredis:

Steps to reproduce, backtrace or example script

See nextcloud/server#34155

I've checked

  • There is no similar issue from other users
  • Issue isn't fixed in develop branch
@michael-grunder
Copy link
Member

This is correct.

In actuality, most PhpRedis methods may return false (in the event of a failure) and Redis itself (if inside a pipeline/multi block).

I made #2015 to make this clear in our stub file but we haven't merged it yet as it likely requires a major version bump.

@come-nc
Copy link
Author

come-nc commented Sep 28, 2022

This is correct.

In actuality, most PhpRedis methods may return false (in the event of a failure) and Redis itself (if inside a pipeline/multi block).

I made #2015 to make this clear in our stub file but we haven't merged it yet as it likely requires a major version bump.

Good to know. It would be good to at least fix the stub to match the behavior of the code.

So what does it mean when Redis::keys returns false, is it the same as an empty array? Or does it mean an error happened?

@michael-grunder
Copy link
Member

Closing as #2015 was merged.

The stubs should be correct now.

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

No branches or pull requests

2 participants