In some situations, (eg if the server deletes its database), the client may not know it must 'sync' again, so the data can become stale.
Or it can only send the 'diff' based on its local cache, which is incomplete after a database wipe in the server.
Possible solution: run cksums on each 'table' of data:
- A) the client "real" data (as read from python-sysinfo)
- B) the client current 'local cache' (which normally represents what the client *thinks* the server knows)
- C) the data for that client stored in the database by the server
So on every sync, they must be compared based on checksum (possible drawback: more CPU usage)
if C == B == A: do nothing
if ( C == B ) && (C != A): client data changed. send diff of changes
unlikely:
if C != B: "server wiped database?" - full sync
if C, B, A are different - full sync
if B is empty: "wiped or new" - full sync