Skip to content

fix(stems): surface archive job timeouts on mobile - #14539

Open
dylanjeffers wants to merge 1 commit into
mainfrom
fix/stems-archive-mobile-timeout
Open

fix(stems): surface archive job timeouts on mobile#14539
dylanjeffers wants to merge 1 commit into
mainfrom
fix/stems-archive-mobile-timeout

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Closes #14536.

Problem

DownloadTrackArchiveDrawer keyed hasError off jobState.state === 'failed' alone:

const hasError =
  !isStartingDownload &&
  (downloadError || initiateDownloadFailed || jobState?.state === 'failed')

A stems archive job that never leaves waiting is reported as a valid non-terminal state forever, so the drawer spun indefinitely — no error, no retry affordance, no way for the user to tell it would never finish.

#14535 added STEMS_ARCHIVE_POLL_TIMEOUT_MS to useGetStemsArchiveJobStatus and wired the resulting isTimedOut into the web modal, but the mobile drawer was never updated. It destructured only data, dropping both isTimedOut and isError.

Why this isn't hypothetical

During the 2026-07-28 archiver outage the worker lost its Redis locks when archiver-redis was recreated, kept all five concurrency slots, and 24 jobs sat in waiting across 15 tracks for ~7 hours (AudiusProject/pedalboard#77). Web users got an error and a retry link after 15 minutes. Mobile users got a spinner that could never resolve.

Change

Destructure isError and isTimedOut from the shared hook and fold them into hasError, matching the web modal exactly:

const hasError =
  !isStartingDownload &&
  (downloadError ||
    initiateDownloadFailed ||
    jobState?.state === 'failed' ||
    (!!jobId && (isJobStatusError || isJobTimedOut)))

The !!jobId guard mirrors web — job-status errors only count once a job actually exists, so a pending create isn't reported as a failed download.

No hook changes; the timeout and flag already existed and were simply unused here.

Scope

Deliberately narrow. The error copy shown on both platforms is still the hardcoded "check your connection" string even when the archiver returns a real failedReason — that's #14537 and unchanged here.

Testing

  • tsc --noEmit clean; confirmed via --listFiles that the drawer is actually in the checked program.
  • eslint --ext=ts,tsx src/components/download-track-archive-drawer/ clean.
  • Not exercised on a device — reproducing it requires an archiver whose worker is wedged, which is the condition pedalboard#84 exists to make recoverable.

🤖 Generated with Claude Code

DownloadTrackArchiveDrawer keyed hasError off jobState.state === 'failed'
alone, so a stems archive that never leaves `waiting` spun forever with no
error and no retry affordance.

#14535 added STEMS_ARCHIVE_POLL_TIMEOUT_MS to useGetStemsArchiveJobStatus
and wired the resulting isTimedOut into the web modal, but the mobile
drawer was not updated — it destructured only `data`, dropping both
isTimedOut and isError.

That gap is not hypothetical. During the 2026-07-28 archiver outage the
worker lost its Redis locks and held every concurrency slot, leaving 24
jobs parked in `waiting` for ~7 hours. `waiting` is a perfectly valid
non-terminal state, so mobile users got an indeterminate spinner that
could never resolve, while web users at least got an error and a retry
link after 15 minutes.

Fold isError and isTimedOut into hasError, matching web exactly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2c3aeb6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stems archive: mobile drawer ignores isTimedOut, so a stalled job spins forever

1 participant