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

App stops syncing data after a couple of days on Android 11 #206

Closed adamdewey closed 1 year ago

adamdewey commented 2 years ago

Describe the bug After a couple of days (still need to identify exactly how long) the app stops syncing data to the server.

PXL_20211031_192702628

Restarting the app fixes the problem.

PXL_20211031_192937756

To Reproduce Steps to reproduce the behavior:

  1. Use Samsung Galaxy Tab A7 SM-T500
  2. Set screen to always stay on (need to enable Developer settings and select in there)
  3. Set app up with multiple sensors
  4. Integrate the app with a server
  5. Leave the app for a couple of days
  6. Note that sync eventually stops

Expected behavior Sync to keep running ad infinitum.

Smartphone (please complete the following information):

Additional context I don't recall seeing this on Android 10 on the Lenovo tablets.

chetstone commented 2 years ago

I was seeing this too. Thought it was normal. I didn't have the app connected to a server but syncing with the BT sensors stops after a while.

adamdewey commented 2 years ago

@chetstone - oh interesting. Are you also using Android 11?

chetstone commented 2 years ago

Yes. It's an SM-T500 also.

Chris-Petty commented 2 years ago

@adamdewey Andrew may have hinted at this problem when we chatted to him, might not be exclusive to Android 11 (They lenovo X505 android 10)

adamdewey commented 2 years ago

@Chris-Petty - oh I must have missed that!

I haven't seen this exact problem on those Lenovo Android 10 tablets if I leave the screen on 24/7 I don't think - but there may be some other variables between mine and his tablets I guess!

kat-ms commented 2 years ago

I've been running with this for a few days on Android 11 and haven't reproduced this week, but have been accidentally hitting various buttons on the screen (stray cables...), so wonder if it's specific to being on that main screen for a long time. Or maybe one of these presses inadvertently backgrounded the app 🤔 . (very scientific and methodical, I know)

adamdewey commented 2 years ago

Hmm, yeah my guess is it needs to just be sitting there untouched for a while. Let me set mine up again and see how long it takes to bomb out...

adamdewey commented 2 years ago

Ok, have set my tablet up just now, will report back when/if it stops reporting...

kat-ms commented 2 years ago

Ok, have set my tablet up just now, will report back when/if it stops reporting...

Oh awesome, thanks Adam! I've started my screen back up this morning around 10am too. I will get you, elusive 🐛😡

adamdewey commented 2 years ago

Oops, forgot to update - mine crashed out 3 days ago!

So managed a good 5 days reporting first...

adamdewey commented 2 years ago

Just observed this on Android 10 too PXL_20220221_000211605

An app restart rectified things

kat-ms commented 2 years ago

Might(??) be linked to https://app.bugsnag.com/sustainable-solutions-nz-ltd/cce/errors/615e397b45c36700076788cc?filters[event.since]=all&filters[app.release_stage]=production&filters[error.status]=open&event_id=6212f0680090891670d00000? Error sounds a bit gibberish atm (time to do some searching online 🤔 ) but seems consistent with the comment that there was a system dialog pop up before the error started happening.

image

adamdewey commented 2 years ago

AUSMAT are wanting cold chain - think we need to fix Android 11 or we can't keep recommending it to new clients...

adamdewey commented 2 years ago

Also, Kat - don't look! Kiribati trumps all 😁

mark-prins commented 1 year ago

I think this is resolved with the UUID generation change - has been working for me for more than a week; and I have a reproducible scenario to create an issue. whether is it the issue or not, time will tell.

Closing this issue for now, and we can reopen if required. Note that production debug logging is now available, so we can diagnose on a long running tablet if required.