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

Sensor Data is lost when CCA is running in the background #288

Open marthakeezy opened 5 months ago

marthakeezy commented 5 months ago

Describe the bug Running CCA in the background overnight - when opened Grafana → CCA → omSupply, discovered one of the sensors lost ~ 10 hours worth of data. See the yellow disrupted line below.

Screenshot 2024-01-25 at 12 15 51 PM

To Reproduce Steps to reproduce the behavior:

  1. Have CCA and omSupply running on the same tablet with CCA in the background
  2. Leave to collect data overnight
  3. Open CCA log table (maybe easier to spot gaps in Grafana)
  4. See the data missing

Expected behavior No data is missing, there should be an entry for each log interval, should be able to leave CCA running in the background

Smartphone (please complete the following information):

marthakeezy commented 4 months ago

Noticed this today:

Around 3:15am, sensor #1 dropped off the radar

photo_2024-02-20 08 55 56

Then around 4:45am the sensor #2 stopped, and then around 5:36am the sensor #1 re-appeared but the breach type is blank.

photo_2024-02-20 08 57 19

marthakeezy commented 4 months ago

Logged into omSupply after the weekend and noticed some of the logs were not refreshed → went into the CCA, noticed the time stamp of the last collected reading was 2 days ago for one sensor and 6 hours ago for another sensor.

Logged back into omSupply → the logs were there. Switched to CCA, and waited for a few minutes for the time stamp to get updated.

I don’t think the issue is in missing data, but in the way the apps get updated to reflect that data. E.g. the data is there and if you give it a few minutes you will see it, but instead the app is not updating as the data gets collected.

screenshot-1708910552743

mark-prins commented 4 months ago

Would like to have a developer recreate the scenario

adamdewey commented 2 weeks ago

This happened to me last night.

Lost a few hour's worth of data for 3 sensors.

Interestingly the data cuts out about the same time for all 3 sensors but doesn't come back at the same time, they all differ slightly:

image

image

image

image

Data is missing from CCA:

image

Interesting the data is still there on the sensors (thanks @jmbrunskill !):

image

(Ignore the date, it's not stored absolutely on the sensor)

image