Recently our team was responsible for implementing an Offline Data Sync process. In this project, we had one major challenge, how do we know for certain there is a sync process running in the background?
We could try using sync logs and sync statuses, but if the user force closes de app mid sync, the app would be stuck on an In Progress sync log.
Investigating the script OutSystemsUI.OfflineDataSync, we noticed that script contains many useful variables that are not made public to the app, most importantly, the var isSyncing.
In our project, we were able to override the OfflineDataSync js object with our version of this script that includes an action to return the value of the isSyncing variable.
This enabled us to implement a much more robust and user friendly background offline sync process, as it enabled us to know when should we allow the user to trigger syncs and by giving, with certain, to the user, a visual indication of the sync status.
Our suggestion is that this action is made available by default on OutSystemsUI. It's a simple change to the script. Simply add the getIsSyncing function after the getSyncOnResume function.
