Closed Zedmerlol closed 3 years ago
Update: the problem comes from the multi device because without multi-device don't have any error with the first message
For me, occurs on first message on MD the type unknow and subtype fanout
@asdasdsdasdasdas @daopapp I have tried to implement a fix for this but i'm kinda flying blind because I'm not able to consistently reproduce this issue. But I think I've found a fix.
undefined
, at worst it will return ""
which will prevent the undefined
error Basically, despite this fix, you will still have circumstances where the ciphertext message doesn't eventually emit the actual message - so I suggest never relying on the first incoming message to do anything.
Hi man, The problem it's that we use the first message as input for an automation. So, on this case, i've got the opt-in of client and depend of message content, we send a different response to client.
Hi man, The problem it's that we use the first message as input for an automation. So, on this case, i've got the opt-in of client and depend of message content, we send a different response to client.
As you can see in the screenshot above, the only time I was able to get a cipher text message, it literally did not load/decrypt the message in my session. You will not see that screenshot on your host account device.
I can understand this is annoying and I've implemented a callback to emit the message once the message type is changed from ciphertext to something else. There's not anything else I can do to be honest
No problem man.... The strange it's that the type unknow and the subtype fanout only occours on MD. In chypertext i use the getMessageById to try to get the content of message body. I think, that the problem it's when the user has a old dated whatsapp version and send message to MD...
@daopapp yeah I noticed that about your screenshot, however, I was only to get a ciphertext/fanout
message, no unknown/fanout
message. Fanout is a consistent theme with MD as a message (of any type) needs to "Fan out" messages to multiple recipients (each MD session and the host account device session count as different recipients technically).
I think this issue will be finally resolved after the transition to MD is complete. So I will be closing this for now. Thanks
I should clarify that this problem of the ciphertext in the first message that the bot receives for the first time from a number only happens using Multi-device. Without Multi-device the body of the message does appear but curiously the name of the contact does not, on the other hand in Multi-device the name of the contact does appear but not the body of the message.
You can generate and see these errors with console.log(message) and wait for them to send you a message from a number which has never contacted their chatbot
Are you using the latest version of the library?
Current Behavior
When someone contact the bot for the first time the type of message shows as "ciphertext" and the object "message" don't contein the value "body" so, it doesn't answer and the proyect crashes because body is not defined.
Expected Behavior
Detect the body on the first message
Steps To Reproduce
Mode
EASY API/CLI
create() code
DEBUG INFO
Environment
Screenshots
No response
Anything else?
No response