From f55c49010d9d763eed6d7960e5e051c862ae6502 Mon Sep 17 00:00:00 2001 From: null Date: Tue, 30 Jun 2026 23:36:09 -0500 Subject: [PATCH] feat(notifications): wire pruneDeadTokens into sendThinkingOfYouCallable --- functions/src/notifications/sendThinkingOfYouCallable.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/src/notifications/sendThinkingOfYouCallable.ts b/functions/src/notifications/sendThinkingOfYouCallable.ts index fa4d7cbc..d06169dc 100644 --- a/functions/src/notifications/sendThinkingOfYouCallable.ts +++ b/functions/src/notifications/sendThinkingOfYouCallable.ts @@ -1,6 +1,7 @@ import * as functions from 'firebase-functions' import * as admin from 'firebase-admin' import { recipientInQuietHours } from './quietHours' +import { pruneDeadTokens } from './pruneTokens' const THINKING_OF_YOU_MAX_PER_DAY = 10 const THINKING_OF_YOU_WINDOW_MS = 24 * 60 * 60 * 1000 // rolling 24h @@ -114,6 +115,7 @@ export const sendThinkingOfYouCallable = functions.https.onCall(async (_data, co console.warn(`[sendThinkingOfYouCallable] FCM failed for token ${tokens[i]}:`, r.reason) } }) + await pruneDeadTokens(db, partnerId, tokens, results) } console.log(`[sendThinkingOfYouCallable] sent from ${callerId} to ${partnerId} in couple ${coupleId}`)