fix(#518): retire the old channel versions right after a sound pick

This commit is contained in:
makiolaj committed 2026-11-16 21:05:39 +01:00
1 parent d39ceb9ee0
commit 74549b2ec0
1 file changed
+9 -2
@@ -203,7 +203,7 @@ class ReminderChannels @Inject constructor(
/**
* Give [calendarIds]' reminders [sound] (null = silent). A channel's sound is
* fixed once created, so each moves to a new channel version carrying over
* everything else, and the old one retires on the next sync (#518). Calendars without a
* everything else, and the old one retires in the sync that follows (#518). Calendars without a
* channel are skipped unless [createMissing]. Returns whether every move
* went through.
*/
@@ -215,7 +215,14 @@ class ReminderChannels @Inject constructor(
.filter { reminderChannelId(it, current[it] ?: 0) in existingIds }
.associateWith { (current[it] ?: 0) + 1 }
if (floors.isEmpty()) return false
return recreate(settingsPrefs.reserveReminderChannelVersions(floors), sound)
val applied = recreate(settingsPrefs.reserveReminderChannelVersions(floors), sound)
// Retire the old versions now, or each calendar shows twice in system settings until the next scan.
try {
sync()
} catch (e: RuntimeException) {
Log.w(TAG, "Old channel versions left to the next sync", e)
}
return applied
}
/**