Teknium
f007284d05
fix: rate-limit pairing rejection messages to prevent spam ( #4081 )
...
* fix: rate-limit pairing rejection messages to prevent spam
When generate_code() returns None (rate limited or max pending), the
"Too many pairing requests" message was sent on every subsequent DM
with no cooldown. A user sending 30 messages would get 30 rejection
replies — reported as potential hack on WhatsApp.
Now check _is_rate_limited() before any pairing response, and record
rate limit after sending a rejection. Subsequent messages from the
same user are silently ignored until the rate limit window expires.
* test: add coverage for pairing response rate limiting
Follow-up to cherry-picked PR #4042 — adds tests verifying:
- Rate-limited users get silently ignored (no response sent)
- Rejection messages record rate limit for subsequent suppression
---------
Co-authored-by: 0xbyt4 <35742124+0xbyt4@users.noreply.github.com >
2026-03-30 16:48:00 -07:00
..
2026-02-26 03:20:08 +03:00
2026-03-26 13:19:43 -07:00
2026-03-29 21:29:13 -07:00
2026-03-22 04:18:18 -07:00
2026-03-26 18:02:26 -07:00
2026-03-28 14:00:52 -07:00
2026-03-18 16:58:20 -07:00
2026-03-07 11:27:50 -08:00
2026-03-26 14:33:48 -07:00
2026-03-17 03:52:15 -07:00
2026-03-29 21:55:23 -07:00
2026-03-13 21:35:07 -07:00
2026-03-13 23:59:18 -07:00
2026-03-29 15:48:51 -07:00
2026-03-14 11:03:20 -07:00
2026-03-17 03:04:58 -07:00
2026-03-09 02:20:57 -07:00
2026-03-22 07:38:14 -07:00
2026-03-15 07:59:55 -07:00
2026-03-14 09:32:05 -07:00
2026-03-13 08:52:54 -07:00
2026-03-14 14:27:21 +03:00
2026-03-29 21:55:23 -07:00
2026-03-14 21:44:50 -07:00
2026-03-22 04:25:19 -07:00
2026-03-23 06:50:09 -07:00
2026-03-17 02:26:34 -07:00
2026-03-28 13:51:08 -07:00
2026-02-27 11:53:46 -05:00
2026-03-29 15:38:32 -07:00
2026-03-17 01:47:34 -07:00
2026-03-29 18:17:42 -07:00
2026-03-26 17:40:31 -07:00
2026-03-26 14:33:48 -07:00
2026-03-13 07:40:38 -07:00
2026-03-16 00:23:47 -07:00
2026-03-29 20:05:59 -07:00
2026-03-15 03:50:45 -07:00
2026-03-30 00:02:51 -07:00
2026-03-28 12:13:35 -07:00
2026-03-28 22:17:43 -07:00
2026-03-28 17:28:38 -07:00
2026-02-28 03:38:27 -05:00
2026-03-11 09:15:34 +01:00
2026-03-05 18:39:37 -08:00
2026-03-16 05:58:34 -07:00
2026-03-14 21:28:51 -07:00
2026-03-28 14:01:01 -07:00
2026-03-28 14:25:12 -07:00
2026-03-22 04:56:13 -07:00
2026-03-26 13:39:41 -07:00
2026-03-16 00:23:47 -07:00
2026-03-14 21:19:22 -07:00
2026-03-10 23:34:52 -07:00
2026-03-27 22:37:53 -07:00
2026-03-28 14:25:12 -07:00
2026-03-16 05:26:31 -07:00
2026-03-27 04:03:13 -07:00
2026-03-26 17:37:10 -07:00
2026-03-15 06:57:00 -07:00
2026-03-30 13:18:21 -07:00
2026-03-26 19:27:58 -07:00
2026-03-26 14:33:48 -07:00
2026-03-22 09:33:39 -07:00
2026-03-26 19:13:07 -07:00
2026-03-28 23:45:28 -07:00
2026-03-30 08:10:14 -07:00
2026-03-17 03:14:53 -07:00
2026-03-27 11:33:19 -07:00
2026-03-15 23:04:34 -07:00
2026-03-17 03:44:44 -07:00
2026-03-18 03:12:59 -07:00
2026-03-01 05:28:12 -08:00
2026-03-15 21:51:40 -07:00
2026-03-27 04:03:13 -07:00
2026-03-27 04:03:13 -07:00
2026-03-27 04:03:13 -07:00
2026-03-29 21:53:59 -07:00
2026-03-27 04:03:13 -07:00
2026-03-28 14:23:27 -07:00
2026-03-15 03:50:45 -07:00
2026-03-27 04:03:13 -07:00
2026-03-17 02:49:57 -07:00
2026-03-27 06:07:28 -07:00
2026-03-14 14:27:20 +03:00
2026-03-04 21:34:40 +03:00
2026-03-30 16:48:00 -07:00
2026-03-14 12:15:51 -07:00
2026-03-26 14:41:04 -07:00
2026-03-21 08:08:37 -07:00
2026-03-20 06:33:36 -07:00
2026-03-28 14:33:35 -07:00
2026-03-20 06:33:36 -07:00
2026-03-29 21:29:13 -07:00
2026-03-29 16:25:20 -07:00
2026-03-17 10:44:37 -07:00