Make local changes be spotted more often

This commit is contained in:
Magnus Ulf 2020-01-22 02:43:13 +01:00
parent c5871576ef
commit 272b742fd1
2 changed files with 13 additions and 8 deletions

View File

@ -346,7 +346,7 @@ public class Coll<E extends Entity<E>> extends CollAbstract<E>
this.attach(entity, id, false);
// On creation it might be modified by addition or removal of new/old fields.
// So we must do a check for that.
// this.putIdentifiedModificationFixed(id, Modification.UNKNOWN);
//this.putIdentifiedModificationFixed(id, Modification.UNKNOWN);
}
if (ConfServer.localPollingEnabled) entity.setLastRaw(raw);
@ -802,6 +802,10 @@ public class Coll<E extends Entity<E>> extends CollAbstract<E>
Entry<JsonObject, Long> remoteEntry = idToEntry.getValue();
loadFromRemoteFixed(id, remoteEntry);
}
// They might be changes by addition of removal of fields
// upon creation. That mostly happens when loading from the
// database for the first time.
this.identifyLocalModifications(Modification.UNKNOWN_CHANGED);
}
// -------------------------------------------- //
@ -965,6 +969,7 @@ public class Coll<E extends Entity<E>> extends CollAbstract<E>
// syncIdentified is probably good enough. We need not load, and when
// lastRaw is not present we can't identify local modifications anyway.
//this.syncAll();
this.identifyLocalModifications(Modification.UNKNOWN_LOG); // For the servers where lastRaw is present
this.syncIdentified();
name2instance.remove(this.getName());

View File

@ -101,7 +101,7 @@ public class MigratorUtil
}
// GET
public static int getTargetVersion(Class<?> entityClass)
public static int getTargetVersion(Class<?> entityClass)
{
if (!targetVersions.containsKey(entityClass))
{