Merged
Conversation
Member
Author
|
@cubic-dev-ai re-review |
Contributor
@mogery I've started the AI code review. It'll take a few minutes to complete. |
| } | ||
| }); | ||
| } catch (error) { | ||
| logger.error(`Failed to acquire lock for auto-recharge`, { error }); |
Contributor
There was a problem hiding this comment.
Misleading error message: this catch can capture non-lock errors from within the critical section; use a generic message to aid debugging.
Prompt for AI agents
Address the following comment on apps/api/src/services/billing/auto_charge.ts at line 320:
<comment>Misleading error message: this catch can capture non-lock errors from within the critical section; use a generic message to aid debugging.</comment>
<file context>
@@ -34,10 +38,307 @@ export async function autoCharge(
+ }
+ });
+ } catch (error) {
+ logger.error(`Failed to acquire lock for auto-recharge`, { error });
+ return {
+ success: false,
</file context>
Suggested change
| logger.error(`Failed to acquire lock for auto-recharge`, { error }); | |
| logger.error(`Auto-recharge failed`, { error }); |
| team_id, | ||
| auto_recharge: "true", | ||
| }, | ||
| ...(discount.coupon.percent_off |
Contributor
There was a problem hiding this comment.
Duplicate percent_off key in coupons.create; the latter overrides the former and may mask the intended value. Remove one of the definitions.
Prompt for AI agents
Address the following comment on apps/api/src/services/billing/stripe.ts at line 132:
<comment>Duplicate percent_off key in coupons.create; the latter overrides the former and may mask the intended value. Remove one of the definitions.</comment>
<file context>
@@ -57,3 +62,120 @@ export async function createPaymentIntent(
+ team_id,
+ auto_recharge: "true",
+ },
+ ...(discount.coupon.percent_off
+ ? { percent_off: discount.coupon.percent_off }
+ : {}),
</file context>
Member
Author
|
@cubic-dev-ai re-review |
Contributor
@mogery I've started the AI code review. It'll take a few minutes to complete. |
0cea50a to
8fc4aab
Compare
nickscamara
approved these changes
Sep 11, 2025
93810b8 to
cf87838
Compare
cf87838 to
9a77409
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary by cubic
Adds enterprise auto‑recharge that creates a Stripe subscription to top up credits when teams drop below a threshold, driven by ACUC.price_associated_auto_recharge_price_id. Addresses ENG-3429 with a safe, locked flow, notifications, and cache refresh.
New Features
Dependencies