From 2aa08efd394cb6d4f949c08241fef677966c5d19 Mon Sep 17 00:00:00 2001 From: null Date: Tue, 30 Jun 2026 23:35:00 -0500 Subject: [PATCH] feat(dates): wire pruneDeadTokens into onDateHistoryCreated --- functions/src/dates/onDateHistoryCreated.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/src/dates/onDateHistoryCreated.ts b/functions/src/dates/onDateHistoryCreated.ts index 0c9af9b6..43ec9809 100644 --- a/functions/src/dates/onDateHistoryCreated.ts +++ b/functions/src/dates/onDateHistoryCreated.ts @@ -1,6 +1,7 @@ import * as functions from 'firebase-functions' import * as admin from 'firebase-admin' import { recipientInQuietHours } from '../notifications/quietHours' +import { pruneDeadTokens } from '../notifications/pruneTokens' /** * Fires when a date is logged as completed (`couples/{coupleId}/date_history/{dateId}` created). Nudges @@ -58,4 +59,5 @@ export const onDateHistoryCreated = functions.firestore results.forEach((r, i) => { if (r.status === 'rejected') console.warn(`[onDateHistoryCreated] FCM failed for ${tokens[i]}:`, r.reason) }) + await pruneDeadTokens(db, partnerId, tokens, results) })