medic/cht-android

Improve connection errors UX, especially for the XWalk-Webview migration process

mrsarm opened this issue · 5 comments

Quote from ticket #134 :

Firstly, the service worker cache is not migrated, so if the user upgrades and the loses internet an ugly error message is shown.
image

This ticket is not about implementing the service worker cache migration but improve the connection errors UX. Is not just the errors displayed have a bad look & feel, but also during the migration process it doesn't display a "Retry" button, like in other cases to retry after recover the connection. This cause the user to loss the app data during the migration, which is a big issue as stated in the ticket.

So, there are 2 things to improve:

  1. When there are errors in the connection show an UI like the one proposed by @n-orlowski in the migration ticket:
    workflow
  2. Always ensure that the user can retry after the connection fails, not just when trying to migrate the app, eg. when the user install the app for the fist time sideloading the installer without internet connection.

Important consideration

The workflow proposed has a special view for timeout errors that says: "We are having trouble migrating your data. You can wait a bit longer or cancel the upgrade". And there is a "Cancel" button that:

If user cancels, they are taken to the log in screen.

I'm not sure whether the user will understand what "Cancel" means on this context, and whether we should provide this option to the user.

The user may think that "Cancel" means cancel the upgrade process of the app, not the data, so cancel in the understanding of a normal user could be: "I'm cancelling the installation of this new version of the app, so the old version will be kept along my data".

Also we should add in that same view a "Retry" button as in the other views to give the user the ability to retry.

CC @garethbowen @craig-landry @kennsippell to discuss whether a "Cancel" option is a good idea.

Then if it is OK, I can continue the communication of the action with @n-orlowski to find the best way of letting the users know what they are opting in.

I think the cancel button was added when we were thinking the migration may get stuck in an infinite restart loop. The solution you've found for the migration means this is no longer the case, so it's not relevant. If the user does not have a service worker cache, nor an internet connection, then it doesn't make sense to "cancel" because we can't show them the login page anyway.

In addition I think we should keep trying to retry even without the user clicking the button. This could be done either by trying to detect when a network connection is established, but it's probably easier just to refresh in the background periodically while the app is in the foreground.

Ready for AT, release v0.8.0-alpha.1 (branch 163-imp-conn-errors-ux).

PR with the description of the changes: #165

Although the alpha release can be used to check some of the features (login workflow), to test the migration workflow local builds are needed (check the last bullet point in the PR description).

Testing on android 10, local Webview build.
image

Connected back to the internet and pressed 'Retry' > login page is displayed.
Not sure if this was part of the ticket @mrsarm , but it would be nice to also be explicit when at login, there is no internet connection... instead of the generic error message we have atm.
image

Not sure if this was part of the ticket @mrsarm , but it would be nice to also be explicit when at login, there is no internet connection... instead of the generic error message we have atm.

@ngaruko no is not part of the ticket and we cannot solve it from here, the error you see in red is from the login page that is a component of the CHT, not a component of the medic-android app.

LGTM. Tested areas:

  1. No internet error message for Webview
  2. Xwalk to Webview migration - message
  3. Xwalk to Webview migration - still logged in and data not lost
  4. Translations for both texts (depending on phone language settings)
  5. Webview to WebView upgrade

==> Ready to merge @mrsarm