Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/services/ProductStripeService.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class ProductStripeService {
}

// Create Stripe prices for each combination
for (const combo of combinations) {
await Promise.all(combinations.map(async (combo) => {
const stripePrice = await this.stripe.createPrice({
Comment on lines 93 to 95
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit concurrent Stripe price creation to avoid rate limits

Because this now fires all createPrice requests at once, products with many variant combinations can easily exceed Stripe’s API rate limits and fail the whole Promise.all (whereas the previous sequential loop would typically succeed, just slower). This regression appears when variant counts are large enough to trigger throttling. Consider adding a concurrency limit (e.g., a small pool) or a retry/backoff strategy for createPrice calls.

Useful? React with 👍 / 👎.

amount: combo.price,
currency: productData.currency,
Expand All @@ -118,7 +118,7 @@ export class ProductStripeService {
} else if (combo.variant2) {
variantPrices[combo.variant2.id] = stripePrice.id
}
}
}))

// Also create base price for fallback
basePrice = await this.stripe.createPrice({
Expand Down