Closer/functions/src
null f2321d3536 fix(functions): server-authoritative, mode-aware, deterministic daily question
Replace pickRandomQuestionId (empty pool → unresolvable q_default_daily fallback)
with pickDailyQuestionId(date): computes today's weekday mode (mirrors the client
DailyModeResolver.DOW_DEFAULTS, FROZEN) and deterministically indexes the free
daily pool by epochDay % poolSize — the SAME question the free client would pick,
now assigned server-side.

Fixes two things at the root:
- The daily 'questions' pool was empty, so every couple got q_default_daily, which
  the client can't resolve → each device fell back to its own local selection
  (the DQ-MISMATCH-001 class; the client half was pinned to the free pool in C1).
- Partners in different time zones computed different device-local weekdays and got
  different questions; a single server-assigned id makes both devices identical.

Firestore 'questions' seeded with the 75 free daily_fun_mc weekday questions (ids
match the client asset DB so getQuestionById resolves them). Pool fetched once and
filtered in memory — no composite index needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 21:57:22 -05:00
..
backup feat(backup): wire pruneDeadTokens into onRestoreRequested 2026-06-30 23:34:26 -05:00
billing feat(billing): wire pruneDeadTokens into onEntitlementChanged 2026-06-30 23:35:38 -05:00
couples refactor(functions): type callable payloads instead of `any` 2026-07-06 22:06:45 -05:00
dates feat: date reflection reveal, UI upgrade plan, seed updates, ime-scan script 2026-07-01 04:12:58 -05:00
games feat(games): nudge + per-game copy + score a11y batch C4 from UX review 2026-07-07 21:50:39 -05:00
notifications feat(notifications): wire pruneDeadTokens into streakReminder 2026-06-30 23:45:31 -05:00
questions fix(functions): server-authoritative, mode-aware, deterministic daily question 2026-07-07 21:57:22 -05:00
releaseKey refactor(functions): type callable payloads instead of `any` 2026-07-06 22:06:45 -05:00
security 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
users feat(users): wire pruneDeadTokens into onUserDelete 2026-06-30 23:45:36 -05:00
index.ts feat(functions): privacy-safe outcome-stat aggregation 2026-07-06 21:06:57 -05:00