From 7b5790da431cc08bd2ae127f3bff5b0fad4e04a0 Mon Sep 17 00:00:00 2001 From: null Date: Tue, 30 Jun 2026 23:35:38 -0500 Subject: [PATCH] feat(billing): wire pruneDeadTokens into onEntitlementChanged --- functions/src/billing/onEntitlementChanged.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/src/billing/onEntitlementChanged.ts b/functions/src/billing/onEntitlementChanged.ts index bfd49349..77498472 100644 --- a/functions/src/billing/onEntitlementChanged.ts +++ b/functions/src/billing/onEntitlementChanged.ts @@ -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})`) })