Closer/functions/dist/couples
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
..
acceptInviteCallable.js refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
acceptInviteCallable.js.map refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
aggregateOutcomes.js perf(functions): B6b bound the unbounded couple scanners (#10) 2026-07-08 00:05:32 -05:00
aggregateOutcomes.js.map perf(functions): B6b bound the unbounded couple scanners (#10) 2026-07-08 00:05:32 -05:00
aggregateOutcomes.test.js build(functions): compile dist for outcome aggregation 2026-07-06 21:10:02 -05:00
aggregateOutcomes.test.js.map build(functions): compile dist for outcome aggregation 2026-07-06 21:10:02 -05:00
createInviteCallable.js refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
createInviteCallable.js.map refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
leaveCoupleCallable.js refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
leaveCoupleCallable.js.map refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
onCoupleLeave.js refactor(functions): B1 migrate 13 Firestore triggers to v2 + harden 2026-07-07 23:46:17 -05:00
onCoupleLeave.js.map refactor(functions): B1 migrate 13 Firestore triggers to v2 + harden 2026-07-07 23:46:17 -05:00
scheduledOutcomesReminder.js refactor(functions): B2 migrate 8 scheduled functions to v2 + harden 2026-07-07 23:50:59 -05:00
scheduledOutcomesReminder.js.map refactor(functions): B2 migrate 8 scheduled functions to v2 + harden 2026-07-07 23:50:59 -05:00
submitOutcomeCallable.js refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00
submitOutcomeCallable.js.map refactor(functions): B3 migrate 12 callables to v2 + harden 2026-07-07 23:58:32 -05:00