Every object synchronized using the Sync module is being compared with the current database state in order to avoid overriding important data. This mechanism allows detecting conflicts during synchronization and is implemented as objects' hash codes comparison.
Hash code generation
Hash codes are generated using the SHA2-512 algorithm which produces 128-characters long output. Every object is parsed to its JSON representation and provided as an input of that algorithm.
Fields skipped by hash code method
Object's fields, which the hash code method omits, are listed below:
- REST HATEOAS
Please consider this situation. An child instance receives a parent's object, which was previously pulled and voided later on the child. Now, when we have pulled parent's object again we want to link that object to child's voided version of it in order to avoid saving old version of the object. To do so, hash codes have to be identical for these object (parent's non-voided & child's voided). That is why voided and retired related fields are skipped.