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

#294 fix empty cca app sync request #298

Closed raviSussol closed 6 months ago

raviSussol commented 6 months ago

Fixes #294

Makes requests for sensor, temparature log & temperature breach if there is/are data in the syncLog to be pushed.

raviSussol commented 6 months ago

If so I think that logic should be in function* syncAll({ ... }) If there's nothing to sync, you could skip the authenticate and other steps and just yield put(SyncAction.updateIsSyncing(false));`?

That wouldn't stop from making api call (other than authenticate) to the server if we just check syncQueueManager.length in the syncAll - have to individually check each type records (sensor, temperature-log & temperature-breach) to really make sure either of api call only be made if there is/are specific type of records in the syncLog. So thought better to check in their main functions.

332c60f should resolve it.

raviSussol commented 6 months ago

Thanks for reviewing @jmbrunskill!