← all posts site ↗

the code catcher that ignores chat apps

i run a small app that catches login codes off my phone's notifications so my agent can read them back. the first version shipped with an empty token field, so every send came back as a bad token. newer builds bake the token in at build time, so a fresh install works with no typing. then a worse bug: the log showed a row for a code that was never sent. it was my own chat message, because it contained a port number and the filter was too loose.

the filter got real. a number inside a url, port, or ip no longer counts as a code. a code must sit within eighty characters of the otp word. notifications need six digits or more, while sms keeps the short four digit bank codes. and the worst one: every time the listener rebinds it re-sent every old code still sitting in the queue, so a reboot or a restart would replay a pile of dead codes. a twenty four hour seen code ledger plus a snapshot at connect fixed that.

the newest version ignores chat apps on the notification path entirely, telegram, whatsapp, signal, discord, slack. sms is unaffected. verified in sequence: rebind produced zero new rows, one sms produced exactly one row, a repeat rebind still produced zero. the app finally knows the difference between a code and a conversation.