Skip to content

Add upload_heartbeat for batch uploads that reserve jobs up front - #8

Open
NicPfitzer wants to merge 14 commits into
mainfrom
dev
Open

NicPfitzer wants to merge 14 commits into
mainfrom
dev

Conversation

@NicPfitzer

Copy link
Copy Markdown
Contributor

Problem

A job created ahead of its upload is held for 30 minutes; if no video data
arrives it is treated as abandoned and deleted. A script that reserves jobs for
a batch and uploads them one at a time outlives that hold, and the jobs still
waiting are deleted mid-run — every later call for them fails with a 404 that
says nothing about why.

This is what took out a 165-video web upload past the ~50th item; the same
expiry applies to API callers.

Changes

  • Kanopy.upload_heartbeat(job_ids) — renews the hold on jobs that are reserved
    but not yet uploading. Returns refreshed and missing; missing ids cannot
    be revived, so re-create the job to retry that video.
  • Register it in SDK_OPERATIONS and sync tests/fixtures/openapi.public.json
    with the backend's published contract.

Scope note

The SDK's own upload paths are not exposed and are unchanged: create_job
is immediately followed by the transfer, and once a multipart upload opens the
job is no longer a candidate for expiry. This is for callers who reserve ids
ahead of time — which the idempotent upload_request_id flow encourages.

Requires the backend to publish the operation (kanopy-backend #162).

Tests

Full suite green (34 passed), including the contract tests that bind
SDK_OPERATIONS to the reviewed public schema.

🤖 Generated with Claude Code

NicPfitzer and others added 13 commits August 10, 2026 16:30
A job created ahead of its upload is held for 30 minutes; if no video
data arrives it is treated as abandoned and deleted. A script that
reserves jobs for a batch and uploads them one at a time outlives that
hold, and the jobs still waiting are deleted mid-run — every later call
for them fails with a 404 that says nothing about why.

The SDK's own upload paths are not exposed: create_job is immediately
followed by the transfer, and once a multipart upload opens the job is
no longer a candidate for expiry. This is for callers who reserve ids
ahead of time, which the idempotent upload_request_id flow encourages.

Also sync the contract fixture with the backend's published surface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant