feat(notifications): wire pruneDeadTokens into streakReminder
This commit is contained in:
parent
40e4f48131
commit
2488e18790
|
|
@ -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). */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue