Hu1buerger / medlog

5 stars 0 forks source link

[Bug] adding medicationintake to the log requires two commit actions. #33

Closed Hu1buerger closed 2 years ago

Hu1buerger commented 2 years ago

Issue on https://github.com/Hu1buerger/medlog/commit/9edc1c71c087abb236dc700766790c90e918ed91

Trace:

    #1      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
    #2      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
    #3      LogRepo._insert (package:medlog/src/repo/log/log_repo.dart:97:12)
    #4      LogRepo.addLogEvent (package:medlog/src/repo/log/log_repo.dart:83:5)
    #5      LogProvider.addMedicationIntake (package:medlog/src/repo/log/log_provider.dart:30:20)
    #6      _AddLogEntryState.commitIntake (package:medlog/src/presentation/add_entrys/add_log_entry.dart:107:19)
    #7      _AddLogEntryState.onCommitIntake (package:medlog/src/presentation/add_entrys/add_log_entry.dart:84:5)
    #8      _AddLogEntryState.build.<anonymous closure (package:medlog/src/presentation/add_entrys/add_log_entry.dart:333:32)
        [...]

With the issue being the https://github.com/Hu1buerger/medlog/blob/9edc1c71c087abb236dc700766790c90e918ed91/lib/src/repo/log/log_repo.dart#L77 Which is returning an id that is already contained in the log.