fix(browser-transfer): reissue the part capability after a PUT 401/403 or expiry (01-01)

A single object-store refusal ended the whole upload as PERMISSION_DENIED
with retryable:false. The next attempt already issues a fresh capability, so
REISSUE_CAPABILITY PUT failures now retry within maxRetries; BFF issuance
refusals still stop at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DongHyeonka
2026-09-25 22:03:50 +09:00
co-authored by Claude Opus 5.5
parent 926f448fce
commit 648fe4e9f7
3 changed files with 257 additions and 1 deletions
@@ -1015,7 +1015,19 @@ async function uploadPartWithRetry<Capability>(
);
}
lastFailure = uploaded.error;
if (!canRetry(uploaded.error, attempt, dependencies.policy)) {
// 01-01. A PUT refused with REISSUE_CAPABILITY (401/403, gone, or the
// executor's own expiry check) is what the next attempt's fresh capability
// recovers. A refused issuance above still stops at once.
const reissuable =
uploaded.error.retryable ||
uploaded.error.recovery === "REISSUE_CAPABILITY";
if (
!canRetry(
{ ...uploaded.error, retryable: reissuable },
attempt,
dependencies.policy,
)
) {
return stripProviderFailure(uploaded);
}
}