-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
🇺🇸
After unsuccessful Enum/json read we should:
👍 quietly return default value
🎉 crash app being consistent with Fail-Fast rule
🚀 crash app only when BuildConfig.DEBUG == true
🇵🇱
Rozkmina dotyczy zachowania libki w przypadku migracji. Czy przy nieudanej próbie odczytania poprzednio zapisanej wartości, np. po zmianie Enuma/obiektu, powinniśmy:
👍 zwracać po cichu domyślną wartość
🎉 wywalać apkę wg zasady Fail-Fast
🚀 crashować apkę tylko przy BuildConfig.DEBUG == true
Aktualna implementacja zakłada 👍 opcję:
// Enum read
T::class.java.enumConstants.firstOrNull { it!!.name == enumName }
// Json read
try {
jsonAdapter.fromJson(getString(key, null)!!)
} catch (e: Exception) {
null
}Niestety nie specjalnie mam koncepcję jak sensownie zaimplementować wersję 🚀 z BuildConfig.DEBUG == true 😕
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed