Invoice.paid reactivates all inactive paid relays, including manually deactivated relays #8

Closed
opened 2026-04-13 11:58:29 +00:00 by userAdityaa · 0 comments
Contributor

Description

When Stripe sends invoice.paid, the recovery logic reactivates every inactive paid relay for that tenant, not only relays deactivated due to non-payment.

Because relay state stores only active/inactive (no deactivation reason/source), manually deactivated relays are indistinguishable and get reactivated unexpectedly.

Primary Logic: billing.rs

Supporting State Model (no reason field): 0001_init.sql

Expected

Only relays deactivated specifically due to billing/non-payment should be auto-reactivated after payment.

Actual

All inactive paid relays are reactivated, including user-intentional manual deactivations.

Small code evidence

let relays = self.query.list_relays_for_tenant(&tenant.pubkey).await?;
for relay in relays {
    if relay.status == "inactive" && relay.plan != "free" {
        self.command.activate_relay(&relay).await?;
    }
}
### Description When Stripe sends invoice.paid, the recovery logic reactivates every inactive paid relay for that tenant, not only relays deactivated due to non-payment. Because relay state stores only active/inactive (no deactivation reason/source), manually deactivated relays are indistinguishable and get reactivated unexpectedly. **Primary Logic:** `billing.rs` **Supporting State Model (no reason field):** `0001_init.sql` ### Expected Only relays deactivated specifically due to billing/non-payment should be auto-reactivated after payment. ### Actual All inactive paid relays are reactivated, including user-intentional manual deactivations. ### Small code evidence ```rs let relays = self.query.list_relays_for_tenant(&tenant.pubkey).await?; for relay in relays { if relay.status == "inactive" && relay.plan != "free" { self.command.activate_relay(&relay).await?; } } ```
userAdityaa changed title from `Iinvoice.paid` reactivates all inactive paid relays, including manually deactivated relays to `Invoice.paid` reactivates all inactive paid relays, including manually deactivated relays 2026-04-13 11:58:45 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coracle/caravel#8