Clearing the database should not remove the favorites, as this is likely to be a fix tried by many people if something in the app goes wrong, and favorites should not be lost then. Instead, after an update of all data in the UIS, favorites that are pointing to no longer existing events should be filtered out, i.e.,
events
.map { it.id }
.toSet()
.let {
eventIds -> faves = faves.filter { it in eventIds }
}
Clearing the database should not remove the favorites, as this is likely to be a fix tried by many people if something in the app goes wrong, and favorites should not be lost then. Instead, after an update of all data in the UIS, favorites that are pointing to no longer existing events should be filtered out, i.e.,