Great, Thanks a lot, I will confirm it’s working in next release
Unnecessary fetching of remote member ETags
-
The logic for “Phase 2A” of SyncManager.synchronize() seems a bit off and its result goes unused:
Assuming I’ve parsed this right, something like this should work (assuming the manualSync parameter is renamed to pullRemoteCollection)
pullRemoteCollection = pullRemoteCollection || syncResult.stats.numEntries > 0; // PHASE 2A: check if there's a reason to do a sync with remote (= forced sync or remote CTag changed) if (!pullRemoteCollection) { String remoteCTag = remoteCollection.getCTag(); String localCTag = localCollection.getCTag(); pullRemoteCollection = (remoteCTag != null && localCTag != null) && remoteCTag.equals(localCTag); } if (!pullRemoteCollection) { Log.i(TAG, "No local changes made and ctags match, will not pull from remote."); return; }
Also, might have something to do with #147 ?
-
Also, using != on String objects @ line 75:
Fix…
if (localResource.getETag() == null || !localResource.getETag().equals(remoteResource.getETag())) {
I think I spotted a couple more of these while browsing through the code base. Would you prefer pull request(s) or filing issues for such small edits?
-
@rhodey: Seems like the
return
got lost in 8a651f135b95d3c534201142690ed7eed07ece85…Issues are OK.