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 }