Skip to content

Expose Retry-After on terminal 429 and 503 errors - #137

Open
Platformzus wants to merge 3 commits into
prooflinedev:mainfrom
Platformzus:expose-retry-after
Open

Platformzus wants to merge 3 commits into
prooflinedev:mainfrom
Platformzus:expose-retry-after

Conversation

@Platformzus

Copy link
Copy Markdown

Why

A CI job or background worker may need to defer a read after the SDK returns a 429 or 503. The transport already interprets Retry-After for its own retries, but callers lose the server's delay when the SDK returns an error. This is especially useful when the delay exceeds the SDK's 60-second automatic retry limit.

What changed

  • Both clients now expose ProoflineError.retry_after_seconds from the final HTTP 429 or 503 response. A missing or malformed hint yields None.
  • The existing delay parser handles delta-seconds and HTTP dates. The SDK still retries eligible reads within its existing limits and sends writes once.
  • The README defines the attribute and explains how callers can use it to schedule reads.

Verification

  • All 224 tests passed locally, including sync and async loopback coverage for long delays, malformed and absent headers, exhausted retries, and write errors.
  • Ruff, mypy, operation and outcome contract checks, and wheel and source builds passed.
  • The stock regeneration gate hit Windows checkout and encoding differences in unchanged generated files. This patch does not modify the public contract or generated code.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant