mirror of
https://github.com/etesync/android
synced 2025-01-14 17:51:01 +00:00
Fix regression (8a651f135b
) causing unnecessary traffic (closes #162, closes #147)
This commit is contained in:
parent
4073880185
commit
9b992c54ca
@ -63,6 +63,11 @@ public class SyncManager {
|
|||||||
fetchCollection = true;
|
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
|
// PHASE 2B: detect details of remote changes
|
||||||
Log.i(TAG, "Fetching remote resource list");
|
Log.i(TAG, "Fetching remote resource list");
|
||||||
Set<Resource> remotelyAdded = new HashSet<Resource>(),
|
Set<Resource> remotelyAdded = new HashSet<Resource>(),
|
||||||
@ -72,7 +77,7 @@ public class SyncManager {
|
|||||||
for (Resource remoteResource : remoteResources) {
|
for (Resource remoteResource : remoteResources) {
|
||||||
try {
|
try {
|
||||||
Resource localResource = local.findByRemoteName(remoteResource.getName(), false);
|
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);
|
remotelyUpdated.add(remoteResource);
|
||||||
} catch(RecordNotFoundException e) {
|
} catch(RecordNotFoundException e) {
|
||||||
remotelyAdded.add(remoteResource);
|
remotelyAdded.add(remoteResource);
|
||||||
|
Loading…
Reference in New Issue
Block a user