Skip to content

TS.MADD does not return error, only empty object when TS is not created yet.  #2539

Open
@jtoronto

Description

@jtoronto

Description

When trying to MADD to timeseries that has not been created yet, Redis is supposed to return an error.

This can be demonstrated by running the command directly on the server.

ts.madd test 1687180293 1 test 1687180294 1

Returns this

1) "(Redis) ERR TSDB: the key is not a TSDB key"
2) "(Redis) ERR TSDB: the key is not a TSDB key"

an "array" of errors.

Doing the same via node-redis as follows:

 const testSamples = [
      {
        key: 'test',
        timestamp: 1687180293,
        value: 1,
      },
      {
        key: 'test',
        timestamp: 1687180294,
        value: 1,
      },
    ];
    const response = await redis.ts.mAdd(testSamples);
    logger.debug({ response });

results in an array of empty objects.

"response": [
        {},
        {}
    ]

No error thrown. It seems that the redis client is swallowing whatever error the server is returning.

Expected results:

A "thrown" error or at least including the error message returned by the server as the response.

Node.js Version

v16.15.0

Redis Server Version

7.0.11

Node Redis Version

4.6.7

Platform

Linux

Logs

No response

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