From 46010508a9ec42f53c55f6918c8a678ca1b0aa1c Mon Sep 17 00:00:00 2001 From: null Date: Thu, 25 Jun 2026 10:14:16 -0500 Subject: [PATCH] fix(notifications): route partner_left/partner_deleted_account to Home (E-002 P3) Added PARTNER_UNPAIRED type for the two real 'you are unpaired' pushes -> Home, where the now-solo user gets the Invite CTA (matches body 'Tap to create a new invite'). Documented that invite_created (server audit log, read:true) and spki (a crypto key-format string in the RevenueCat webhook, not a notification) are false positives needing no routing. Co-Authored-By: Claude Opus 4.8 --- .../notifications/PartnerNotificationManager.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/main/java/app/closer/notifications/PartnerNotificationManager.kt b/app/src/main/java/app/closer/notifications/PartnerNotificationManager.kt index 2105102b..e86640ac 100644 --- a/app/src/main/java/app/closer/notifications/PartnerNotificationManager.kt +++ b/app/src/main/java/app/closer/notifications/PartnerNotificationManager.kt @@ -250,6 +250,15 @@ enum class PartnerNotificationType( body = "Tonight's question is a good reason to reconnect.", channelId = NotificationChannelSetup.CHANNEL_REMINDERS, rateType = NotificationRateLimiter.Type.REMINDER + ), + // Partner left the couple or deleted their account — the user is now unpaired. + // Routed to Home, which surfaces the "Invite partner" CTA for the now-solo user + // (matches the push body "Tap to create a new invite"). E-002. + PARTNER_UNPAIRED( + title = "You're no longer paired.", + body = "Tap to create a new invite.", + channelId = NotificationChannelSetup.CHANNEL_PARTNER_ACTIONS, + rateType = NotificationRateLimiter.Type.PARTNER_TRIGGER ); /** @@ -275,6 +284,7 @@ enum class PartnerNotificationType( PARTNER_JOINED -> if (coupleId.isNotBlank()) AppRoute.pairingSuccess(coupleId) else AppRoute.HOME DATE_MATCH -> AppRoute.DATE_MATCHES REENGAGEMENT -> AppRoute.DAILY_QUESTION + PARTNER_UNPAIRED -> AppRoute.HOME } companion object { @@ -298,6 +308,10 @@ enum class PartnerNotificationType( "partner_joined" -> PARTNER_JOINED "date_match" -> DATE_MATCH "reengagement" -> REENGAGEMENT + "partner_left", "partner_deleted_account" -> PARTNER_UNPAIRED + // NB: "invite_created" is a server-side audit-log entry (read:true, never sent + // as a push) and "spki" is a crypto key-format string in the RevenueCat webhook + // (not a notification type at all) — neither needs client routing. E-002. else -> null } }