xgeekshq/intelli-mate

[Bug]: Error when in chat window

Closed this issue · 0 comments

Note: for support questions, please use our email. This repository's issues are reserved for feature requests and bug reports.

  • I'm submitting a ...

    • bug report
    • feature request
    • support request => Please do not submit support request here, contact us directly at contact@xgeeks.io
  • What is the current behavior?

In a chat window with new people, the API is throwing this error:

ZodError: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "id"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "primaryEmailAddressId"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "profileImageUrl"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "username"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "firstName"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "lastName"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "array",
    "received": "undefined",
    "path": [
      "emailAddresses"
    ],
    "message": "Required"
  }
]
    at get error [as error] (/app/contract/node_modules/zod/lib/types.js:43:31)
    at ZodObject.parse (/app/contract/node_modules/zod/lib/types.js:141:22)
    at AuthController.findUser (/app/api/src/auth/auth.controller.js:32:55)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /app/api/node_modules/@nestjs/core/router/router-execution-context.js:46:28
    at async /app/api/node_modules/@nestjs/core/router/router-proxy.js:9:17

Something is causing the AuthController.findUser to respond with data that is not conforming to the zod schema specified.

  • What is the expected behavior?

To not have any errors being thrown, even with new users in a chat.