Open icrc-fdeniger opened 2 months ago
Hi @icrc-fdeniger I have added the prompt to state that the current login has expired with three choices as stated above: "Yes," "No," and "No, and don’t ask me again". This prompt is immediately displayed when the current access token gets expired.
Also I have added the network status listener where when the device comes online from offline then it will trigger the one time sync.
I have also added the network status (offline/online) in the App Top Bar.
I had a few questions as follows:
Also other than sync trigger on network status change is there anything else required for Data synchronization?
- What should be the behavior of each choice in the dialog?
- The sync should be stopped or it should continue when the dialog is displayed?
if the login is expired, the sync is stopped in any case as no synchro can be done in any case no ?
This dialog should appearch only if online and if OpenMRS server is accessible. It's possible that the user has access to internet but not to OpenMRS Server
So, in case of only "No" choice although the sync will not happen the periodic sync worker has to be kept running or should be stopped? Because the login has expired.
I would keep the sync up and running
Currently, the application attempts to log into the backend at startup. It should only connect to the server on the first launch to download the initial configuration.
For subsequent attempts, the app should check if the user is online by verifying access to the check_server_url.
Data Synchronization after being offline: If the user selects "Synchronize" after being offline, the app will first attempt to log them into OpenMRS. For OpenID Connect, a refresh token should be generated. For basic authentication, the user may need to enter their credentials again, depending on the session timeout configuration. See #64
The process should be tested with the OpenID Connect workflow to ensure proper session timeout handling.