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). */