First period end is one day before the first provider charge #163
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-payment#163
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
The first period of an auto-renewing subscription ends one day before the provider's first charge.
Seen on staging, 2026-10-12. Monthly card checkout paid at 18:19 UTC.
addInterval(paidAt)= 2026-11-12 18:19 UTC (src/billing.ts, the paid-checkout path).startDateandnextPaymentDate2026-11-13, fromrenewalStartDate(periodEnd).Renewals after the first are aligned:
renewalPeriodEndends the period 1 ms before Amsterdam midnight of the charge day. Only the first period breaks that rule, which the web portal relies on (src/lib/renewal.tsin bitborg-web: "1 ms before the next charge day").Impact: no access loss, because auto-renewing rows get the 8-day grace. The shown renewal date and any reminder dated from the period end are one day early.
Fix: for
renewal = "auto", end the first period atamsterdamMidnight(renewalStartDate(addInterval(paid))) - 1, the same rule asrenewalPeriodEnd. Add a test that the first period end plus 1 ms falls on the subscription'sstartDatein Amsterdam time.