Skip to content

Commit 6e958c7

Browse files
committed
fix(billing): decouple Stripe scan page size from invoice display cap
1 parent 5ebcf93 commit 6e958c7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • apps/sim/app/api/billing/invoices

apps/sim/app/api/billing/invoices/route.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ const logger = createLogger('BillingInvoices')
1717
/** Cap the number of invoices returned to the most recent statements; the UI links out to Stripe's portal for the full history. */
1818
const MAX_INVOICES = 5
1919

20-
/** Stripe page size when scanning for finalized invoices; also bounds the has-more probe. */
21-
const STRIPE_PAGE_SIZE = MAX_INVOICES + 1
20+
/**
21+
* Stripe list page size when scanning for finalized invoices. Kept independent of
22+
* (and larger than) `MAX_INVOICES` so lowering the display cap never shrinks the
23+
* draft-scan window — a long tail of interspersed draft invoices could otherwise
24+
* bury finalized statements past the `MAX_STRIPE_PAGES` cap and hide the section.
25+
*/
26+
const STRIPE_PAGE_SIZE = 20
2227

2328
/** Safety cap on pagination when a customer has many draft invoices interspersed. */
2429
const MAX_STRIPE_PAGES = 5

0 commit comments

Comments
 (0)