Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(async-stripe-core): Create newtype for idempotency key #668

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

robko23
Copy link

@robko23 robko23 commented Feb 9, 2025

idempotency key cannot be empty and cannot be longer than 255 characters and having asserts before their usage is not the best error handling strategy. having it in a newtype guarantees that every use of this key is valid and no assert or runtime panic is needed.

Refs: #662 (comment)
Refs: #662 (comment)
Refs: https://docs.stripe.com/api/idempotent_requests

@arlyon
Copy link
Owner

arlyon commented Feb 19, 2025

CI approved, you may need to rebase this however

idempotency key cannot be empty and cannot be longer than 255 characters
and having asserts before their usage is not the best error handling
strategy. having it in a newtype guarantees that every use of this key
is valid and no assert or runtime panic is needed.

Refs: arlyon#662 (comment)
Refs: arlyon#662 (comment)
Refs: https://docs.stripe.com/api/idempotent_requests
Signed-off-by: Robin Ilyk <[email protected]>
@robko23 robko23 force-pushed the req_strategy_newtype branch from 52c3f04 to 7058333 Compare February 20, 2025 07:36
@robko23
Copy link
Author

robko23 commented Feb 20, 2025

@arlyon @mzeitlin11 rebased on 4dbe007 and fixed the lint about # Errors docs section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants