From 62f76290fbb6d4cd689a92637769a8ba99591df1 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 8 Oct 2026 07:38:43 -0400 Subject: [PATCH] fix(android): split notification kinds out of the replayer's dispatch (detekt) dispatch reached cyclomatic complexity 16 with the three M489 kinds; they now share one entry that hands off to dispatchNotification. Co-Authored-By: Claude Opus 5.5 --- .../minstrel/cache/mutations/MutationReplayer.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/cache/mutations/MutationReplayer.kt b/android/app/src/main/java/com/fabledsword/minstrel/cache/mutations/MutationReplayer.kt index 73891906..dbe5293e 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/cache/mutations/MutationReplayer.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/cache/mutations/MutationReplayer.kt @@ -174,10 +174,19 @@ class MutationReplayer @Inject constructor( MutationKind.PLAYBACK_ERROR_REPORT -> dispatchPlaybackErrorReport(row.payload) MutationKind.SUGGESTION_SNOOZE_TOGGLE -> dispatchSuggestionSnoozeToggle(row.payload) MutationKind.NORMALIZATION_SET -> dispatchNormalizationSet(row.payload) + MutationKind.NOTIFICATION_READ, + MutationKind.NOTIFICATIONS_READ_ALL, + MutationKind.NOTIFICATION_SETTING_SET, + -> dispatchNotification(row) + // Unknown kind — drop so a stale schema entry can't wedge the queue. + else -> Outcome.DROP + } + + /** The notifications inbox's kinds (M489), split out to keep [dispatch] simple. */ + private suspend fun dispatchNotification(row: CachedMutationEntity): Outcome = when (row.kind) { MutationKind.NOTIFICATION_READ -> dispatchNotificationRead(row.payload) MutationKind.NOTIFICATIONS_READ_ALL -> dispatchNotificationsReadAll(row.payload) MutationKind.NOTIFICATION_SETTING_SET -> dispatchNotificationSettingSet(row.payload) - // Unknown kind — drop so a stale schema entry can't wedge the queue. else -> Outcome.DROP }