ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend

Idempotency key for expensive POST requests

Open
#618 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
18
Forks
10
Avg merge
2d 20h
Merged PRs (30d)
14

Description

Is your feature request related to a problem? Please describe.
Clients retrying POST actions is bad especially when it's expensive like in documents.

Describe the solution you'd like
To overcome processing expensive duplicate requests, we can introduce an idempotency_key in requests which clients can use to retry. This idempotency_key needs to be stored against the relevant entity, so when users/clients retries creating the same entity, entity creation can be skipped and the API can just return the already existing entity.

Additional context
See Stripe's API docs - https://docs.stripe.com/api/idempotent_requests

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating the POST handlers and persistence model for the relevant entity, then read Stripe's idempotent requests documentation. Done means duplicate retries with the same key skip entity creation and return the existing entity.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.