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

Syncing lot of logs isn't reliable with poor internet connections #280

Closed jmbrunskill closed 6 months ago

jmbrunskill commented 7 months ago

Describe the bug Currently syncing logs uses a Promise.all() request to try to send all the logs concurrently in batches of 20.

If there are a lot of logs, this results in a lot of connections to the server. Additionally, we don't handle the failure of sending some logs well (the whole Promise.all() will exit I think)

Expected behavior

Additional context Add any other context about the problem here.

mark-prins commented 7 months ago

yep, a promise.all() will reject when the first promise rejects. perhaps don't send concurrently? and increase the batch size. what about batching the batches and run a handful concurrently?

jmbrunskill commented 7 months ago

perhaps don't send concurrently? and increase the batch size. what about batching the batches and run a handful concurrently?

Yeah I'm thinking something similar...

marthakeezy commented 2 weeks ago

Mark confirmed the issue has been Dev build tested, so moving to Done ✅ :) Will keep an eye on general log synchronisation and reopen individual issues should any problems occur!