feat(notifications): wire pruneDeadTokens into streakReminder

This commit is contained in:
null 2026-06-30 23:45:31 -05:00
parent 40e4f48131
commit 2488e18790
1 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import * as functions from 'firebase-functions' import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin' import * as admin from 'firebase-admin'
import { recipientInQuietHours } from './quietHours' import { recipientInQuietHours } from './quietHours'
import { pruneDeadTokens } from './pruneTokens'
/** /**
* Streak reminder an evening "don't lose your streak" nudge. * 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) 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). */ /** YYYY-MM-DD for the given instant in America/Chicago (DST-safe; en-CA gives ISO date order). */