Revert "Fix WhatsApp connection test delivery without touching DSH sessions."

This reverts commit 0bc0992330.
This commit is contained in:
oliver 2026-09-08 20:08:49 +08:00
parent 0bc0992330
commit dd2365407e
5 changed files with 206 additions and 396 deletions

View file

@ -5,37 +5,11 @@ import {
enrichWhatsappInboundIdentities,
isWhatsappLidJid,
rememberWhatsappLidPnPairs,
resolveWhatsappSelfChatJid,
stripWhatsappBotMentionText,
whatsappBotMentionTokens,
} from '../../../src/channels/whatsapp/whatsapp-identity.mjs';
describe('whatsapp-identity', () => {
it('resolves self-chat jid to live LID before stored PN', async () => {
const accountJid = '8615601877957@s.whatsapp.net';
const lid = '111222333444555@lid';
assert.equal(await resolveWhatsappSelfChatJid({
accountJid,
socket: { user: { id: accountJid, lid } },
}), lid);
assert.equal(await resolveWhatsappSelfChatJid({
accountJid,
socket: {
signalRepository: {
lidMapping: {
getLIDForPN: async (pn) => (pn === accountJid ? lid : null),
},
},
},
}), lid);
assert.equal(await resolveWhatsappSelfChatJid({
accountJid,
lidPnCache: new Map([['111222333444555', accountJid]]),
}), lid);
assert.equal(await resolveWhatsappSelfChatJid({ accountJid }), accountJid);
});
it('recognizes lid jids', () => {
assert.equal(isWhatsappLidJid('91010910658657@lid'), true);
assert.equal(isWhatsappLidJid('8618142387786@s.whatsapp.net'), false);