fix(billing): count the grace period in calendar days #155
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#155
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 grace end is
periodEnd + 8 * DAY_MSin milliseconds (src/billing.ts, intoStatusforgraceEndsAtand inisDuein the sweep).periodEndis 1 ms before Amsterdam midnight. Across the last Sunday of March a day has 23 hours, so the sum lands at 00:59:59.999 the next day.Failing case: a period ends on 25 March. The grace should end at the end of 2 April. It ends at 00:59:59.999 on 3 April, so the portal shows 3 April and access ends almost an hour late. Periods that end about 22 to 28 March are affected. The October change errs early by one hour, still on the right day.
Fix: count the grace in calendar days. Amsterdam midnight of the period-end day plus 9 days, minus 1 ms. Use the same helper at both call sites. Add a test with a period that ends on 25 March.