Skip to content

[BUG] MCQ Asterisk Character Breaks Message Rendering #1037

@matKlju

Description

@matKlju

Bug description:
MCQ node does not render “Message to client” when the message contains an asterisk *.
When an MCQ message includes an escaped asterisk, DataMapper fails while processing:

/services/hbs/bot_responses_to_messages

DataMapper error:

Request: {method: POST, url: /services/hbs/bot_responses_to_messages, params: {}, query: {}, body: {"data":{"authorLastName":"","buttons":[{"id":"1","title":"Jah","payload":"#service, /POST/services/active/mcq_test_mcq_1_0"},{"id":"2","title":"Ei","payload":"#service, /POST/services/active/mcq_test_mcq_1_1"}],"chatId":"","botMessages":[{"result":"Do you need to use an \"\\*\" asterix with quotes or not? So like \\* or..."}],"authorFirstName":"","created":"2026-05-27T07:05:20.323Z","authorTimestamp":"2026-05-27T07:05:20.322Z","authorId":""}}}
err: SyntaxError: Bad escaped character in JSON at position 63
    at JSON.parse (<anonymous>)
    at /workspace/app/server.js:139:31
    at ExpressHandlebars.<anonymous> (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:301:25)
    at step (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:49:23)
    at Object.next (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:30:53)
    at fulfilled (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:21:58)
Response: {statusCode: 200, responseData: "{\"error\":\"There was an error executing /workspace/app/module/services/hbs/bot_responses_to_messages.handlebars\"}"}
Request: {method: POST, url: /services/hbs/bot_responses_to_messages, params: {}, query: {}, body: {"data":{"authorLastName":"","buttons":[{"id":"1","title":"Jah","payload":"#service, /POST/services/active/mcq_test_mcq_1_0"},{"id":"2","title":"Ei","payload":"#service, /POST/services/active/mcq_test_mcq_1_1"}],"chatId":"","botMessages":[{"result":"Do you need to use an \"\\*\" asterix with quotes or not? So like \\* or..."}],"authorFirstName":"","created":"2026-05-27T07:05:20.346Z","authorTimestamp":"2026-05-27T07:05:20.345Z","authorId":""}}}
err: SyntaxError: Bad escaped character in JSON at position 63
    at JSON.parse (<anonymous>)
    at /workspace/app/server.js:139:31
    at ExpressHandlebars.<anonymous> (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:301:25)
    at step (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:49:23)
    at Object.next (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:30:53)
    at fulfilled (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:21:58)
Response: {statusCode: 200, responseData: "{\"error\":\"There was an error executing /workspace/app/module/services/hbs/bot_responses_to_messages.handlebars\"}"}

Expected behavior:
MCQ “Message to client” should support * characters without causing DataMapper/HBS JSON parsing errors.
The message should render correctly in the widget, whether * is used as plain text or part of formatting.

Screenshots:

Additional information:
Likely escaping issue in the HBS/DataMapper response generation flow.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv3.3

Type

No fields configured for Bug.

Projects

Status

In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions