fix(whatsapp): normalize device-qualified contact ids

This commit is contained in:
wmq
2026-08-03 01:11:46 +08:00
parent 7e739ad7b8
commit bffd2f4fe6
3 changed files with 11 additions and 3 deletions
+2
View File
@@ -12,6 +12,8 @@ test('WhatsApp LID resolves to the same canonical phone identity', () => {
assert.equal(canonicalWhatsAppJid('987654321@lid', { phone: '+1 555 123 4567' }), phoneJid)
assert.equal(canonicalWhatsAppJid('987654321@lid', { canonicalJid: phoneJid }), phoneJid)
assert.equal(whatsappCustomerStableId(canonicalWhatsAppJid('987654321@lid', { phone: '+1 555 123 4567' })), whatsappCustomerStableId(phoneJid))
assert.equal(canonicalWhatsAppJid('15551234567:4@s.whatsapp.net'), phoneJid)
assert.equal(canonicalWhatsAppJid('987654321@lid', { canonicalJid: '15551234567:0@s.whatsapp.net' }), phoneJid)
})
test('WhatsApp customer id remains stable after gateway reauthorization', () => {