1
0
mirror of https://github.com/etesync/android synced 2024-11-22 16:08:13 +00:00

Resource: set eTag when creating a new one from server.

Before this commit we would create new entries from the server without
an etag, essentially marking them as "local only". While the actual
value of the eTag is not currently used, null or not matters.
Because the resources were "local only", we would get weird behaviours
like having an "ADD" action when changing a resource.
This commit is contained in:
Tom Hacohen 2017-03-24 14:40:29 +00:00
parent 84244330b7
commit 5d1c90dcba
2 changed files with 3 additions and 3 deletions

View File

@ -113,7 +113,7 @@ public class CalendarSyncManager extends SyncManager {
syncResult.stats.numUpdates++;
} else {
App.log.info("Adding " + newData.uid + " to local calendar");
localEvent = new LocalEvent(localCalendar(), newData, newData.uid, null);
localEvent = new LocalEvent(localCalendar(), newData, newData.uid, newData.uid);
localEvent.add();
syncResult.stats.numInserts++;
}

View File

@ -193,13 +193,13 @@ public class ContactsSyncManager extends SyncManager {
if (local == null) {
if (newData.group) {
App.log.log(Level.INFO, "Creating local group", newData);
LocalGroup group = new LocalGroup(localAddressBook(), newData, uuid, null);
LocalGroup group = new LocalGroup(localAddressBook(), newData, uuid, uuid);
group.create();
local = group;
} else {
App.log.log(Level.INFO, "Creating local contact", newData);
LocalContact contact = new LocalContact(localAddressBook(), newData, uuid, null);
LocalContact contact = new LocalContact(localAddressBook(), newData, uuid, uuid);
contact.create();
local = contact;