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#srem will always return an Integer in Redis 5.0.0. Use Redis#srem? instead. #222

Open
olliebennett opened this issue Feb 17, 2023 · 1 comment

Comments

@olliebennett
Copy link

Redis (4.8.1) is raising the following exception;

Redis#srem will always return an Integer in Redis 5.0.0. Use Redis#srem? instead.(called from: /app/vendor/bundle/ruby/3.2.0/gems/redis-namespace-1.10.0/lib/redis/namespace.rb:558:in `wrapped_send')

Related PRs:


To avoid noisy deprecation messages for now, I'm using the following (in config/initializers/redis.rb for a Rails app);

Redis.silence_deprecations = true

Happy to test if anyone's able to propose a fix 🙏 Thanks a lot

@amasses
Copy link

amasses commented Sep 12, 2023

@olliebennett the ideal solution would be to update the code calling these methods, and then update your Redis gem version.

The problem is that because redis-namespace is an abstraction on top of the redis-rb gem, the deprecation notices are raised indicating redis-namespace is responsible, but its just the messenger/man-in-the-middle (i.e. the call would be your_code -> redis-namespace -> redis-rb so the original call would be from your_code but redis-rb which is raising the deprecation notice, as it sees redis-namespace as the caller, not your code).

Try replacing the redis-namespace instance with a normal Redis client and re-run your tests and it should show you what in your code (or other deps) is calling the deprecated methods.

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