From 5268e77d00623c04213fa558babf0beefc232da5 Mon Sep 17 00:00:00 2001 From: Josue Zamudio Date: Mon, 31 Aug 2026 20:22:53 +0000 Subject: [PATCH] events: accept client-fail + play-probe types (was 422) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The diagnostic beacons were rejected server-side (only 'error' was whitelisted) — which is why the iPhone's fingerprint never arrived. Now: error / client-fail / play-probe accepted, payload fields forwarded; anything else still 422. --- server/app.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server/app.py b/server/app.py index 495c295..1bfaa14 100644 --- a/server/app.py +++ b/server/app.py @@ -282,14 +282,15 @@ def api_searches_post(item: dict = Body(...), request: Request = None): @app.post("/api/events") def api_events(evt: dict = Body(...), request: Request = None): - # client-reported events; only 'error' is accepted (playback failures - # happen in the browser, not in the request log) - if evt.get("type") != "error": + # client-reported events; the diagnostics the browser can uniquely see + # (playback failures, capability probes) happen client-side, not in the + # request log — so the phone reports them here + if evt.get("type") not in ("error", "client-fail", "play-probe"): raise HTTPException(422, "unknown event type") c = db.connect() - db.event(c, request.state.user, "error", - {k: evt[k] for k in ("ep_id", "ep", "lang") if k in evt} - | {"detail": str(evt.get("detail", ""))[:200]}) + db.event(c, request.state.user, evt["type"], + {k: evt[k] for k in ("ep_id", "ep", "lang", "msg", "detail", + "jsv", "branch", "hls_lib", "mse", "native_hls", "ua") if k in evt}) c.commit() c.close() return {"ok": True}