Closer/functions
null 4c077c4d7c refactor(functions): B6c split game part-finished trigger + reorder reads (#11)
Split the single broad onGamePartFinished (couples/{coupleId}/{gameType}/{sessionId}
wildcard, which fired a no-op invocation on every write to ANY couple subcollection) into
four narrow, explicitly-pathed triggers sharing one handler:
onThisOrThatPartFinished, onWheelPartFinished, onHowWellPartFinished, onDesireSyncPartFinished.
Behavior is identical for the four game collections; the spurious invocations for
messages/reactions/etc. are eliminated. (Background triggers have no client name dependency;
the old export is dropped and the four deploy fresh — the deploy runbook already accounts for
this.)

onGameSessionUpdate: move the `!change.after.exists` deletion guard ABOVE its four reads
(session/couple/userA/userB) so a delete/no-op event returns before doing any reads. The
delicate exactly-once claim-flag logic is otherwise untouched.

Build clean; 70 tests green. Discovery loads all four split triggers as v2 in us-central1
(36 functions total); old onGamePartFinished gone. dist rebuilt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 00:08:18 -05:00
..
dist refactor(functions): B6c split game part-finished trigger + reorder reads (#11) 2026-07-08 00:08:18 -05:00
scripts feat(dates): Firestore-backed date catalog + sponsored ideas 2026-07-06 21:02:22 -05:00
src refactor(functions): B6c split game part-finished trigger + reorder reads (#11) 2026-07-08 00:08:18 -05:00
jest.config.js fix: test infrastructure and entitlement logic updates 2026-06-17 21:08:13 -05:00
package-lock.json build(functions): B6a bump firebase-functions to v7 (latest) 2026-07-08 00:03:17 -05:00
package.json build(functions): B6a bump firebase-functions to v7 (latest) 2026-07-08 00:03:17 -05:00
tsconfig.json feat(billing): server-side entitlement sync — RevenueCat webhook handler, entitlement logic, Firestore EntitlementChecker, Hilt DI, callable sync function (batch 10) 2026-06-17 01:25:51 -05:00