Skip to content

Stream commands (e.g. xadd) are not applying the key prefix #1050

@jessarcher

Description

@jessarcher

Describe the bug
Stream commands like xadd are not applying the key prefix.

To Reproduce
Steps to reproduce the behavior:

  1. Initialize Predis\Client with a prefix (e.g. 'sample:').
  2. Call the xadd method with a key (e.g. 'my-stream-key').
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions