This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: detect and report lingering idempotency keys (#204)
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.
- Loading branch information
Showing
3 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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