WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.59k stars 1.21k forks source link

[BUG] Unknown e2e type: msmsg #818

Open oscarguindzberg opened 3 months ago

oscarguindzberg commented 3 months ago

Describe the bug Error logged: "Unknown e2e type: msmsg"

This is the line that throws the error: throw new Error(Unknown e2e type: ${e2eType});

This is the full log: {"level":50,"time":1716567616259,"pid":2188,"hostname":"ip-172-31-81-30","key":{"remoteJid":"xxx@s.whatsapp.net","fromMe":false,"id":"xxxsss"},"err":{"type":"Error","message":"Unknown e2e type: msmsg","stack":"Error: Unknown e2e type: msmsg\n at decrypt (//baileys/lib/Utils/decode-wa-message.js:147:39)\n at baileys/lib/Socket/messages-recv.js:572:23\n at baileys/lib/Utils/make-mutex.js:18:42\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Promise.all (index 0)\n at async handleMessage (baileys/lib/Socket/messages-recv.js:570:9)\n at async processNodeWithBuffer (baileys/lib/Socket/messages-recv.js:688:9)"},"msg":"failed to decrypt message"}

Note: I have a modified decode-wa-message.js, so line decode-wa-message.js:147:39 won't match.

To Reproduce Steps to reproduce the behavior: Don't know how to reproduce it. I just got 15 errors like this on the log on a production environment, don't know the root cause.

Expected behavior No error logged.

Environment (please complete the following information):

const isJidNewsletter = (jid: string | undefined) => (jid?.endsWith('@newsletter'))

Additional context

PurpShell commented 2 months ago

yo

PurpShell commented 2 months ago

wroking on this

oscarguindzberg commented 2 months ago

@PurpShell glad to help, but I don't know exactly where to start. I guess bugfix should be here: https://github.com/oscarguindzberg/Baileys/commit/c834bc563403bfcbfe981ffb8560068c0fd5045c

I am familiar with baileys development, so I still don't know:

I could run the commit with extra console.log() on my prod env until I the event is reproduced.

any thoughts?

PurpShell commented 2 months ago

I will be porting this from whatsmeow to node soon! tulir/whatsmeow#615