Closer/functions/dist
null eb4bab0b90 perf(functions): B6b bound the unbounded couple scanners (#10)
assignDailyQuestion and aggregateOutcomeStats previously did an unbounded
db.collection('couples').get() (loading every couple into memory), and aggregate did a
serial outcomes.get() per couple (O(couples) round-trips). Both now paginate the couple
scan (orderBy __name__ + startAfter, 300/200 per page — no custom index needed):

- assignDailyQuestion: each page's create() writes fan out with the burst bounded to a page
  instead of all couples at once; ALREADY_EXISTS stays the idempotent no-op.
- aggregateOutcomeStats: reads each page's outcomes in parallel instead of serially.
  couples.length still counts every couple, so the aggregate windows + totalCouples are
  unchanged (pure aggregate() helper and its tests untouched).

This is the one behavior-touching improvement flagged in the plan; the 512MiB/300s resource
options from B2 remain the safety net. Build clean; 70 tests green. dist rebuilt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 00:05:32 -05:00
..
backup refactor(functions): B1 migrate 13 Firestore triggers to v2 + harden 2026-07-07 23:46:17 -05:00
billing refactor(functions): B4+B5 migrate webhook to v2 + pin onUserDelete on v1 2026-07-08 00:00:29 -05:00
couples perf(functions): B6b bound the unbounded couple scanners (#10) 2026-07-08 00:05:32 -05:00
dates refactor(functions): B1 migrate 13 Firestore triggers to v2 + harden 2026-07-07 23:46:17 -05:00
games refactor(functions): B1 migrate 13 Firestore triggers to v2 + harden 2026-07-07 23:46:17 -05:00
notifications refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
questions perf(functions): B6b bound the unbounded couple scanners (#10) 2026-07-08 00:05:32 -05:00
releaseKey refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
security refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
users refactor(functions): B4+B5 migrate webhook to v2 + pin onUserDelete on v1 2026-07-08 00:00:29 -05:00
index.js refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
index.js.map refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
log.js build(functions): B0 v2 foundation — global options, shared push helper, structured logging 2026-07-07 23:36:16 -05:00
log.js.map build(functions): B0 v2 foundation — global options, shared push helper, structured logging 2026-07-07 23:36:16 -05:00
options.js build(functions): B0 v2 foundation — global options, shared push helper, structured logging 2026-07-07 23:36:16 -05:00
options.js.map build(functions): B0 v2 foundation — global options, shared push helper, structured logging 2026-07-07 23:36:16 -05:00