mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-30 21:01:54 +08:00
<!--
Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/hexclave/hexclave/blob/dev/CONTRIBUTING.md
-->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Speed up the Usage page by aggregating metered usage across owned
projects/tenancies with fewer queries and new indexes. Adds E2E tests to
verify team-owned rollups and calendar‑month windows.
- **Performance**
- Added concurrent indexes for `EmailOutbox(tenancyId,
startedSendingAt)` and `SessionReplay(tenancyId, startedAt)`; updated
Prisma schema.
- Group tenancies by (DB client, schema) and run one SQL per group that
counts both emails and session replays; uses `mapWithConcurrency` from
`@hexclave/shared` (concurrency 4, aborts on first error).
- Added helpers `getOwnedProjectAndTenancyIdsForBillingTeam` and
`getNonAnonymousUserCountForTenancies`; made `mapWithConcurrency`
null‑safe with bounds checks.
- **Tests**
- Added E2E tests for the internal plan-usage endpoint covering
team-owned rollups, calendar‑month boundaries, and zero‑usage cases.
- Added unit tests for ownership scope resolution and non‑anonymous user
counting.
<sup>Written for commit
|
||
|---|---|---|
| .. | ||
| payments | ||
| projects | ||
| api-keys.test.ts | ||
| changelog.test.ts | ||
| component-versions.test.ts | ||
| config-local-emulator.test.ts | ||
| config.test.ts | ||
| email-drafts.test.ts | ||
| email-queue-step.test.ts | ||
| email-templates-create.test.ts | ||
| email-templates.test.ts | ||
| email.test.ts | ||
| failed-emails-digest.test.ts | ||
| feedback.test.ts | ||
| local-emulator-project.test.ts | ||
| managed-email-onboarding.test.ts | ||
| mcp.test.ts | ||
| plan-usage.test.ts | ||
| projects.test.ts | ||
| send-test-email.test.ts | ||
| sign-up-rules-stats.test.ts | ||
| sign-up-rules-test.test.ts | ||
| transactions-refund.test.ts | ||
| transactions.test.ts | ||
| wysiwyg-edit.test.ts | ||