devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click!
https://waha.devlike.pro/
Apache License 2.0
806 stars 247 forks source link

[BUG][NOWEB] - Poll was sent but always returns an exception - lastest version (2024.5.13) #356

Closed mvmendes closed 1 month ago

mvmendes commented 1 month ago

Describe the bug

I'm using NOWEB engine to send Polls (replacing Buttons), and I need the message id (expected to return in API sendPoll's response), but this errors occurs (it working as expected on 2024.5.8):

Version 2024.5.13

{
    "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "x-api-key": "{{MY KEY}}"
    },
    "body": "{\"session\":\"cotistafii\",\"chatId\":\"5511xxxxxx453@c.us\",\"poll\":{\"name\":\"Selecione a opção para prosseguir:\",\"options\":[\"Voltar\",\"Finalizar\"],\"multipleAnswers\":false}}",
    "method": "POST"
}

image

Error returned from API (I was replaced my phone number with xxxxx)

{ "statusCode": 500, "timestamp": "2024-05-31T17:05:22.063Z", "exception": { "stack": "TypeError: Cannot read properties of null (reading 'caption')\n at WhatsappSessionNoWebPlus.toWAMessage (/app/dist/core/engines/noweb/session.noweb.core.js:574:33)\n at WhatsappSessionNoWebPlus.sendPoll (/app/dist/core/engines/noweb/session.noweb.core.js:278:21)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async /app/node_modules/@nestjs/core/router/router-execution-context.js:46:28\n at async /app/node_modules/@nestjs/core/router/router-proxy.js:9:17", "message": "Cannot read properties of null (reading 'caption')", "name": "TypeError" }, "request": { "path": "/api/sendPoll", "method": "POST", "body": { "session": "cotistafii", "chatId": "5511xxxxxxxx53@c.us", "poll": { "name": "Selecione a opção para prosseguir:", "options": [ "Voltar", "Finalizar" ], "multipleAnswers": false } }, "query": {} }, "version": { "version": "2024.5.13", "engine": "NOWEB", "tier": "PLUS", "browser": "/usr/bin/chromium" } }

patron:PLUS

mvmendes commented 1 month ago

image The bug still happens in the version 2024.5.14

patron:PLUS

allburov commented 1 month ago

Hi! Fixed in 2024.6.1. Thank you for such detail report! :cupid:

One step toward stability - starting 2024.6.1 we'll publish versioned tags, so you can pin docker image version you're using and update it only when it's required with no such surprises.

https://waha.devlike.pro/docs/how-to/engines/#versions

patron:PRO