Closer/functions/dist/couples
null 6681bf1518 refactor(functions): B2 migrate 8 scheduled functions to v2 + harden
Migrate all scheduled jobs off functions.pubsub.schedule().onRun() to
firebase-functions/v2/scheduler onSchedule({ schedule, timeZone, ...opts }, handler):
sendChallengeDayReminders, unlockDueMemoryCapsules, sendDailyQuestionProactiveReminder,
sendStreakReminder, sendReengagementReminder, assignDailyQuestion (scheduled export),
aggregateOutcomeStats, scheduledOutcomesReminder.

Hardening folded in:
- Fan-out isolation: Promise.all → Promise.allSettled in dailyQuestionReminder (outer+inner),
  reengagement, gameRetention (both jobs), scheduledOutcomesReminder — one bad couple can no
  longer abort a whole run. streakReminder / assignDailyQuestion already isolated.
- Resource options: assignDailyQuestion + aggregateOutcomeStats memory 512MiB + timeout 300s
  (they iterate all couples); the four fan-out reminders get timeout 180s.
- Adopt shared sendPushToUser()/logger everywhere; remove five copied getUserTokens() and the
  copied send/prune blocks (no plaintext token logging remains here).
- Consolidate duplicated date/time helpers into notifications/time.ts (chicagoDateKey, toMillis),
  replacing streakReminder's + scheduledOutcomesReminder's per-file copies.

assignDailyQuestion.ts callable export stays v1 for now (migrates in B3); its tested CST helpers
are untouched. Scanner pagination for assignDailyQuestion/aggregateOutcomes is deferred to B6.

Build clean; 70 tests green (tested pure helpers preserved). dist rebuilt. Still on v5.1.1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 23:50:59 -05:00
..
acceptInviteCallable.js chore(functions): rebuild dist with pruneDeadTokens wired into all 19 push sites 2026-06-30 23:45:42 -05:00
acceptInviteCallable.js.map refactor(functions): type callable payloads instead of `any` 2026-07-06 22:06:45 -05:00
aggregateOutcomes.js refactor(functions): B2 migrate 8 scheduled functions to v2 + harden 2026-07-07 23:50:59 -05:00
aggregateOutcomes.js.map refactor(functions): B2 migrate 8 scheduled functions to v2 + harden 2026-07-07 23:50:59 -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 build(functions): rebuild dist from source — revenueCatWebhook ack-after-process, acceptInvite strict E2EE, onMessageWritten conversations path, onGameSessionUpdate both-partner notify 2026-06-24 16:15:30 -05:00
createInviteCallable.js.map refactor(functions): type callable payloads instead of `any` 2026-07-06 22:06:45 -05:00
leaveCoupleCallable.js build(functions): rebuild dist from source — revenueCatWebhook ack-after-process, acceptInvite strict E2EE, onMessageWritten conversations path, onGameSessionUpdate both-partner notify 2026-06-24 16:15:30 -05:00
leaveCoupleCallable.js.map build(functions): rebuild dist from source — revenueCatWebhook ack-after-process, acceptInvite strict E2EE, onMessageWritten conversations path, onGameSessionUpdate both-partner notify 2026-06-24 16:15:30 -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 security: App Check enforcement on all callables, fail-closed device integrity, no raw code in logs; release signing config; iOS RevenueCat log level 2026-06-23 10:56:42 -05:00
submitOutcomeCallable.js.map refactor(functions): type callable payloads instead of `any` 2026-07-06 22:06:45 -05:00