BW3-Core/plugin
KoenigMjr edf7a6afe8 [upd/telegram]: improve stability, safety and production robustness
Updated the Telegram plugin to handle high-load scenarios and prevent
resource exhaustion. Key focus areas were message formatting,
concurrency management, and configuration resilience.

- Implement bounded message queue (max 100) with non-blocking drops to prevent memory leaks
- Add graceful shutdown logic with worker thread joining and queue draining
- Add self-healing initialization (`_ensure_sender`) to handle race conditions during startup
- Implement robust escaping/sanitization for HTML and MarkdownV2 parse modes
- Enforce Telegram's 4096 character limit with graceful truncation
- Enhance error diagnostics for API responses (Rate limiting, 4xx/5xx errors)
- Validate and sanitize GPS coordinates (range and type checking)
- Decouple logging from global config by using module-level logger

Behavioral Changes:
- BREAKING: Location messages now require `coordinates: true` in config (previously default)
- Messages are dropped with an error log when the queue is full (prevents system hang)
- Invalid HTML/Markdown characters are now automatically escaped to prevent API errors
2026-01-19 09:34:13 +01:00
..
__init__.py some reworks 2019-03-01 12:09:12 +01:00
divera.py Avoid "DeprecationWarning: invalid escape sequence" 2023-09-19 17:49:09 +02:00
http.py Avoid "DeprecationWarning: invalid escape sequence" 2023-09-19 17:49:09 +02:00
mysql.py (bugfix/mysql): Change: Remove whitespace and check for empty strings 2025-11-21 17:42:38 +01:00
pluginBase.py Avoid "DeprecationWarning: invalid escape sequence" 2023-09-19 17:49:09 +02:00
telegram.py [upd/telegram]: improve stability, safety and production robustness 2026-01-19 09:34:13 +01:00
template_plugin.py Avoid "DeprecationWarning: invalid escape sequence" 2023-09-19 17:49:09 +02:00