Skip to content

Audio download endpoint hangs with 0 bytes after 429 rate-limit (other endpoints unaffected) #7325

Closed

Description

@mdmohsin7

Summary

A desktop (macOS) user reports that the audio download endpoints stop returning data for their account after the account hits a rate limit (HTTP 429). After the 429, the endpoints hang indefinitely with zero bytes returned instead of returning an error.

Affected endpoints

  • GET /v1/sync/audio/{conversation_id}/{file_id}?format=wav — hangs, 0 bytes, 90–300s, then times out
  • GET /v1/sync/audio/{conversation_id}/urls — same hang behavior

Endpoints that continue to work normally (same auth token)

  • GET /v1/conversations and GET /v1/conversations/{id} — return instantly, including audio_files metadata
  • POST /v1/sync/audio/{conversation_id}/precache — returns {"status":"started","audio_file_count":N} in under a second

Reproduction / timeline

  1. Two recordings downloaded successfully via the format=wav endpoint.
  2. Subsequently received HTTP 429 (Too Many Requests).
  3. After a ~10 minute pause, requests no longer return 429 — instead they hang with zero bytes for the entire timeout window (curl reports 0 bytes received).
  4. Behavior is independent of audio file size — reproduced on both short (~4–5 min) and long (~17 min) recordings.
  5. Auth confirmed valid (other authenticated endpoints respond instantly with the same token).

Suspected cause

Per-account state issue after the 429 — either the rate-limit record is not clearing / is stuck for the account, or a merge/transcode worker for the account's audio is stuck in the queue. The download path hangs instead of returning a 429 or error, suggesting the request blocks on a backend worker rather than being rejected by the rate limiter.

Impact

A user is fully blocked from retrieving existing audio that is confirmed present on the server (metadata returns correctly, precache succeeds). The hang-with-no-response (vs. an explicit 429/5xx) also makes this hard for clients to detect and handle gracefully.

Suggested follow-ups

  • Confirm whether the rate limiter should auto-expire the block, and why downloads hang rather than return 429 once limited.
  • Consider a supported bulk/export path (e.g. a signed URL list) for users needing to retrieve many recordings, to avoid repeatedly hitting the merge endpoint.

Activity

  1. added
    p2
    retrieval-action
    maintainer
    on May 18, 2026
  2. mdmohsin7 commented on Jun 13, 2026

    @mdmohsin7
    MemberAuthor

    Backend hang is fixed and deployed (#7872)

    The root cause here — as the report's own "suspected cause" correctly guessed — wasn't the 429 itself but that the download path merged audio synchronously inside the request, so a slow/large merge blocked with zero bytes for the full timeout window. The 429 was incidental (an edge rate-limit, not the cause).

    What changed (PR #7872, live in prod): both affected endpoints no longer merge in-request.

    • GET /v1/sync/audio/{conversation_id}/urls — now a pure metadata read. Returns cached signed URLs, or pending + poll_after_ms instantly. It can no longer block on a merge worker → no more 0-byte hang.
    • GET /v1/sync/audio/{conversation_id}/{file_id} — serves a prebuilt artifact (or an already-merged legacy cache) directly; on a cache miss it enqueues a background build task and returns 202 pending immediately instead of blocking.

    Merges now run off-request as Cloud Tasks jobs that build a durable MP3 artifact, so playback/download reads are always fast and always return an explicit status (cached/pending/202) — which also resolves the report's secondary complaint that the silent hang was hard for clients to detect. The new /urls response is effectively the bulk signed-URL list suggested in the follow-ups.

    Note: this supersedes #7815 (the earlier bounded-first-file-wait attempt) — #7872 removes the in-request merge entirely rather than just capping it.

    Remaining before close: #7877 adds a terminal unavailable state for the narrow case where a conversation's source chunks no longer exist (so clients fail fast instead of polling indefinitely). The reporter's own audio is confirmed present (metadata + precache succeed), so it's unaffected by that edge — but we'll land #7877 and verify the desktop retrieval path before closing this out.

  3. aryanorastar commented on Sep 20, 2026

    @aryanorastar
    Collaborator

    Closing as already fixed on current main.

    Author mdmohsin7 says hang fixed/deployed; in-request merge removed. Merged #7872 (Cloud Tasks merge) + #7877 (terminal unavailable).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainerp2retrieval-action

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions