mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-06-14 18:24:54 +02:00
78d54b76e0
The async SQLAlchemy engine was missing PRAGMA foreign_keys=ON, causing ondelete="CASCADE" constraints to be silently ignored when the collector deleted inactive nodes. This left orphaned rows in user_profile_nodes, event_observers, and node_tags, which crashed the API with AttributeError when accessing assoc.node.public_key on null relationships. - Add FK PRAGMA listener to async engine (database.py) - Add null-guard in _build_adopted_nodes() and refactor list_profiles() - Add cleanup_orphaned_node_relations() covering all 3 dependent tables - Integrate orphan cleanup into scheduled retention cycle (subscriber.py) - Add --node-cleanup/--node-cleanup-days flags to CLI cleanup command - Fix truncate cascade warning to include user_profile_nodes/event_observers - Add FK PRAGMA to test fixtures for cascade verification - Add upgrade note to docs/upgrading.md