You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are finding some scenarios where cta.action is an empty string in messagetemplates mongo collection. This causes an Cannot create property 'buttons' on string '' error when trying to call to subscribers/[subscriberId]/notifications/feed endpoint
👟 Reproduction steps
From novu web go to workflows section and define a new workflow with an in-Appstep
In this step you can add a message and you can create no actions associated to that message
In database the collection created is something similar to this
It should create cta.action as an empty object not as an empty string, so calling to subscribers/[subscriberId]/notifications/feed endpoint may not return an error.
👎 Actual Behavior with Screenshots
Worker service, when tries to process the messages is creating a new message in mongo with the field cta.actionas an empty string.
When trying to call to subscribers/[subscriberId]/notifications/feed endpoint we are getting the following error
{
"insertId": "06y8xcljy31zqmj9",
"jsonPayload": {
"organizationId": "63eb559766b0e27ff9604f4d",
"msg": "Cannot create property 'buttons' on string ''",
"req": {
"query": {
"feedIdentifier": "Alert",
"seen": "false"
},
"params": {
"0": "subscribers/63b0959d-2ab0-4ac0-b993-8c98095f9ece/notifications/feed"
},
"remoteAddress": "....",
"url": "/v1/subscribers/63b0959d-2ab0-4ac0-b993-8c98095f9ece/notifications/feed?feedIdentifier=Alert&seen=false",
"id": 7474022,
"headers": {},
"method": "GET",
"remotePort": 58638
},
"environmentId": "63eb559766b0e27ff9604f6f",
"serviceName": "@novu/api",
"platform": "Docker",
"serviceVersion": "0.19.0",
"err": {
"message": "Cannot create property 'buttons' on string ''",
"type": "Error",
"stack": "TypeError: Cannot create property 'buttons' on string ''\n at applyDefaults (/usr/src/app/node_modules/.pnpm/[email protected]/node_modules/mongoose/lib/helpers/document/applyDefaults.js:106:25)\n at model.Document.$__init (/usr/src/app/node_modules/.pnpm/[email protected]/node_modules/mongoose/lib/document.js:705:3)\n at model.syncWrapper [as $__init] (/usr/src/app/node_modules/.pnpm/[email protected]/node_modules/kareem/index.js:331:25)\n at model.Document.init (/usr/src/app/node_modules/.pnpm/[email protected]/node_modules/mongoose/lib/document.js:638:8)\n at model.Document.$init (/usr/src/app/node_modules/.pnpm/[email protected]/node_modules/mongoose/lib/document.js:654:42)\n at completeMany (/usr/src/app/node_modules/.pnpm/[email protected]/node_modules/mongoose/lib/helpers/query/completeMany.js:43:14)\n at cb (/usr/src/app/node_modules/.pnpm/[email protected]/node_modules/mongoose/lib/query.js:2316:5)\n at /usr/src/app/node_modules/.pnpm/[email protected]/node_modules/mongodb/src/utils.ts:461:15\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)"
},
"pid": 17,
"userId": "63eb558466b0e27ff9604f2e",
"level": 50,
"context": "ExceptionsHandler",
"tenant": "OS"
},
"timestamp": "2023-12-15T05:01:42.807Z",
"receiveTimestamp": "2023-12-15T05:01:47.735874145Z"
}
Novu version
0.19.0
npm version
No response
node version
No response
📃 Provide any additional context for the Bug.
No response
👀 Have you spent some time to check if this bug has been raised before?
I see you are self-hosting Novu and your Novu version is 0.19.0
I tried to reproduce this issue on Novu managed saas web.novu.co which is running on the latest version 0.22.0. I could not reproduce this issue https://www.loom.com/share/b0f697aba2684deda7d5280d8af1561b
Could you please upgrade the Novu version to latest?
📜 Description
We are finding some scenarios where cta.action is an empty string in
messagetemplates
mongo collection. This causes anCannot create property 'buttons' on string ''
error when trying to call tosubscribers/[subscriberId]/notifications/feed
endpoint👟 Reproduction steps
in-App
stepIn database the collection created is something similar to this
where
cta.action
is an empty string.👍 Expected behavior
It should create cta.action as an empty object not as an empty string, so calling to
subscribers/[subscriberId]/notifications/feed
endpoint may not return an error.👎 Actual Behavior with Screenshots
Worker service, when tries to process the messages is creating a new message in mongo with the field
cta.action
as an empty string.When trying to call to
subscribers/[subscriberId]/notifications/feed
endpoint we are getting the following errorNovu version
0.19.0
npm version
No response
node version
No response
📃 Provide any additional context for the Bug.
No response
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Contributing Guidelines?
Are you willing to submit PR?
None
The text was updated successfully, but these errors were encountered: