waha icon indicating copy to clipboard operation
waha copied to clipboard

[BUG][NOWEB] - Different behaviour in NOWEB and WEBJS

Open ldubrois opened this issue 1 year ago • 2 comments

Describe the bug

I was using WEBJS as engine.

To mark the message as seen I was always providing the Participant value even in the 1 to 1 conversation. It was working well.

I moved to NOWEB engine, and now the mark does nothing. I found that I have to set null to Participant in this case to make the mark seen to work.

Version


  "version": "2024.7.7",
  "engine": "NOWEB",
  "tier": "PLUS",
  "browser": "/usr/bin/chromium"
}

To Reproduce Steps to reproduce the behavior:

Try to mark a message as seen in a chat and providing the Participant using the From value of the payload.

Expected behavior

The API should beahve the same, no matter the engine (NOWEB or WEBJS)

Engine I'm using NOWEB engine.

ldubrois avatar Aug 09 '24 07:08 ldubrois

Hi! Could you add example for the payload please for both engines?

patron:PRO

devlikepro avatar Aug 09 '24 08:08 devlikepro

Hi

At the time, I did not found documentation on the sendSeen, so I based my code on the swagger sample.

It was exactly the one describe in the swagger.

In WEBJS I was posting :

{
  "chatId": "[email protected]",
  "messageId": "[email protected]_AAAAAAAAAAAAAAAAAAAA",
  "participant": "[email protected]",
  "session": "default"
}

When i switched to NOWEB, I noticed that the message were no longer mark as seen. Looking at the log, Isaw the POST, and the API was returning a success HTTP Code.

By looking at some closed issues on the repo, I found a comment indicating that participant should be filled only when the conversation is in a group, so I tried in swagger :

{
  "chatId": "[email protected]",
  "messageId": "[email protected]_AAAAAAAAAAAAAAAAAAAA",
  "session": "default"
}

It make my message as seen.

In my code, it would require some time debug to confirm, but I think my payload is more like this (and it is working also).

{
  "chatId": "[email protected]",
  "messageId": "[email protected]_AAAAAAAAAAAAAAAAAAAA",
  "participant": null,
  "session": "default"
}

ldubrois avatar Aug 09 '24 09:08 ldubrois

got it, thank you for the detailed explanation! We'll adjust the swagger and add the doc, weird we don't have it yet.

This is the payload you need to use for chats (not groups) for both WEBJS and NOWEB (no participant field or null)

{
  "chatId": "[email protected]",
  "messageId": "[email protected]_AAAAAAAAAAAAAAAAAAAA",
  "session": "default"
}

patron:PRO

devlikepro avatar Aug 13 '24 06:08 devlikepro