Repository navigation
@remotion/media: Resume browser exports after offline fetch failures - #12021
alec-watts wants to merge 7 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Follow-up from downstream review in https://github.com/kino-ai/kino/pull/3936:
The downstream PR is now merge-ready with unit CI, Vercel, and Bugbot passing. That is not a substitute for an end-to-end browser disconnect/reconnect render in this upstream checkout, which remains unverified. |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Fixed and pushed the CI failures caused by this change:
Local verification: core/media/web-renderer lint and formatting passed; core built and all 717 tests passed; the full SSR suite passed; built CJS and ESM imports passed on actual Node 16.20.2 without global fetch; recovery/reconnect/abort and cleared-timeout probes passed. Full local monorepo integration was blocked by missing language tooling (python, PHP, Go and Ruby bundle setup), but monorepo CI now passes. The new CI run has passed Linting + Formatting, SSR tests, and Monorepo tests. A remaining Windows Node 16 job failed on the unrelated bundler test "emits a zero-delay Rspack React Refresh runtime" hitting its 5000 ms timeout; no fetch import error remains in that job. Other integration jobs are still running. |
JonnyBurger
left a comment
There was a problem hiding this comment.
The UrlSource.fetchFn integration is a sensible direction, but I am requesting changes for the timeout scope wiring, disposal cleanup, and package ownership described below.
I reproduced both behavioral issues with targeted runtime probes against this head, using the pinned Mediabunny 1.56.1. A complete browser disconnect/reconnect export has not been verified.
…eview # Conflicts: # packages/core/src/internals.ts
Browser exports can fail their media and readiness deadlines during a network outage, preventing the same export from continuing after reconnection.
This revision addresses the maintainer's render-scope wiring, disposal, and package-ownership requests:
@remotion/mediaowns theUrlSource.fetchFnrecovery helper. It waits for reconnection only after a fetch rejects withTypeErrorwhile the browser explicitly reports offline. HTTP responses and online failures continue through Mediabunny's normal policy.DelayRenderContextTypescope, and unmount, completion, cancellation, and cache disposal release the tracking.Verification
Actual
renderMediaOnWebexports with authored<Video>and<Audio>, native H.264/AAC encoding, public Mediabunny 1.61.3, and hidden Electron:git diff --checkpass. Temporary source aliases and production bundles were used for local tests. No test configuration or dependency changes ship.Limits
navigator.onLineis a connectivity hint. Outages where it stays true retain the existing retry policy. Recovery covers failures before a response is returned, not failures reading an already-open response body. An offline wait suspends media handles within its own render cache; preview inputs do not extend an export's timeout. Offline exports can wait until reconnection or cancellation. Server-render timeout policy is unchanged. Full upstream CI is a separate check.packages/core/src/delay-render.tspackages/core/src/internals.tspackages/media/src/offline-media-fetch.tspackages/media/src/get-shared-input.tspackages/media/src/video-extraction/get-frames-since-keyframe.tspackages/media/src/get-sink.tspackages/media/src/caches.tspackages/media/src/video/video-for-rendering.tsxpackages/media/src/audio/audio-for-rendering.tsxpackages/web-renderer/src/wait-for-ready.tsDiff cleanup removes the old core recovery helper, offline window state, and label matching. No parallel input, decoder, request queue, or global fetch override is introduced.
Shared CI test repair
Includes the one-line caption-inspector track selector fix from #12179. Current main fails this test before it can exercise caption persistence. Both caption-inspector E2E cases pass in the actual Studio with this repair; restoring the old selector reproduces the failure.
packages/example/e2e/captions-inspector.test.mts