Skip to content

Send an Idempotency-Key with every POST, PUT and DELETE - #174

Draft
schaloner wants to merge 2 commits into
masterfrom
steve/seats-1735-idempotent-requests-seatsio-python
Draft

schaloner wants to merge 2 commits into
masterfrom
steve/seats-1735-idempotent-requests-seatsio-python

Conversation

@schaloner

Copy link
Copy Markdown
Contributor

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.

Steve Chaloner and others added 2 commits November 16, 2026 20:40
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
Copilot AI balanced review requested due to automatic review settings November 19, 2026 12:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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_USE responses.
  • 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

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants