Skip to content

[Swift] Respect Retry-After for preload throttling - #660

Draft
markmur wants to merge 1 commit into
mainfrom
preload-retry-after-swift
Draft

[Swift] Respect Retry-After for preload throttling#660
markmur wants to merge 1 commit into
mainfrom
preload-retry-after-swift

Conversation

@markmur

@markmur markmur commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What changes are you making?

  • Parse Retry-After delay-seconds and HTTP-date response headers.
  • Add a managed preload throttle policy by default: a 429 with a valid Retry-After value returns a throttled failure and suppresses explicit preload calls until the delay elapses.
  • Add a passthrough policy that returns the existing HTTP failure with retryAfter metadata and applies no cooldown.
  • Expose retryAfter on presentation CheckoutError values without changing presentation behavior.
  • Document the policies and update the public Swift API baseline.

Checkout Kit never retries a throttled preload automatically, and preload cooldowns never block presentation.

Before you merge

  • I have added tests to support my implementation.
  • I have updated the Swift README.

RetryAfterTests, ConfigurationTests, PreloadObservabilityTests, CheckoutWebViewTests, the Swift public API check, SwiftLint, and SwiftFormat pass. CocoaPods lint could not run because the local Ruby bundle is missing installed gems.

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Aug 17, 2026

markmur commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@markmur
markmur force-pushed the preload-retry-after-swift branch from 480a13c to 65b6a5a Compare August 18, 2026 10:57
@markmur markmur changed the title [Swift] Expose Retry-After on HTTP failures [Swift] Respect Retry-After for preload throttling Aug 18, 2026
@markmur markmur self-assigned this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant