When the device is online, the CHW can log in and use the app normally. Once the internet connection is lost, the app no longer works for this user (they can’t continue using the app as expected for an offline user).
When I try to reproducing your error with the unbranded APK I get an error:
go online
install APK
launch APK and enter in your UAT URL (https://almanach-cht.uat.icrc.org), login with authenticated user, sync
make sure app works
go offline
see what happens
On step 3 above is where I get the error: URL is not a valid CHT server instance (as well, of course, I don’t have an authenticated user, this is your system, not mine ; )
This may be a bit off topic, but if there’s a way to not redirect all requests to SSO (/my.policy), it would allow CHT health checks (and monitoring API access etc). Step 3 fails because we validate the CHT instance at the /setup/poll endpoint. Here’s what the call looks like when it succeeds on our demo instance:
My thinking is that maybe something to do with your SSO (Entra ID) is causing the err_internet_disconnected error you’re seeing? Hence a less aggressive redirect might help.
As well, are you able to build your APK version but point it at an instance without SSO setup? Since this is an offline error, I can’t see why SSO would come into play, but , per above, I saw an error when I tested, so I’m wondering if SSO has something to do it?
On your test instance, are you able to use the unbranded APK then? Especially if SSO is off - that’d be a great test.
The goal is to try and either find the configuration that fixes your setup or a specific set of steps that can be reproduced so that we can file a ticket and try and work on it.
We tried all the suggested options, but the root cause turned out to be outside CHT itself. The issue was caused by a firewall/APM policy blocking or redirecting static assets (notably the service worker and related JS files). As a result, these resources were never cached on the device, which prevented offline mode from working.
Once we excluded the required static resources from the firewall policy and ensured they were served without redirects, offline functionality started working as expected. @mrjones@diana