mirror of
https://github.com/smittix/intercept.git
synced 2026-04-28 16:50:01 -07:00
fix(modes): deep-linked mode scripts fail when body not yet parsed
ensureModeScript() used document.body.appendChild() to load lazy mode scripts, but the preload for ?mode= query params runs in <head> before <body> exists, causing all deep-linked modes to silently fail. Also fix cross-mode handoffs (BT→BT Locate, WiFi→WiFi Locate, Spy Stations→Waterfall) that assumed target module was already loaded. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,7 +45,7 @@ def close_process_pipes(process: subprocess.Popen) -> None:
|
||||
|
||||
|
||||
def cleanup_all_processes() -> None:
|
||||
"""Clean up all registered processes on exit."""
|
||||
"""Clean up all registered processes and flush DataStores on exit."""
|
||||
logger.info("Cleaning up all spawned processes...")
|
||||
with _process_lock:
|
||||
for process in _spawned_processes:
|
||||
@@ -60,6 +60,14 @@ def cleanup_all_processes() -> None:
|
||||
close_process_pipes(process)
|
||||
_spawned_processes.clear()
|
||||
|
||||
# Stop DataStore cleanup timers and run final cleanup
|
||||
try:
|
||||
from utils.cleanup import cleanup_manager
|
||||
cleanup_manager.cleanup_now()
|
||||
cleanup_manager.stop()
|
||||
except Exception as e:
|
||||
logger.warning(f"Error during DataStore cleanup: {e}")
|
||||
|
||||
|
||||
def safe_terminate(process: subprocess.Popen | None, timeout: float = 2.0) -> bool:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user