devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! Two engines: chromium-based WEBJS and pure-websocket NOWEB
https://waha.devlike.pro/
Apache License 2.0
914 stars 277 forks source link

[BUG][NOWEB] - LABELS #479

Open graficar opened 1 month ago

graficar commented 1 month ago

Hi,

The tests were done from Swagger directly with version 2024.8.1

The labels store is with MongoDB.

I'm trying to use labels with the NOWEB API but the following happens:

  1. In the api: https://domain.com/api/9cb44700-591c-4054-b852-63e5bd0c7936/labels

In the first query it correctly showed me the labels of the account, but when editing the name of a label from the cell phone it is not updated when I consult the api again.

image

image

  1. In the api: https://domain.com/api/9cb44700-591c-4054-b852-63e5bd0c7936/labels/chats/123456789

In the first query it worked well for me but when editing the labels from the cell phone it does not show the query correctly and if I remove all the labels from the cell phone it shows me the labels from the first query.

image

image

  1. In the api: https://domain.com/api/9cb44700-591c-4054-b852-63e5bd0c7936/labels/chats/123456789

When I run the api it tells me that everything went well but it does not make any changes to the labels whether I consult from the api or from the cell phone directly.

Please help with these errors.

patron:PLUS

devlikepro commented 1 month ago

Hi! Do you use the local folder to save data (-v .sessions:/app/.sessions) or MongoDB (-e WHATSAPP_SESSIONS_MONGO_URL=mongodb://user:password@host:port)?

I'll double check both anyway

patron:PRO

devlikepro commented 1 month ago

The labels store is with MongoDB.

Nevermind, I see it, thank you for such detailed issue :+1:

patron:PRO

devlikepro commented 1 month ago

@graficar Hi! Just tested it with mongodb, worked fine for me.

Do you have any nginx in front of the server?

Could you send us logs in waha@devlike.pro when you're performing the steps:

  1. Run the container
  2. Run a new session with debug: True enabled (via dashboard or API)
  3. Add a new label
  4. API call to show all labels
  5. Rename the label
  6. API call to show all labels
  7. Add a new label to contact
  8. API call to show labels for contacts
  9. Remove the label
  10. API call to show labels for contacts

That would help us understand what is going on :pray:

patron:PRO

graficar commented 1 month ago

Hi,

I just sent you an email with the subject header of this report.

What I did was enable the logs and when I updated the name of a label an error was displayed in the log:

[devlikeapro-whatsapp-http-api-pl] [2024-08-07 17:16:30] error: "Error: tried remove, but no previous op\n at Object.mix (/app/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.js:58:27)\n at decodeSyncdMutations (/app/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.js:181:21)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async decodeSyncdPatch (/app/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.js:212:20)\n at async decodePatches (/app/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.js:320:30)\n at async /app/node_modules/@adiwajshing/baileys/lib/Socket/chats.js:401:70\n at async Object.transaction (/app/node_modules/@adiwajshing/baileys/lib/Utils/auth-utils.js:136:26)\n at async /app/node_modules/@adiwajshing/baileys/lib/Socket/chats.js:337:9\n at async /app/node_modules/@adiwajshing/baileys/lib/Utils/event-buffer.js:105:36\n at async processNotification (/app/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.js:350:21)"

patron:PLUS

devlikepro commented 1 month ago

hi! Could you attach the full logs in https://gist.github.com/ :pray: The email cut the long text :(

patron:PRO

devlikepro commented 3 weeks ago

If you could find a time and give the full logs, it'd be really helpful! :pray: labels working fine on both file and mongodb storage in our cases :(

patron:PRO