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> |
||
|---|---|---|
| .. | ||
| dist | ||
| scripts | ||
| src | ||
| jest.config.js | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||