#Getting ResponseValidationError when using @novu/api

1 messages · Page 1 of 1 (latest)

safe tusk
#

Hi,
I was trying to perform update from an outdated @novu/node package to the @novu/api one, but unfortunately stumbled upon some errors.
Some info for the context:
We are using @novu/framework with NestJS for our code-first workflows. The outdated package that I am trying to replace was used for 3 things (@novu/node package was working fine in all 3 cases):

  1. novu.triggerBulk to trigger notifications. Works perfectly with the new package
  2. novu.subscribers.create to send information regarding newly created users in the system. New package updates the subscriber info, but returns { "statusCode": 201, "message": "Response validation failed" } json. Not critical, but such response validation error looks a little bit weird
  3. novu.messages.retrieve({ subscriberId }) + novu.messages.delete to delete some messages that were sent to particular subscribers (saved us several times). And this is unfortunately completely broken. First request is throwing ResponseValidationError with such cause
ZodError: [
    {
      "code": "invalid_type",
      "expected": "boolean",
      "received": "undefined",
      "path": [
        "Result",
        "data",
        0,
        "subscriber",
        "isOnline"
      ],
      "message": "Required"
    },
    {
      "code": "invalid_type",
      "expected": "string",
      "received": "undefined",
      "path": [
        "Result",
        "data",
        0,
        "subscriber",
        "lastOnlineAt"
      ],
      "message": "Required"
    }
]

Is there something wrong on our side or maybe you can give a hint, what can be a source of an issue?

Package versions that we are using:
@novu/api v3.14.2
@novu/framework v2.9.0
novu 2.6.6

hushed root
#

@safe tusk

This is known issue with zod validation in version 3.14.2

#

We have an internal ticket to fix this

#

Could you try using 3.14.0 version?