EyeSeeTea / pictureapp

Mobile application designed to report cases of malaria (to a DHIS2 server)
GNU General Public License v3.0
4 stars 4 forks source link

Manage all IOException during push eReferralsAPIClient as NetworkExce… #2426

Closed xurxodev closed 5 years ago

xurxodev commented 5 years ago

:pushpin: References

:tophat: What is the goal?

I interrupted the synchronisation of a record voluntarily. The record turned "red" when I would expect it to turn "orange" and attempt synchronisation again at a later stage. Note that in some cases (most?) it turns "orange" as expected, but it sometimes does not and the user cannot know whether the record has been properly synchronised or not.

:gear: branches

app: Origin: maintenance/change_keyboard_in_soft_login_to_numeric Target: v1.4_connect bugshaker-android: Origin: downgrade_gradle_version EyeSeeTea-sdk: Origin: Development

:memo: How is it being implemented?

The problem is that only SocketTimeoutException and UnknownHostException derivated class from IOException was treated as NetworkException. I have modified the cath to superclass IOException.

Now all IOExceptions are treated as NetworkException in eReferralsAPIClient and when push controller receives a NetworkException then survey status is assigned to Quarantine.

:boom: How can it be tested?

Use Case 1: Create a new survey and during push process change plane mode to on, the survey should appear in brown color (Quarantine) and send it in the next push.

:floppy_disk: Requires DB migration?

:art: UI changes?