Skip to content

GitHub ingest: skip slow or oversized attachment downloads instead of dead-lettering - #1392

Merged
Zach Dunn (zachdunn) merged 1 commit into
mainfrom
claude/project-thread-mkx9fv
Nov 5, 2026
Merged

Zach Dunn (zachdunn) merged 1 commit into
mainfrom
claude/project-thread-mkx9fv

Conversation

@zachdunn

Copy link
Copy Markdown
Member

Requested by Zach · project thread

Why

Two pull_request edited deliveries for a private repo's PR (Nov 5, ~09:01 UTC) dead-lettered. In the Worker logs, every one of the 7 attempts per event hit TimeoutError: The operation was aborted due to timeout about 8 s into a fetch. That's the githubFetch deadline. Other events in the same batches, including GitHub API calls for other installations, went through fine. The repo's earlier PRs ingest normally, so nothing is wrong with the installation. The failing call is the attachment download in fetchAndStore: the 8 s API deadline also covers reading the body, and a large screen recording in the PR body can't finish in that time.

Because the timeout throws, the queue retried the whole event 6 times in about 2 minutes (no retry delay), and every retry timed out the same way. The event then dead-lettered, and the PR's adoption and managed-comment sync were lost with it.

What

  • Attachment downloads (the direct URL and the private-repo signed-URL fallback) get their own 30 s deadline. githubFetch takes an optional timeoutMs.
  • If the declared Content-Length is over the workspace's largest ceiling, the asset is skipped as too_large before the body is read.
  • A download that still times out becomes a permanent asset_timeout skip. It no longer throws, so the rest of the event (other assets, adoption, comment sync) still runs. Skips aren't ledgered, so a later edit tries the asset again.

Test plan

  • pnpm --filter @uploads/api exec vitest run src/github-ingest.test.ts src/github-app.test.ts: 85 passed, including two new cases (timeout becomes a skip; an oversized Content-Length is skipped without a put).
  • pnpm --filter @uploads/api typecheck passes.

Generated by Claude Code

… dead-lettering

A PR body attachment that took longer than the 8 s GitHub API deadline to
download threw a TimeoutError, so the queue retried the whole webhook event
six times in two minutes and dead-lettered it, dropping the adoption and
comment sync for that PR too (fintentional-monorepo#7799, Nov 5).

Attachment downloads now get a 30 s deadline, a declared Content-Length over
the workspace ceiling is skipped as too_large before the body is read, and a
download that still times out is a permanent asset_timeout skip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeLbkfu5FcEeveF5EnSXvd
@zachdunn Zach Dunn (zachdunn) self-assigned this Nov 5, 2026
@changeset-bot

changeset-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 263ee4d

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

@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 2

  • coderabbit:review
  • review
🚫 Excluded labels (none allowed): 1

  • wip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bee704b3-ce6a-4368-85e5-eb3e94ca61d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@zachdunn
Zach Dunn (zachdunn) merged commit 2589ff2 into main Nov 5, 2026
4 checks passed
@zachdunn
Zach Dunn (zachdunn) deleted the claude/project-thread-mkx9fv branch November 5, 2026 12:30
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.

2 participants