This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
api: detect and report lingering idempotency keys #204
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.
Stripe Idemptency Keys linger after a Test Mode data purge, causing
false positive responses from Stripe. One such scenario is creating a
customer using a deterministic Idempotency Key with a Tier orgID (e.g.
"create:customer:org:example") to suppress a duplicate request from a
dueling client. If after that key is created, and our Test Mode is
purged, we'll get a cached response back from Stripe telling us the
customer was created and give us the old response without actually
creating the customer in the now clean Test Mode. Using that customer ID
to create a subscription resulted in a "resource_not_found" error from
Stripe because the customer did not exist.
Tier now detects an error resulting from a lingering idempotency key
when creating a schedule for a customer that was thought to be created
just before attempting to create the schedule. The output should now be
more helpful.
This commit also introduces the new error code scheme with an error code
prefixed with ("TERR"). It is pronounced, "terror". Moving forward, all
new errors will have a TERR-code. This makes specific errors easier to
report and search for.