Skip to content

feat(BA-6159): add /upload/status endpoint and progress headers#11770

Draft
jopemachine wants to merge 1 commit into
fix/BA-6156-rewire-tus-handlersfrom
feat/BA-6159-upload-status-endpoint
Draft

feat(BA-6159): add /upload/status endpoint and progress headers#11770
jopemachine wants to merge 1 commit into
fix/BA-6156-rewire-tus-handlersfrom
feat/BA-6159-upload-status-endpoint

Conversation

@jopemachine
Copy link
Copy Markdown
Member

@jopemachine jopemachine commented May 22, 2026

📚 Stacked PRs

This PR is part of a 5-PR stack implementing BA-3974 (epic: BA-6153). Merge in order:

  1. ⬇️ feat(BA-6155): add metadata-driven chunk-store upload session engine #11766feat(BA-6155): add metadata-driven chunk-store upload session engine
  2. ⬇️ fix(BA-6156): rewire TUS PATCH/HEAD to chunk-based store #11767fix(BA-6156): rewire TUS PATCH/HEAD to chunk-based store (actual user-visible fix)
  3. ⬇️ test(BA-6157): add multi-proxy NFS race regression test #11768test(BA-6157): add multi-proxy NFS race regression test
  4. ⬇️ feat(BA-6158): support TUS Checksum extension #11769feat(BA-6158): support TUS Checksum extension
  5. 👉 feat(BA-6159): add /upload/status endpoint and progress headers #11770feat(BA-6159): add /upload/status endpoint + progress headers ← you are here

Summary

  • Add `GET /upload/status?token=…` returning JSON: `session`, `total_size`, `committed_offset`, `chunks_received`, `missing_ranges`, `progress_percent`, `status`. Authenticated via the same upload JWT.
  • Add additive PATCH response headers: `X-Backend-Ai-Chunks-Received`, `X-Backend-Ai-Progress-Percent`, `X-Backend-Ai-Total-Expected` (exposed via CORS).
  • Standard TUS clients are unaffected; this endpoint and the new headers are opt-in.

Resolves BA-6159.

@github-actions github-actions Bot added size:L 100~500 LoC comp:storage-proxy Related to Storage proxy component labels May 22, 2026
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from 305ca0e to e87b033 Compare May 22, 2026 07:04
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from dada14e to 0d1bf13 Compare May 26, 2026 05:55
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch 2 times, most recently from 358a152 to beffe63 Compare May 26, 2026 08:29
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from 7dcbab8 to 84e303d Compare May 26, 2026 08:50
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from beffe63 to fb51bcd Compare May 26, 2026 08:51
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from 84e303d to fc4dc36 Compare May 26, 2026 09:04
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from fb51bcd to f446c82 Compare May 26, 2026 09:04
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from fc4dc36 to 968d6c3 Compare May 26, 2026 09:11
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from f446c82 to 0a8f7f3 Compare May 26, 2026 09:11
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from 968d6c3 to b40ebc8 Compare May 26, 2026 09:13
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from 0a8f7f3 to 4dfa415 Compare May 26, 2026 09:13
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from b40ebc8 to a94454f Compare May 26, 2026 09:19
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from 4dfa415 to 66abc1a Compare May 26, 2026 09:19
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from a94454f to 583cb92 Compare May 26, 2026 09:31
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from 66abc1a to 1675929 Compare May 26, 2026 09:31
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from 583cb92 to 1f2fc01 Compare May 28, 2026 05:02
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from 1675929 to 0f683a3 Compare May 28, 2026 05:02
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from 0f683a3 to 7326420 Compare May 28, 2026 05:10
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from 1f2fc01 to 4c07f47 Compare May 28, 2026 05:10
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch 2 times, most recently from 8e00135 to e40f226 Compare June 1, 2026 05:48
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from e37ca75 to cf51fc2 Compare June 1, 2026 05:51
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from e40f226 to 66ffac3 Compare June 1, 2026 05:51
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from cf51fc2 to c171fa4 Compare June 1, 2026 06:15
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from 66ffac3 to 48bb49c Compare June 1, 2026 06:15
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from c171fa4 to e517c70 Compare June 1, 2026 06:19
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch 2 times, most recently from 035b09b to c884ca9 Compare June 1, 2026 06:21
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from 6acff68 to e14f59f Compare June 1, 2026 06:30
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch 2 times, most recently from 6448b90 to 9465584 Compare June 1, 2026 06:35
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from 51181ab to fccee9f Compare June 1, 2026 06:44
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch 2 times, most recently from 7c677c9 to 00f7754 Compare June 1, 2026 06:45
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from fccee9f to ee1e510 Compare June 1, 2026 06:52
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from 00f7754 to 9e1cf59 Compare June 1, 2026 06:52
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from ee1e510 to 087b43d Compare June 1, 2026 07:29
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch 2 times, most recently from 383e193 to 61da25a Compare June 1, 2026 07:33
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from 5dd870e to c9c67a8 Compare June 1, 2026 07:45
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch 2 times, most recently from bf6d34a to f8db68f Compare June 1, 2026 07:55
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from c9c67a8 to e35aee1 Compare June 1, 2026 07:55
@jopemachine jopemachine force-pushed the feat/BA-6159-upload-status-endpoint branch from f8db68f to efb9080 Compare June 1, 2026 08:00
Standard TUS HEAD only returns Upload-Offset, which is ambiguous when
chunks arrive out of order: the client cannot tell which byte ranges are
still missing. This sub-task surfaces the session metadata so resume is
precise.

  - GET /upload/status?token=… returns JSON: session, total_size,
    committed_offset, chunks_received (list of offsets),
    missing_ranges (list of {offset, length} gaps),
    progress_percent, status. Authenticated via the same upload JWT.
  - PATCH responses gain three additive headers:
    X-Backend-Ai-Chunks-Received, X-Backend-Ai-Progress-Percent,
    X-Backend-Ai-Total-Expected. Headers are exposed via CORS
    Access-Control-Expose-Headers so browser clients can read them.

Tests cover the status endpoint for empty / partial / out-of-order /
missing-session cases plus the new PATCH response headers.

Resolves BA-6159. Part of epic BA-6153 (implements BA-3974).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:storage-proxy Related to Storage proxy component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant