Description
While comparing the DB providers, I noticed the getLatestAlarm method in firestore_provider.dart has identical code in both its if (wantNextAlarm) and else branches .. both add + 1 to the current minute.
Because both branches do the exact same thing, passing wantNextAlarm: false yields the same behavior as wantNextAlarm: true.
Tho the isar_provider.dart version of this same method implements this correctly , its else branch uses the current minute without the
+ 1 offset
Affected Code
lib/app/data/providers/firestore_provider.dart, line 197:
} else {
nowInMinutes = Utils.timeOfDayToInt(TimeOfDay(
hour: TimeOfDay.now().hour,
minute: TimeOfDay.now().minute + 1, // ❌ should not have + 1
));
}
Fix
I can just remove the + 1 from the else branch so it matches the expected behavior (and the Isar provider's behavior).
Description
While comparing the DB providers, I noticed the
getLatestAlarmmethod infirestore_provider.darthas identical code in both itsif (wantNextAlarm)andelsebranches .. both add+ 1to the current minute.Because both branches do the exact same thing, passing
wantNextAlarm: falseyields the same behavior aswantNextAlarm: true.Tho the
isar_provider.dartversion of this same method implements this correctly , itselsebranch uses the current minute without the+ 1offsetAffected Code
lib/app/data/providers/firestore_provider.dart, line 197:Fix
I can just remove the + 1 from the else branch so it matches the expected behavior (and the Isar provider's behavior).