Repository navigation
Conversation
The key is reused on 429 and 409 IDEMPOTENCY_KEY_IN_USE retries and is exposed on SeatsioException, so a caller can retry an operation with the same key via Client.with_idempotency_key, which only accepts v4 UUIDs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…io-python # Conflicts: # tests/testErrorHandling.py # tests/testExponentialBackoff.py
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The idempotency changes have no active review issues.
No open issues 🎉
What changed in this PR
Adds idempotency support to the seats.io Python client so mutating requests can be retried with the same key. Server-side replay protection requires idempotency to be enabled for the company.
Changes:
- Adds UUID v4 keys to POST, PUT, and DELETE requests, reusing them for retries after 429 and
409 IDEMPOTENCY_KEY_IN_USEresponses. - Exposes request keys on exceptions and adds keyed clients for manual retries.
- Adds HTTP transport tests and documents idempotency usage and limitations.
| File | Description |
|---|---|
tests/testIdempotencyKey.py |
Tests key generation, validation, propagation, and retry reuse. |
tests/httpbin.py |
Adds a configurable HTTP echo-server URL helper. |
seatsio/httpClient.py |
Adds idempotency headers, PUT support, and retryable conflict handling. |
seatsio/exceptions.py |
Exposes idempotency keys and supports string-based exception construction. |
seatsio/client.py |
Creates keyed clients with rebuilt service clients. |
README.md |
Documents idempotency and corrects exception property names. |
Review effort: Balanced
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.
Each mutating request gets a generated v4 UUID in the Idempotency-Key
header. The same key is reused when the request is retried after a 429
or a 409 IDEMPOTENCY_KEY_IN_USE.
SeatsioException now exposes the key (idempotency_key), so a caller can
retry an operation with the same key via Client.with_idempotency_key,
which only accepts v4 UUIDs.
Also adds PUT request support to the HTTP client, tests against httpbin,
a README section, and fixes the attribute names in the README's error
handling example.