You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(telegram): log API errors, skip queued alerts when disabled, escape chart URLs #78
TelegramService._worker() (app/telegram.py:241-247) discards the requests.post() response without checking status_code or ok, silently swallowing HTTP 400/401/429 errors.
_worker() does not re-check self.enabled / self.paused under self._lock after dequeuing, so pausing/disabling Telegram still sends queued burst alerts.
send_raw() reads self.enabled/self.paused without acquiring self._lock.
chart_url (lines 172, 228) interpolates raw ticker without URL encoding / HTML escaping, and fallback borrow.get('label') is not HTML-escaped.
Queue multiple Telegram alerts, then disable Telegram alerts via the topbar button -> queued alerts still dispatch.
Trigger a Telegram 400/401/429 error -> no warning is logged.
Expected Behavior
Inspect HTTP response status & JSON ok (logging errors and honoring retry_after on 429), re-check enabled/paused under lock inside _worker() and send_raw(), and URL-quote + HTML-escape dynamic fields.
Operating System & Version
OS: Windows 11 x64 / macOS arm64 / Linux x86_64
Version: v2.12.0
Display / Scale: Verified via live Chrome CDP (1600x960) & local unit/backend suite
Logs & Additional Context
Backend audit confirmed _worker ignores HTTP responses and does not re-check self.enabled/self.paused.
Summary of Changes: Updated TelegramService._worker() in app/telegram.py to log non-200 / ok=False responses (with 429 retry_after backoff), re-check enabled/paused under lock before sending queued alerts, and URL-quote + HTML-escape ticker/borrow fields. Verified via unit tests.
Verification: compileall clean, 84/84 unit tests passing (including tests/test_audit_fixes.py), and live Chrome CDP verification passed.
This issue will automatically close upon PR #82 review and merge into main.
Activity
mlgitdev commentedon Dec 2, 2026
🚀 Resolution In Progress
A fix for this issue has been implemented and submitted in Pull Request #82 (
v2.12.1).fix/audit-remediation-67TelegramService._worker()inapp/telegram.pyto log non-200 /ok=Falseresponses (with 429retry_afterbackoff), re-checkenabled/pausedunder lock before sending queued alerts, and URL-quote + HTML-escape ticker/borrow fields. Verified via unit tests.compileallclean, 84/84 unit tests passing (includingtests/test_audit_fixes.py), and live Chrome CDP verification passed.This issue will automatically close upon PR #82 review and merge into
main.github-actions commentedon Dec 2, 2026
✅ Issue Validation Passed
fix(telegram))This issue is well-structured and ready for work according to the Issue-First Protocol.