Entry sync: also generate UUIDs for first synced deleted entries

This fixes a bug with deleting entries that were never synced before. To
reproduce:
1. Turn off wifi + data (to ensure nothing is synced).
2. Add an entry (event/task/contact).
3. Delete that entry.
4. Turn wifi + data back on
5. Hit sync
pull/71/head
Tom Hacohen 5 years ago
parent f64960699b
commit 356017a541

@ -479,7 +479,13 @@ constructor(protected val context: Context, protected val account: Account, prot
if (Thread.interrupted())
return ret
App.log.info(local.uuid + " has been deleted locally -> deleting from server")
if (local.uuid != null) {
App.log.info(local.uuid + " has been deleted locally -> deleting from server")
} else {
App.log.fine("Entry deleted before ever syncing - genarting a UUID")
local.prepareForUpload()
}
ret.add(local)
syncResult.stats.numDeletes++

Loading…
Cancel
Save