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

252 cca sync stops during server backup tablet needs to be restarted #254

Closed jmbrunskill closed 8 months ago

jmbrunskill commented 8 months ago

Closes #252

By default axios (our API request framework) doesn't timeout network connections if they hang. It seems likely that during the server backup, since mSupply Server API Requests simply hang and the Sync Saga simply hangs waiting for the connection to finish.

If the connection is hung for a long time (say 20minutes) the connection appears to be timed out somewhere in the OS or network layer, but this isn't correctly handled in our application.

With this change, we've added a request timeout which returns an error if the connection can't be made to the server.

We've also slightly improved some of the logging and error handling, including a sync status section in the configuation.

image