fix(player): report and fail closed on runtime delivery errors (#3472)

* feat(player): report runtime data application

* fix(player): fail closed on runtime data delivery

* fix(player): close runtime delivery and sandbox gaps

* fix(player): satisfy runtime contract and CodeQL

* refactor(player): simplify runtime tag scanner

* style(player): apply repository formatter

* fix(player): type runtime tag boundaries

* fix(core): mint guest-local runtime-data ids in a separate space from host ids
This commit is contained in:
Vance Ingalls
2026-08-30 13:00:14 -07:00
committed by GitHub
parent 3337cc8990
commit 859ac622c2
20 changed files with 632 additions and 58 deletions
@@ -40,6 +40,8 @@ export interface MessageHandlerCallbacks extends PlaybackStateCallbacks {
* uses it to replay current bridge state (mute, volume, playback rate) so
* control messages sent before the iframe's listener registered aren't lost. */
onRuntimeReady: () => void;
onRuntimeDataApplied?: (channel: unknown, requestId: unknown) => void;
onRuntimeDataError?: (channel: unknown, requestId: unknown, message: unknown) => void;
/** Invoked when the runtime posts a finite positive timeline duration. The
* player uses this as the cross-origin readiness signal because the
* same-origin composition probe cannot inspect CDN iframes. */
@@ -93,11 +95,12 @@ export function handleRuntimeMessage(
}
if (data["type"] === "runtime-data-error") {
callbacks.dispatchEvent(
new CustomEvent("runtimedataerror", {
detail: { channel: data["channel"], message: data["message"] },
}),
);
callbacks.onRuntimeDataError?.(data["channel"], data["requestId"], data["message"]);
return;
}
if (data["type"] === "runtime-data-applied") {
callbacks.onRuntimeDataApplied?.(data["channel"], data["requestId"]);
return;
}