mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-08-26 17:31:34 +00:00
fix: wire adapter name mismatch in satpass event path
Central publishes sat events with wire adapter names celestrak_tle, n2yo_visualpasses, and satpass_predict. Task C's routing matched on sat_tles/sat_tle/sat_passes — names that exist nowhere on the wire — so every sat event was silently dropped at three kill points: 1. CENTRAL_ADAPTER_TO_SOURCE map (consumer.py line ~216) 2. _normalize dispatch conditionals (consumer.py line ~549) 3. satpass_handler adapter guard (satpass_handler.py line ~118) All three now use the correct wire names. Both handlers also gain an enabled gate that returns None when satpass.enabled=false, logging at INFO once per process lifetime via a _disabled_logged function flag. Existing test fixtures updated for the new adapter names and the enabled gate (cfg.enabled=True in mock, _disabled_logged cleanup). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4a17c7b702
commit
be4443feb9
5 changed files with 51 additions and 14 deletions
|
|
@ -14,7 +14,7 @@ def _envelope(norad_id=25544, sat_name="ISS", observer="Boise",
|
|||
"source": "central",
|
||||
"id": f"pass-{norad_id}-{aos}",
|
||||
"data": {
|
||||
"adapter": "sat_passes",
|
||||
"adapter": "n2yo_visualpasses",
|
||||
"category": "sat.pass",
|
||||
"severity": 0,
|
||||
"data": {
|
||||
|
|
@ -44,11 +44,15 @@ def mock_db():
|
|||
def mock_adapter_config():
|
||||
"""Mock adapter_config.satpass."""
|
||||
cfg = MagicMock()
|
||||
cfg.enabled = True
|
||||
cfg.observers = [] # empty = all observers
|
||||
cfg.min_elevation = 30
|
||||
cfg.norad_ids = [] # empty = all satellites
|
||||
with patch("meshai.central.satpass_handler.adapter_config") as mock:
|
||||
mock.satpass = cfg
|
||||
from meshai.central.satpass_handler import handle_satpass
|
||||
if hasattr(handle_satpass, "_disabled_logged"):
|
||||
del handle_satpass._disabled_logged
|
||||
yield cfg
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue