fix(alarmas): decode native failures with the real channel key names
The first pass read 'alarmaId'/'tipo' from the channel payload while the native side sends 'alarmId'/'type'/'atMillis' (AlarmScheduler.kt:1389). Every entry would have been dropped silently in production. The tests passed because the fake was seeded with the same guessed keys, so they confirmed the mistake instead of catching it. Decoding now goes through FalloProgramacionNativo.fromMap -- the single place native key names appear -- and the fixtures build through that same constructor.
This commit is contained in:
@@ -556,10 +556,7 @@ class EstadoAlarmas extends ChangeNotifier {
|
||||
try {
|
||||
final fallos = await android.fallosNativosProgramacion();
|
||||
for (final fallo in fallos) {
|
||||
final alarmaId = fallo['alarmaId'] as String?;
|
||||
final tipo = fallo['tipo'] as String?;
|
||||
if (alarmaId == null || tipo == null) continue;
|
||||
await _registrarFalloProgramacion(alarmaId, tipo: tipo);
|
||||
await _registrarFalloProgramacion(fallo.alarmaId, tipo: fallo.tipo);
|
||||
}
|
||||
if (fallos.isNotEmpty) {
|
||||
debugPrint(
|
||||
|
||||
Reference in New Issue
Block a user