feat: retry transient S3 upload failures with richer telemetry#51
Merged
Conversation
The analysis-bundle PUT goes straight to a presigned S3 URL via raw fetch, so nothing retries it on a transient blip. Retry the transient outcomes (429/5xx/RequestTimeout, network errors) with exponential backoff, capped at 4 attempts, while failing fast on 4xx signature/permission errors. Parse the S3 XML error <Code>/<RequestId> and surface them through a privacy-safe uploadErrorTelemetry() (never the raw body or presigned URL, which embed the owner/email object key). sharePrompt now reports that detail to analytics and logs the failure for o11y.
jcarver989
approved these changes
Jun 26, 2026
blimmer
pushed a commit
that referenced
this pull request
Jun 26, 2026
🤖 I have created a release *beep* *boop* --- ## [0.7.0](v0.6.0...v0.7.0) (2026-06-26) ### Features * retry transient S3 upload failures with richer telemetry ([#51](#51)) ([02f4b9f](02f4b9f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: contextbridge-pr-automation[bot] <259134118+contextbridge-pr-automation[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The analysis-bundle upload PUTs straight to a presigned S3 URL via raw
fetch, so the AWS SDK (which only signs the URL) never retries it on a transient blip. This adds our own retry of the transient outcomes — 429/5xx/RequestTimeout and network errors — with exponential backoff capped at 4 attempts, while failing fast on 4xx signature/permission errors. It also parses the S3 XML error<Code>/<RequestId>and surfaces them through a privacy-safeuploadErrorTelemetry()thatsharePromptnow reports to analytics and logs on failure.Review focus
.orElse(recursive on#putToS3WithRetry) rather than a throw-based retry lib, to keep the typedUploadErrorin Result-land end-to-end. Worth a sanity check on the backoff math (retryMinTimeoutMs * 2 ** (attempt - 1)) and theisRetryableUploadErrorclassification.uploadErrorTelemetry()deliberately omits the raw S3 body and presigned URL because both embed the owner/email object key. Please confirm nothing privacy-sensitive leaks through the fields we do send (s3Code,requestId, truncated network error messages).Commits
899a008— retry transient S3 upload failures with richer telemetry