← deemwar engineering examples Runnable Β· Node Β· zero deps Β· free

Your contact lookup goes quiet for people you already know.

WhatsApp identifies some accounts by a LID β€” a linked/privacy identifier β€” instead of the classic phone-number JID. Which shape shows up for a contact isn't fixed forever: accounts migrate to LID over time. Code keyed by phone number gets a clean, silent miss for anything that now arrives as a LID β€” no exception, just "not found."

The crux

function naiveLookup(store, jid) {
  if (!isPhoneJid(jid)) return undefined; // LIDs never match a phone-keyed store
  return store.get(phoneFromJid(jid));
}

That function does exactly what it was written to do. The bug isn't in the lookup β€” it's the assumption baked into the store's key: that every contact is always addressable by phone number. Once any fraction of your contacts migrate to LID, that assumption is quietly wrong for them, and nothing tells you which ones. This is a real, ongoing migration β€” the same class of report has independently surfaced across more than one actively-maintained WhatsApp automation library.

Run it

node check.js --demo

Zero dependencies, no network β€” three known contacts, one migrated to a LID, checked two ways.

$ node check.js --demo Naive lookup (store keyed by phone number only): 15551230001@s.whatsapp.net -> Contact A 998877665544@lid -> NOT FOUND 15551230003@s.whatsapp.net -> Contact C Fixed lookup (also consults a phone<->LID map from contact sync): 15551230001@s.whatsapp.net -> Contact A 998877665544@lid -> Contact B 15551230003@s.whatsapp.net -> Contact C DIAGNOSIS: the naive lookup silently missed 1/3 known contacts -- not because they are unknown, but because they now arrive under a different identifier shape (LID) that a phone-keyed store was never taught to resolve. No exception, no error field -- a clean, quiet "not found."

Against your own data (export the JIDs your system has seen as a plain JSON array):

node check.js --jids-file jids.json

It classifies how many are @lid vs @s.whatsapp.net and reports what fraction of your own contact graph is already exposed to this β€” without touching a network.

The fix

Seen in the wild

This exact shape has independently surfaced as reports across more than one actively-maintained WhatsApp automation library β€” phone-keyed lookups, message history, or dedupe breaking as LID adoption grows, with no error raised at the point of failure.

Get the code