← Commit history

0.9.294: Demo panel callback URL fix: the bridge read its bound port from a second copy of the server module and sent no eventCallbackUrl to ab (panel presses reached the tour only via poll). The port now travels through the environment, so every press is POSTed to the bridge the instant it is clicked. Verified on the test box: a press to the loopback route paused within the beat, muted at once, and resumed on play.

John Lauer ·b61298c042 ·1mo ago ·parent 14f8121
1 file changed +5
server.py+5
@@ -1725,6 +1725,11 @@ def main():     try:         server = _SingleInstanceHTTPServer((bind_host, port), KiCadBridgeHandler)         BOUND["host"], BOUND["port"] = bind_host, port   # demo panel callback URL is built from this+        # server.py runs as __main__; a handler that does `import server` gets a+        # SECOND module object whose BOUND is still empty (seen live: the demo+        # panel got no callback URL). The environment is the one place both see.+        os.environ["ADOM_KICAD_BRIDGE_PORT"] = str(port)+        os.environ["ADOM_KICAD_BRIDGE_HOST"] = bind_host     except OSError as e:         print(f"[KiCad Bridge] Port {port} already in use ({e}). "               f"Another bridge instance owns it — exiting cleanly (single-instance guard).")