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:
2026-07-31 23:27:45 +02:00
parent a8dca83cd9
commit f2528c930b
4 changed files with 39 additions and 28 deletions
+1 -4
View File
@@ -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(