Fix regression (8a651f135b) causing unnecessary traffic (closes #162, closes #147)

pull/2/head
rfc2822 11 years ago
parent 4073880185
commit 9b992c54ca

@ -63,6 +63,11 @@ public class SyncManager {
fetchCollection = true;
}
if (!fetchCollection) {
Log.i(TAG, "No local changes and CTags match, ne need to sync");
return;
}
// PHASE 2B: detect details of remote changes
Log.i(TAG, "Fetching remote resource list");
Set<Resource> remotelyAdded = new HashSet<Resource>(),
@ -72,7 +77,7 @@ public class SyncManager {
for (Resource remoteResource : remoteResources) {
try {
Resource localResource = local.findByRemoteName(remoteResource.getName(), false);
if (localResource.getETag() == null || localResource.getETag() != remoteResource.getETag())
if (localResource.getETag() == null || !localResource.getETag().equals(remoteResource.getETag()))
remotelyUpdated.add(remoteResource);
} catch(RecordNotFoundException e) {
remotelyAdded.add(remoteResource);

Loading…
Cancel
Save