[codex] Fix TUS upload HEAD resume probes#2071
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR enhances TUS upload HEAD request handling by modifying probe detection to recognize both actual HTTP HEAD requests and TUS-Resumable header probes, then forwards them upstream without a request body. Tests verify HEAD routing through auth middleware and proper Upload-Offset header preservation across PATCH-HEAD-PATCH request sequences. ChangesBuild Upload HEAD Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
9ffb3b3 to
a25fb72
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
1 similar comment
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
supabase/migrations/20260507142606_restore_apikey_apps_rpc.sql (1)
63-65: 💤 Low valueMinor: Comment mentions "legacy fallback" but function has no visible fallback logic.
The phrase "with legacy fallback" in the comment may be misleading since this function itself doesn't implement any fallback behavior. If the fallback exists within
rbac_check_permission_direct, consider clarifying to avoid confusion, e.g., "using RBAC-aware permission checks."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@supabase/migrations/20260507142606_restore_apikey_apps_rpc.sql` around lines 63 - 65, The COMMENT for function get_accessible_apps_for_apikey_v2 is misleading by saying "with legacy fallback" even though the fallback logic isn't in this function; update the comment to remove or clarify that phrase—either delete "with legacy fallback" so it reads "using RBAC-aware permission checks" or explicitly state that any legacy fallback is implemented inside rbac_check_permission_direct so callers know where the behavior lives.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@supabase/migrations/20260507142606_restore_apikey_apps_rpc.sql`:
- Around line 63-65: The COMMENT for function get_accessible_apps_for_apikey_v2
is misleading by saying "with legacy fallback" even though the fallback logic
isn't in this function; update the comment to remove or clarify that
phrase—either delete "with legacy fallback" so it reads "using RBAC-aware
permission checks" or explicitly state that any legacy fallback is implemented
inside rbac_check_permission_direct so callers know where the behavior lives.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ad53f2f5-ec8f-4c4d-a815-65faeabd5387
📒 Files selected for processing (4)
supabase/functions/_backend/public/build/index.tssupabase/migrations/20260507142606_restore_apikey_apps_rpc.sqltests/build-upload-head-routing.test.tstests/build-upload-security.test.ts
0f5b8d3 to
4765422
Compare
|



Summary (AI generated)
HEADrequests through the TUS proxy even whenTus-Resumableis absent.GETupload URLs hidden unless they are TUS-shaped HEAD fallbacks.PATCH -> HEAD -> PATCHresume behavior.Motivation (AI generated)
The build TUS proxy could return route-level
404for active upload URLs onHEAD, whilePATCHcontinued to work. Standard TUS clients rely onHEADto discover the current upload offset before resuming.Business Impact (AI generated)
This restores resumable native build uploads, reducing failed uploads, wasted bandwidth, repeated build attempts, and support risk for customers using standard TUS clients.
Test Plan (AI generated)
bunx vitest run tests/build-upload-head-routing.test.ts tests/build-upload-security.test.tsbun lint:backendbun run supabase:db:resetbunx supabase test db supabase/tests/49_test_apikey_oracle_rpc_permissions.sql --workdir .context/supabase-worktrees/7d95798bbun run cli:build && vue-tsc --noEmitgit diff --checkGenerated with AI
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests