Skip to content

XREAD implementation doesn't fully support the real Redis' one #1473

@AleF83

Description

@AleF83

Current implementation support only arguments in the following formats:

  1. STREAMS, stream1, stream2, ... , id1, id2
  2. BLOCK <<val>>, stream1, stream2, ... , id1, id2.

According Redis docs both BLOCKS and COUNT can present and in different order. For example, socket.io-redis-streams-adapter library calls XREAD with "BLOCK", 100, "COUNT", readCount, "STREAMS", streamName, offset.

The source code here.

I replaced this line with rest: args[1] === 'COUNT' ? args.slice(4) : args.slice(2), and this fixes this specific case.

I can submit a PR to fix parsing parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions