Skip to content

fix: correctness and release hygiene (v7.4.2)#100

Merged
GeiserX merged 2 commits intomainfrom
fix/correctness-hygiene
Mar 31, 2026
Merged

fix: correctness and release hygiene (v7.4.2)#100
GeiserX merged 2 commits intomainfrom
fix/correctness-hygiene

Conversation

@GeiserX
Copy link
Copy Markdown
Owner

@GeiserX GeiserX commented Mar 31, 2026

Summary

Addresses 4 findings from post-v7.4.1 review — correctness bugs and release hygiene, no new security issues.

  • _log_stats() KeyError on shutdown (Medium): _log_stats() read bursts_detected, operations_discarded, chats_protected but MassOperationProtector.get_stats() returns rate_limits_triggered, operations_blocked, chats_rate_limited. A clean listener shutdown would raise KeyError. Fixed to use the actual keys.
  • Pin/unpin realtime broken (Low): The listener emitted _notify_update("pin", ...) but NotificationType had no PIN variant and the WebSocket handler didn't handle it. Added PIN to the enum, to the listener's type_map, and a case 'pin' handler in the frontend that reloads pinned messages for the current chat.
  • pyproject.toml version stale (Low): Was stuck at 7.2.0 while __init__.py and tags were at 7.4.1. Synced both to 7.4.2.
  • WebSocket subscribe ACL feedback (Low): ConnectionManager.subscribe() silently ignored unauthorized chats but always replied {"type": "subscribed"}. Now returns subscribe_denied when the ACL blocks the subscription.

Test plan

  • 167 tests pass (pytest tests/ --ignore=tests/test_telegram_import.py)
  • Verify listener shuts down cleanly without KeyError
  • Verify pin/unpin in a chat triggers live banner update in the viewer
  • Verify pip install / pip show reports correct version
  • Verify restricted user gets subscribe_denied for unauthorized chats

- Fix _log_stats() KeyError on shutdown: use actual get_stats() keys
  (rate_limits_triggered, operations_blocked, chats_rate_limited)
- Fix pin/unpin realtime: add PIN to NotificationType enum, add to
  listener type_map, add pin handler in WebSocket frontend
- Sync pyproject.toml version (was 7.2.0) with __init__.py (7.4.2)
- Fix WebSocket subscribe ACL: return subscribe_denied when chat is
  outside the user's allowed list instead of silent success
@github-actions
Copy link
Copy Markdown

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

…ontend

- Forward pin events in handle_realtime_notification() to WebSocket clients
- Add subscribe_denied case to frontend WebSocket handler
@github-actions
Copy link
Copy Markdown

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

@GeiserX GeiserX merged commit dfa165b into main Mar 31, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant