-
-
Notifications
You must be signed in to change notification settings - Fork 993
Closed
Labels
Description
Describe the bug
Stream commands like xadd are not applying the key prefix.
To Reproduce
Steps to reproduce the behavior:
- Initialize
Predis\Clientwith a prefix (e.g. 'sample:'). - Call the
xaddmethod with a key (e.g. 'my-stream-key'). - List the keys and see that the new key is missing the configured prefix.
Expected behavior
The configured key prefix should be prepended to the key provided to xadd.
Versions (please complete the following information):
- Predis: 2.1.1
- PHP: 8.2.1
- Redis Server: 7.0.5
- OS: Fedora 37
Code sample
$client = new \Predis\Client(null, ['prefix' => 'sample:']);
$client->xadd('my-stream-key', ['foo' => 'bar']);
$client->keys('*'); // []
$client->executeRaw(['KEYS', '*']); // ['my-stream-key']
$client->xrange('my-stream-key', '-', '+'); // Returns the stream, indicating that xrange probably ignores the prefix too.Additional context
The issue does not exist with other data structures using the same client instance above.