Skip to content

fix: stop failing transcode polling on unrecognized phase names - #11

Open
nate-kelley-buster wants to merge 1 commit into
TheBestMoshe:mainfrom
nate-kelley-buster:fix/transcode-phase-allowlist
Open

nate-kelley-buster wants to merge 1 commit into
TheBestMoshe:mainfrom
nate-kelley-buster:fix/transcode-phase-allowlist

Conversation

@nate-kelley-buster

Copy link
Copy Markdown

Problem

Fixes #3.

entry add, track upload, and track status --wait all poll transcode status against a hardcoded allow-list of "in progress" phase names (queued/processing/transcoding, or queued/processing). Any phase outside that list is treated as a terminal failure and the command exits immediately:

ℹ Uploading 01 - Track.mp3...
✓ Uploaded successfully
ℹ Waiting for transcoding...
✗ Transcoding failed with status: analyzing

The file isn't actually failing — it's still being processed. The API evidently emits more phases than the allow-list accounted for. I reproduced this live and saw both analyzing and downloading trigger the false failure on otherwise-healthy uploads.

Fix

Invert the check: only treat failed/error as terminal. Every other phase (named or not) is "still working," so polling continues until the file reaches complete or the timeout elapses. This also matches the workaround already documented in #3 (upload with --no-wait, then poll track status — which only "works" because polling for status separately doesn't hit this same bug on retry... except it does hit the same allow-list, so this fixes that path too).

Also bumped the poll timeout from 5 to 10 minutes across all three call sites, since 5 minutes was calibrated assuming only 2-3 phases; real files now legitimately spend time in earlier phases (downloading, analyzing) before transcoding even starts.

Verification

Reproduced against the live API on a real 56-minute audiobook chapter file:

  • Before: entry add failed instantly with status: analyzing, then status: downloading after a partial fix attempt.
  • After: same file uploads and transcodes to completion (✓ Transcoding complete, entry added successfully) with no code changes other than this fix.

Fixes TheBestMoshe#3

entry add, track upload, and track status all polled transcode
status against a hardcoded allow-list of "in progress" phase names
(queued/processing/transcoding, or queued/processing). Any other
phase the API returned was treated as a terminal failure and the
command exited immediately with "Transcoding failed with status:
<phase>" — even though the file was still being processed.

In practice the API emits more phases than the allow-list knew
about ("analyzing", "downloading" both reproduced live), so most
uploads failed instantly instead of polling through to completion,
exactly as described in TheBestMoshe#3.

## Fix

Invert the check: only treat a phase as terminal failure if it's
explicitly "failed" or "error". Any other phase (known or not) is
treated as still-in-progress and polling continues until the file
reaches "complete" or the timeout elapses. Also bumped the polling
timeout from 5 to 10 minutes across all three call sites, since the
old timeout was sized around the old (incomplete) phase list and
some files legitimately spend real time in earlier phases like
downloading/analyzing before transcoding starts.

## Verification

Reproduced against the live API: `entry add` on a real audiobook
chapter failed immediately with "Transcoding failed with status:
analyzing", then again with "status: downloading" after a partial
fix. After this change the same file uploads and transcodes
successfully end-to-end (56-minute file, "Transcoding complete").

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0182auKxRRCcLdZrBotvbJ6K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

entry add: transcoding times out with 'analyzing' status for most files

1 participant