Baileys: [BUG] Invalid preKey ID
Describe the bug A clear and concise description of what the bug is. Some of the messages I’ve received from events[‘messages.upsert’] have Invalid PreKey ID, does anyone have any idea why this is happening and how to fix it?
To Reproduce Steps to reproduce the behavior:
- Created a new connection
- Create event listener for events[‘messages.upsert’]
- Send message to server number
- Some messages have Invalid PreKey ID
Expected behavior Receive the contents of the message according to what we receive on WhatsApp
Environment (please complete the following information):
- Is this on a server? yes
- What do your
connectOptionslook like?const sock = makeWASocket({ printQRInTerminal: true, patchMessageBeforeSending: (message) => { const requiresPatch = !!( message.buttonsMessage || message.templateMessage || message.listMessage ); if (requiresPatch) { message = { viewOnceMessage: { message: { messageContextInfo: { deviceListMetadataVersion: 2, deviceListMetadata: {}, }, ...message, }, }, }; } return message; }, auth: state, msgRetryCounterMap, markOnlineOnConnect: false, shouldIgnoreJid: jid => isJidStatusBroadcast(jid), defaultQueryTimeoutMs: undefined }); - Do you have multiple clients on the same IP? Yes
- Are you using a proxy? No
Additional context This Problem does not occur in all messages
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 29 (5 by maintainers)
will work on this issue
there is a quick fix to this for now (stop all deletions on auth store level) but it’s better to command it from above on to why invoke deletion of the prekey pairs
anyone know how to solve this issue ?
up @canove @purpshell
up!
up!!
hey guy, could you share the part of your code using local files? I mean, the part that you create, read and write/update it
do you guys get this using useMultiFileAuthState too? I can’t for the life of me figure out why when using an external DB I get the preKeyId error but not when using local files
1 month later, time to make some serious progress on libsignal
I encountered this problem today. And it only resolved after I sent the first message.
What I’m thinking of testing: On the mobile phone, set up a welcome message. So, when receiving a first message, the mobile will trigger a response. And from then on, the next messages work normally. It’s not the ideal solution, just a temporary fix.