msupply-foundation / msupply-cold-chain

Android application for viewing and monitoring temperatures of fridges
GNU General Public License v3.0
3 stars 3 forks source link

Breaches are not saved to open mSupply #275

Closed mark-prins closed 10 months ago

mark-prins commented 10 months ago

Describe the bug When a breach begins, the breach is not saved to open mSupply. Instead the log shows

2023-12-06 10:29:20.993183000 [ERROR] <server::cold_chain::temperature_breach:106>:"No temperature logs found for the breach id `e075412a-91ba-4f67-a483-a5cef9ee0351`" TemperatureBreach { id: "e075412a-91ba-4f67-a483-a5cef9ee0351", acknowledged: false, end_unix_timestamp: None, sensor_id: "cbf67be6-10fe-4cc9-81e6-1610b3642937", start_unix_timestamp: 1701811552, threshold_duration_milliseconds: 120000, threshold_maximum: 999.0, threshold_minimum: 20.0, type: HotConsecutive }
2023-12-06 10:29:20.994771000 [INFO] <actix_web::middleware::logger:351>:192.168.178.172 "PUT /coldchain/v1/temperature-breach HTTP/1.1" 200 187 "-" "okhttp/3.12.12" 0.065991

Noticed when investigating #2537

To Reproduce Steps to reproduce the behavior:

  1. for a sensor that is not in breach, configure sync with omSupply and breach settings as needed
  2. either warm or cool the sensor for long enough to start a breach
  3. observer that the logs show in oms, but the breach does not

Expected behavior The breach should be recorded

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

mark-prins commented 10 months ago

Fixed with #2589

AnushaUp commented 8 months ago

PASSED Screenshot_20240202_100746_openmsupply-client