mantimon-tcg/backend/tests
Cal Corum 0a9cd73daf Validate connection data integrity in ConnectionManager
Fix audit warnings about empty string defaults hiding data corruption:

1. get_connection_info(): Validate required fields (user_id, connected_at,
   last_seen) exist before creating ConnectionInfo. Return None and log
   warning for corrupted records instead of returning invalid data.

2. unregister_connection(): Log warning if user_id is missing during
   cleanup. Existing code safely handles this (skips cleanup), but now
   we have visibility into data corruption.

Test added for corrupted data case.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:03:17 -06:00
..
api Fix security and validation issues from code review 2026-01-28 14:16:07 -06:00
core Remove legacy modifier field from WeaknessResistance 2026-01-29 13:16:51 -06:00
db Switch to testcontainers for automatic test container management 2026-01-28 16:49:11 -06:00
scripts Simplify card image URLs to use set-based paths 2026-01-27 16:16:51 -06:00
services Replace silent error hiding with explicit failures 2026-01-29 18:48:06 -06:00
socketio Refactor to dependency injection pattern - no monkey patching 2026-01-28 22:54:57 -06:00
unit Validate connection data integrity in ConnectionManager 2026-01-29 19:03:17 -06:00
__init__.py Add backend foundation with uv, Black, and pre-commit hooks 2026-01-24 00:12:33 -06:00
conftest.py Switch to testcontainers for automatic test container management 2026-01-28 16:49:11 -06:00
factories.py Add database infrastructure with SQLAlchemy models and test suite 2026-01-27 10:17:30 -06:00
test_health.py Add backend foundation with uv, Black, and pre-commit hooks 2026-01-24 00:12:33 -06:00