From 2488e187909a08c4f9892585a80db5bd7d6fa99d Mon Sep 17 00:00:00 2001 From: null Date: Tue, 30 Jun 2026 23:45:31 -0500 Subject: [PATCH] feat(notifications): wire pruneDeadTokens into streakReminder --- functions/src/notifications/streakReminder.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/src/notifications/streakReminder.ts b/functions/src/notifications/streakReminder.ts index 8430c596..d52d03e6 100644 --- a/functions/src/notifications/streakReminder.ts +++ b/functions/src/notifications/streakReminder.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' /** * Streak reminder — an evening "don't lose your streak" nudge. @@ -120,6 +121,8 @@ async function sendStreakNudge( console.warn(`[sendStreakReminder] FCM failed for token ${tokens[i]}:`, result.reason) } }) + + await pruneDeadTokens(db, userId, tokens, sendResults) } /** YYYY-MM-DD for the given instant in America/Chicago (DST-safe; en-CA gives ISO date order). */