Repository navigation
NAT-548: Integrate upload preparation and pause/cancel lifecycle - #171
Merged
eugene-mux merged 52 commits intoOct 22, 2026
Merged
eugene-mux merged 52 commits into
eugene-mux merged 52 commits into
Conversation
eugene-mux
marked this pull request as ready for review
October 8, 2026 21:44
eugene-mux
force-pushed
the
em/nat-548-upload-preparation
branch
from
October 16, 2026 18:08
539b523 to
e0738b5
Compare
eugene-mux
force-pushed
the
em/nat-548-upload-preparation
branch
from
October 16, 2026 18:09
e0738b5 to
95520c2
Compare
eugene-mux
force-pushed
the
em/nat-548-upload-preparation
branch
from
October 16, 2026 18:35
95520c2 to
0097f2a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f50afbc. Configure here.
daytime-em
approved these changes
Oct 21, 2026
Base automatically changed from
em/nat-547-sdr-conversion
to
feature/nat-534-hevc-standard-ingest
October 22, 2026 21:02
eugene-mux
merged commit Oct 22, 2026
3af2dd2
into
feature/nat-534-hevc-standard-ingest
1 of 2 checks passed
Open
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.

Description
Replaces legacy upload preparation with the Standard Input pipeline and gives pause/cancel a consistent lifecycle across uploads and the manager. Generated uploads remain gated until payload identity and server-offset verification are available; new attempts select the original file.
Changes
Validation
readywith no non-standard input reasons. Generated upload orchestration remains gated.readywith no non-standard input reasons and preserves Mux’s 880 Hz mono primary audio. Local checks prove the fallback remains enforced even when the generated-resume gate is verified, and single-track conversion still works.readywith the expected 4K input-resolution reason. Generated-payload resume remains gated.awaitSuccess()callers receive a failure on upload cancellation, follow force restarts through the new job, and still throw on genuine caller-coroutine cancellation. Managed/unmanaged restart publication races are covered; pause behavior remains unchanged and is documented.Note
High Risk
Core upload orchestration, persistence/resume rules, and removal of the legacy transcoder affect all direct uploads; generated-payload blocking and destination replacement change failure/retry semantics integrators may rely on.
Overview
Replaces the legacy on-device transcoder with the Standard Input preparation path (
UploadPreparation, SDR adapter) and models each upload as anUploadAttempttied to anUploadSessionso handles, the manager, and persistence stay aligned across pause, cancel, restart, and destination replacement.Lifecycle and API behavior are tightened:
cancelends a handle (laterstart/awaitSuccessfail withUploadCancelledException);awaitSuccessfollows force restarts and surfaces replacement/cancel outcomes without treating upload pause as caller cancellation; listeners are deduplicated and late events suppressed after pause/cancel.MuxUploadManagerpauses via attempts, keeps failed jobs discoverable for retry, and won’t let a stale handle cancel a replacement. SDKinitializerestores only non-paused cached jobs (resumeCachedJobs(includePaused = false)); explicitresumeAllCachedJobsstill resumes paused work.Resume safety for generated payloads: persistence tracks attempt IDs, original vs generated selection, and per-destination blocks after any generated bytes were sent—unsafe resume throws
GeneratedResumeBlockedExceptionand requires a new Direct Upload URL. Verified generated files get identity checks before upload; chunk HTTP uses cancellable async OkHttp and progress is acknowledged per chunk on the attempt.Policy change: multi-audio inputs fall back to original bytes (planner/validator/preparation) so local conversion cannot pick an unverified first track over Mux’s ingest choice. Builder docs now describe fallback to original when local standardization isn’t safe.
Reviewed by Cursor Bugbot for commit 0c6bd8b. Bugbot is set up for automated code reviews on this repo. Configure here.