feat(dates): wire pruneDeadTokens into createDateMatch

This commit is contained in:
null 2026-06-30 23:34:56 -05:00
parent 342ca37e91
commit f8240e01a9
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
import { pruneDeadTokens } from '../notifications/pruneTokens'
/**
* Fires the "It's a match!" notification when a date match is created.
@ -60,7 +61,7 @@ async function notifyDateMatch(
const tokens = await getUserTokens(db, userId)
if (tokens.length === 0) return
await Promise.allSettled(
const results = await Promise.allSettled(
tokens.map((token) =>
admin.messaging().send({
token,
@ -77,6 +78,7 @@ async function notifyDateMatch(
})
)
)
await pruneDeadTokens(db, userId, tokens, results)
}
async function getUserTokens(