medic / cht-android

A native Android container for Community Health Toolkit (CHT) applications
GNU Affero General Public License v3.0
25 stars 49 forks source link

App Crash causes data loss if phone storage is full #273

Open njogz opened 2 years ago

njogz commented 2 years ago

Describe the bug It is possible to los app data when trying to sync fi the phone storage is already full

To Reproduce Steps to reproduce the behavior:

  1. Fill up the phone storage to near capacity
  2. Upload more docs to the server
  3. Try to sync and download the additional documents
  4. See error

Expected behavior No loss of data whtsoever. The app should warn you before syncing if phone storage is full

Logs https://github.com/medic/cht-android/issues/170#issuecomment-1136263627

Screenshots If applicable, add screenshots to help explain your problem.

Environment

Additional context https://github.com/medic/cht-android/issues/170

jkuester commented 2 years ago

Clarifying question: is there actual data loss here in the sense that data that only exists on the phone is lost, gone, and not synced to the server?

Maybe I am misunderstanding things, but it seems like the issue being described is that the data exists on the server, but there is not enough room to sync them to the phone so the sync errors out and the new data from the server is not actually stored on the phone (but no data is really "lost" since it is still on the server...). Sorry if I am just misunderstanding things here but "data loss" sounds really scary to me and I want to understand if that is what is really happening here or if we are just failing to sync data from the server...