feat(billing): wire pruneDeadTokens into onEntitlementChanged

This commit is contained in:
null 2026-06-30 23:35:38 -05:00
parent c7181e276f
commit 7b5790da43
1 changed files with 2 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
import { pruneDeadTokens } from '../notifications/pruneTokens'
/**
* Notifies the OTHER partner when a user GAINS premium, so couple-shared premium unlock isn't silent
@ -110,5 +111,6 @@ export const onEntitlementChanged = functions.firestore
console.warn(`[onEntitlementChanged] send failed ${tokens[i]}: ${String(r.reason)}`)
}
})
await pruneDeadTokens(db, partnerId, tokens, results)
console.log(`[onEntitlementChanged] notified ${partnerId} of couple premium (${coupleId})`)
})