[BUG] contacts.upsert not emitted after upgrading to v7.0.0-rc.5
Describe the bug After upgrading from v6.7.19 to v7.0.0-rc.5, changes to a contact’s display name on the phone no longer emit the contacts.upsert event. Rolling back to v6.7.19 (no other changes) restores the event.
To Reproduce Steps to reproduce the behavior:
- Create a new Baileys connection.
- Update a contact name on the mobile app
- Observe that
contacts.upsertdo not get fired
Expected behavior
contacts.upsert with the updated contact record (same as 6.7.19 behavior).
Environment (please complete the following information): Baileys version: 7.0.0-rc.5 Using proxy: No
1+
Tested and working on the master branch. This was tested in a fresh session
Code used for testing in example.ts:
sock.ev.on('contacts.upsert', contacts => {
console.log('Received contacts.upsert event:', contacts);
});
Resulting Log Output (Masked):
[
{
id: '[email protected]',
name: 'Contact Name 1',
lid: 'xxxxxxxxxxxxxxxx@lid',
phoneNumber: undefined
},
{
id: '[email protected]',
name: 'Contact Name 2',
lid: 'xxxxxxxxxxxxxxxx@lid',
phoneNumber: undefined
},
{
id: '[email protected]',
name: 'Contact Name 3',
lid: 'xxxxxxxxxxxxxxxx@lid',
phoneNumber: undefined
},
... 164 more items
]
Was you able to solve it? I'm facing the same issue :(
No, I just tried with the latest commit and it still not getting triggered
1+
+1
messages.upsert too, same problem
messages.upsert too, same problem
That one is working fine for me
+1
1+
+1
@jlucaso1 this is what i see on the logs every time I test a contact name update.
[09:51:00.632] INFO (critical_unblock_low/744): failed to sync state from version
error: "Error: failed to find key \"AAAAAImd\" to decode mutation\n at getKey (C:\\Users\\alej\\source\\repos\\project\\node_modules\\@whiskeysockets\\baileys\\src\\Utils\\chat-utils.ts:260:10)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async decodeSyncdMutations (C:\\Users\\alej\\source\\repos\\project\\node_modules\\@whiskeysockets\\baileys\\src\\Utils\\chat-utils.ts:223:15)\n at async decodeSyncdSnapshot (C:\\Users\\alej\\source\\repos\\project\\node_modules\\@whiskeysockets\\baileys\\src\\Utils\\chat-utils.ts:385:34)\n at async <anonymous> (C:\\Users\\alej\\source\\repos\\project\\node_modules\\@whiskeysockets\\baileys\\src\\Socket\\chats.ts:525:50)\n at async <anonymous> (C:\\Users\\alej\\source\\repos\\project\\node_modules\\@whiskeysockets\\baileys\\src\\Utils\\auth-utils.ts:292:21)"
[09:51:00.683] DEBUG (744): sent ack
recv: {
"tag": "notification",
"attrs": {
"from": "@s.whatsapp.net",
"type": "server_sync",
"id": "xxxxx",
"t": "xxxxx"
}
}
sent: {
"id": "xxxxxxx",
"to": "@s.whatsapp.net",
"class": "notification",
"type": "server_sync"
}
[09:51:00.683] DEBUG (744): Flushing event buffer
bufferCount: 1
It' same with rc6 as well
1+
@jlucaso1 This is referring likely to contact updates rather than upserts and it is closely related to the app state failed to sync state from version error