Synchronization steps: Difference between revisions

Jump to navigation Jump to search
Line 159: Line 159:
In the opposite case (when the app was terminated during synchronization or the new user interface fails to load), at the next app start MCRM deletes the database and returns to its previous customization. However, the <code>WWW/Images</code> folders are not reverted.
In the opposite case (when the app was terminated during synchronization or the new user interface fails to load), at the next app start MCRM deletes the database and returns to its previous customization. However, the <code>WWW/Images</code> folders are not reverted.


== ForcedFullSync ==
== Forced full synchronization ==


It is represented as
Full synchronization essentially means one thing: delete data. This can be done by the user. However, it can be also initiated by admin via Woodford.
* ForcedFullSyncDate (possibly null)
* Flag ForcedFullSyncDateAlways


<syntaxhighlight lang="c#">
How it works: When the Woodford admin enables '''Full Sync''' (using [[Device control]]), the respective attribute (resco_forcefullsyncon) in the resco_mobiledevice record belonging to the client's device is set to current date and time. This value is passed to the client during synchronization. The client receives this date/time and compares it with the time of the last synchronization. If the last synchronization started prior to the Woodford device control action, client attempts a full synchronization.
if( ForcedFullSyncDate != null && lastSyncDate < ForcedFullSyncDate ) {
 
    BkSync => exception "Please Start Sync Manually: Administrator Forced Full Sync"
In addition to the date/time value in ForcedFullSyncDate (can be also null), there's also the flag ForcedFullSyncDateAlways. When enabled, full synchronization continues even if there are unsynchronized local changes. The changes are deleted and everything is redownloaded from the server.
    Unsent changes && !ForcedFullSyncDateAlways => exception "Can't execute Full Sync forced by Administrator because upload of local changes failed"
 
    Otherwise Delete DB
Caveats:
}</syntaxhighlight>
* If this is a background synchronization, it is aborted and an error is displayed: "''Please Start Sync Manually: Administrator Forced Full Sync''".
* If ForcedFullSyncDateAlways is false and there are unsynchronized local changes, synchronization is aborted with error "''Can't execute Full Sync forced by Administrator because upload of local changes failed''".


== Download permissions ==
== Download permissions ==

Navigation menu