fix: preserve playback through media processing failures - #2234
Merged
Conversation
richiemcilroy
marked this pull request as ready for review
September 7, 2026 17:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short or sparse uploads can produce no thumbnail at the selected timestamp, and a thumbnail storage failure currently fails an otherwise successful video conversion. Retry the thumbnail once from the first frame of the local file within the existing timeout, and keep successfully uploaded videos complete when only thumbnail storage fails. Cancellation preserves its terminal state and emits one terminal webhook. Actual video failures still propagate.
Playback probes now cancel their response bodies after reading headers. If a preferred original upload disappears after processing, check the finished MP4 once so the player can recover. Existing playback during processing, authorization, source preservation, and transfer budgets are preserved. Add playback and budget coverage to the recording reliability CI gate.
Validation:
The final revision passed both Linux production-image decode/failure-recovery and long-recording performance checks, web typechecking, and self-hosting CI. The remaining cancellation race raised by automated review assumes interruption between the final abort check and the completion update; that path is synchronous, and the job manager also refuses changes to terminal states. The API cancellation regressions verify a single terminal webhook for both output and thumbnail upload cancellation.
Thumbnail decode failures remain fatal after the local fallback is exhausted: ordinary processed uploads do not yet have independent output validation, so broadening the optional-asset catch to include decoder failures would weaken the existing validity check. Storage failures are separated only after a thumbnail has decoded successfully.
Deployed as
05ebc5298ee750b71f4c9600f89dadd38f4d4456on Vercel and Railway on September 7. All six media replicas passed health checks. A bounded production conversion of a 520,686-byte source returned HTTP 200 in 709 ms; the returned H.264/AAC MP4 passed a full FFmpeg decode. A completed uploaded recording also played to the end on the deployed share page with no media error. The initial live snapshot showed seven uploads cleared, six still uploading, and no upload errors; two new Instant jobs subsequently showed verified on their first attempt. These are initial rollout checks, not a sustained reliability or billing measurement.