release: v0.9.9

This commit is contained in:
2026-05-14 17:23:05 +02:00
parent 5eda8a241f
commit 9f6b6a8518
4 changed files with 31 additions and 5 deletions

View File

@@ -1,5 +1,13 @@
# Changelog
## [0.9.9] 2026-05-14
### Fixes
- **„Failed to fetch"-Schleife in der UI (Issue #21):** Wenn die Web-UI über die LAN-IP geöffnet wurde, lieferte `/kx/printers` `bridge_url: http://localhost:7125` zurück. Der Browser machte daraufhin Cross-Origin-Requests von der LAN-IP nach `localhost` — die wurden vom Browser blockiert und produzierten eine Flut aus `TypeError: Failed to fetch`-Poll-Fehlern. Die Bridge liefert jetzt im Einzel-Drucker-Modus eine leere `bridge_url`, sodass das Frontend relative Pfade gegen dieselbe Origin wie die UI nutzt. Im Multi-Printer-Modus werden `localhost`/`127.0.0.1` als Bridge-Hosts herausgefiltert.
- **Windows-EXE crasht beim Start (Issue #21):** Die v0.9.8-`kx-bridge.exe` wurde mit einer veralteten `config_loader.py` aus einem früheren Release gebaut und stürzte mit `AttributeError: module 'config_loader' has no attribute 'list_printers'` ab. `release.sh` synct jetzt `config_loader.py` zusammen mit den anderen Quellen ins Windows-Build-Repository.
---
## [0.9.8] 2026-05-12
### Neu

View File

@@ -1,5 +1,13 @@
# Changelog
## [0.9.9] 2026-05-14
### Fixes
- **"Failed to fetch" loop in the UI (Issue #21):** When the web UI was opened via the LAN IP, `/kx/printers` was returning `bridge_url: http://localhost:7125`, which caused the browser to fire cross-origin requests from the LAN IP to `localhost` — these were silently blocked, producing a flood of `TypeError: Failed to fetch` poll errors. The bridge now sends an empty `bridge_url` in single-printer mode so the frontend uses relative paths against the same origin as the UI. In multi-printer mode, `localhost`/`127.0.0.1` are filtered out as bridge hosts.
- **Windows EXE startup crash (Issue #21):** The v0.9.8 `kx-bridge.exe` was built with a stale `config_loader.py` from an earlier release and crashed on startup with `AttributeError: module 'config_loader' has no attribute 'list_printers'`. `release.sh` now syncs `config_loader.py` into the Windows build repository together with the other source files.
---
## [0.9.8] 2026-05-12
### New

View File

@@ -1 +1 @@
0.9.8
0.9.9

View File

@@ -806,16 +806,26 @@ class KobraXBridge:
return self._json_cors({"result": jobs})
async def handle_kx_printers(self, request):
# Aktive Drucker (mit IP) sammeln
active = [(pid, br) for pid, br in self._all_bridges.items()
if (br._args.printer_ip or "").strip()]
# Host für bridge_url: Browser-Sicht beibehalten, aber niemals "localhost" exportieren
# sonst scheitern Fetches aus dem Browser, wenn die UI über die LAN-IP geöffnet ist.
host = request.host.split(":")[0]
if host in ("localhost", "127.0.0.1", "::1", "0.0.0.0"):
host = ""
out = []
for pid, br in self._all_bridges.items():
if not (br._args.printer_ip or "").strip():
continue # "leerer" Drucker (kein IP) nicht in der Liste anzeigen
for pid, br in active:
port = getattr(br._args, "port", 7125)
# Nur bei Multi-Printer eine konkrete bridge_url setzen (Cross-Instance-Fetch).
# Single-Printer: leere bridge_url → JS nutzt relative Pfade (gleiche Origin wie UI).
bridge_url = ""
if len(active) > 1 and host:
bridge_url = f"http://{host}:{port}"
out.append({
"id": pid,
"name": br._state.get("printer_name") or f"Drucker {pid}",
"bridge_url": f"http://{host}:{port}",
"bridge_url": bridge_url,
"printer_ip": br._args.printer_ip,
"device_id": br._args.device_id or "",
})