You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(existingData==null&&updateConflictType==ConflictType.NoConflict)thrownewSyncEngineConstraintException($"{nameof(DeserializeJsonToExistingData)} must not return null for conflictType equals to {ConflictType.NoConflict.ToString()}");
if(existingData==null)thrownewSyncEngineConstraintException($"{nameof(DeserializeJsonToExistingData)} must not return null for {nameof(conflictType)} equals to {conflictType.ToString()}");
639
639
if(existingData.GetType().FullName!=classType.FullName)thrownewSyncEngineConstraintException($"Expected returned Type: {classType.FullName} during {nameof(DeserializeJsonToExistingData)}, but Type: {existingData.GetType().FullName} is returned instead.");
if(!existingDataId.Equals(localId))thrownewSyncEngineConstraintException($"The returned Object Id ({existingDataId}) is different than the existing data Id: {localId}");
@@ -97,7 +97,7 @@ public void HookPreInsertOrUpdateGlobalTimeStamp(object data)
97
97
if(!IsServerEngine())
98
98
{
99
99
longlastSync=GetClientLastSync();
100
-
if(nowTicks<=lastSync)thrownewSyncEngineConstraintException("System Date and Time is older than the lastSync value");
100
+
if(nowTicks<=lastSync&&!SyncConfiguration.SyncConfigurationOptions.GlobalTimeStampAllowHooksToUpdateWithOlderSystemDateTime)thrownewSyncEngineConstraintException("System Date and Time is older than the lastSync value");
@@ -117,7 +117,7 @@ public void HookPreDeleteGlobalTimeStamp(object data)
117
117
if(!IsServerEngine())
118
118
{
119
119
longlastSync=GetClientLastSync();
120
-
if(nowTicks<=lastSync)thrownewSyncEngineConstraintException("System Date and Time is older than the lastSync value");
120
+
if(nowTicks<=lastSync&&!SyncConfiguration.SyncConfigurationOptions.GlobalTimeStampAllowHooksToUpdateWithOlderSystemDateTime)thrownewSyncEngineConstraintException("System Date and Time is older than the lastSync value");
// Here you can react accordingly if there's a conflict during Updates.
129
+
// For DatabaseTimeStamp, the possibilities of conflict types are:
130
+
// 1. ConflictType.ExistingDataIsNewerThanIncomingData, means that the ExistingData (parameter: data) timestamp is newer than the IncomingData (parameter: jObject).
131
+
// 2. ConflictType.ExistingDataIsUpdatedByDifferentDatabaseInstanceId, means that the ExistingData (parameter: data) is updated by different Database Instance Id (perhaps updated by other devices) than the IncomingData (parameter: jObject) Database Instance Id.
132
+
//
133
+
// If you return null here, then the update will be canceled and the conflict will be registered in the SyncResult's Conflict Log.
134
+
// In this example, the conflict is ignored and continue with the data update.
// Here you can react accordingly if there's a conflict during Updates.
126
+
// For DatabaseTimeStamp, the possibilities of conflict types are:
127
+
// 1. ConflictType.ExistingDataIsNewerThanIncomingData, means that the ExistingData (parameter: data) timestamp is newer than the IncomingData (parameter: jObject).
128
+
// 2. ConflictType.ExistingDataIsUpdatedByDifferentDatabaseInstanceId, means that the ExistingData (parameter: data) is updated by different Database Instance Id (perhaps updated by other devices) than the IncomingData (parameter: jObject) Database Instance Id.
129
+
//
130
+
// If you return null here, then the update will be canceled and the conflict will be registered in the SyncResult's Conflict Log.
131
+
// In this example, the conflict is ignored and continue with the data update.
// On this example, we set the GlobalTimeStampAllowHooksToUpdateWithOlderSystemDateTime to true,
43
+
// This allows the mobile apps to continue executing HookPreInsertOrUpdateGlobalTimeStamp and HookPreDeleteGlobalTimeStamp without raising errors if the device's Date Time is older than the last sync value.
44
+
// FYI, the mobile system's Date and Time is actually CAN be older if the mobile users are deliberately changing its system's Date Time settings to an older Date Time.
45
+
// So if this option is set to true, the hooks will not raise errors, BUT, conflicts can happened during synchronization. You should handle the conflicts accordingly in the DeserializeJsonToExistingData method in the server's SyncEngine subclass.
// Here you can react accordingly if there's a conflict during Updates.
72
+
// For GlobalTimeStamp, the possibilities of conflict types are:
73
+
// 1. ConflictType.ExistingDataIsNewerThanIncomingData, means that the ExistingData (parameter: data) timestamp is newer than the IncomingData (parameter: jObject).
74
+
//
75
+
// If you return null here, then the update will be canceled and the conflict will be registered in the SyncResult's Conflict Log.
76
+
// In this example, the conflict is ignored and continue with the data update.
0 commit comments