spaxel/mothership/cmd
jedarden 41e8233011 feat(bf-5lii): wire immediate registry sync on simulator node create/update
The simulator API handlers AddNode and UpdateNode only logged that a node
"will be synced to registry on next periodic sync" — they held a
registryBridge field but had no RegistryNodeAdapter to pass to
SyncToRegistry, so new nodes waited up to 30s for the periodic ticker
before reaching the fleet registry.

Wire the missing half:
- SimulatorHandler gains a registryAdapter (simulator.RegistryNodeAdapter)
  field threaded into NewSimulatorHandler.
- AddNode calls registryBridge.SyncToRegistry(adapter) right after
  CreateVirtualNode succeeds; UpdateNode does the same after
  UpdateNodePosition succeeds. Both run outside the handler lock.
- main.go adds fleetRegistryAdapter (adapts *fleet.Registry to the
  simulator interface, converting fleet.NodeRecord <-> simulator.NodeRecord),
  shared by the immediate syncs and the 30s periodic ticker (which stays
  as a safety net).

New table-driven TestImmediateSyncOnAddAndUpdate covers both the wired and
nil-adapter no-op paths.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-06 11:46:43 -04:00
..
mothership feat(bf-5lii): wire immediate registry sync on simulator node create/update 2026-07-06 11:46:43 -04:00
sim feat(ingestion): persist hello-announced node position in fleet registry (bf-24xp) 2026-07-03 18:42:34 -04:00
_parse_check.go feat: verify dashboard WebSocket feed supports events, alerts, BLE, triggers, health 2026-04-07 09:54:14 -04:00