From ac815dd833403cbe93a361ee41a72c6804955f4d Mon Sep 17 00:00:00 2001 From: Marina Samuel Date: Wed, 28 Mar 2012 17:25:24 -0700 Subject: [PATCH 1/2] Bug 739519 - Part 1: quickfix. r=rnewman --- .../base/sync/stage/SyncClientsEngineStage.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mobile/android/base/sync/stage/SyncClientsEngineStage.java b/mobile/android/base/sync/stage/SyncClientsEngineStage.java index 1494d45f022..a7b02006d3f 100644 --- a/mobile/android/base/sync/stage/SyncClientsEngineStage.java +++ b/mobile/android/base/sync/stage/SyncClientsEngineStage.java @@ -165,14 +165,8 @@ public class SyncClientsEngineStage implements GlobalSyncStage { @Override public String ifUnmodifiedSince() { - Long timestampInMilliseconds = session.config.getPersistedServerClientRecordTimestamp(); - - // It's the first upload so we don't care about X-If-Unmodified-Since. - if (timestampInMilliseconds == 0) { - return null; - } - - return Utils.millisecondsToDecimalSecondsString(timestampInMilliseconds); + // Temporary fix for bug 739519. + return null; } @Override From 813d878c6254eb04553c71e05f4f2151fa57d0a6 Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Wed, 28 Mar 2012 17:25:24 -0700 Subject: [PATCH 2/2] Bug 739519 - Part 2: logging. r=trivial --- .../android/base/sync/net/SyncStorageRequest.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mobile/android/base/sync/net/SyncStorageRequest.java b/mobile/android/base/sync/net/SyncStorageRequest.java index ecc46c7e69c..3de61a12acf 100644 --- a/mobile/android/base/sync/net/SyncStorageRequest.java +++ b/mobile/android/base/sync/net/SyncStorageRequest.java @@ -11,8 +11,7 @@ import java.security.GeneralSecurityException; import java.util.HashMap; import org.mozilla.gecko.sync.GlobalConstants; - -import android.util.Log; +import org.mozilla.gecko.sync.Logger; import ch.boye.httpclientandroidlib.HttpEntity; import ch.boye.httpclientandroidlib.HttpResponse; @@ -22,7 +21,6 @@ import ch.boye.httpclientandroidlib.impl.client.DefaultHttpClient; import ch.boye.httpclientandroidlib.params.CoreProtocolPNames; public class SyncStorageRequest implements Resource { - public static HashMap SERVER_ERROR_MESSAGES; static { HashMap errors = new HashMap(); @@ -99,18 +97,18 @@ public class SyncStorageRequest implements Resource { @Override public void handleHttpResponse(HttpResponse response) { - Log.d(LOG_TAG, "SyncStorageResourceDelegate handling response: " + response.getStatusLine() + "."); + Logger.debug(LOG_TAG, "SyncStorageResourceDelegate handling response: " + response.getStatusLine() + "."); SyncStorageRequestDelegate d = this.request.delegate; SyncStorageResponse res = new SyncStorageResponse(response); // It is the responsibility of the delegate handlers to completely consume the response. if (res.wasSuccessful()) { d.handleRequestSuccess(res); } else { - Log.w(LOG_TAG, "HTTP request failed."); + Logger.warn(LOG_TAG, "HTTP request failed."); try { - Log.w(LOG_TAG, "HTTP response body: " + res.getErrorMessage()); + Logger.warn(LOG_TAG, "HTTP response body: " + res.getErrorMessage()); } catch (Exception e) { - Log.e(LOG_TAG, "Can't fetch HTTP response body.", e); + Logger.error(LOG_TAG, "Can't fetch HTTP response body.", e); } d.handleRequestFailure(res); } @@ -138,6 +136,7 @@ public class SyncStorageRequest implements Resource { // Clients can use their delegate interface to specify X-If-Unmodified-Since. String ifUnmodifiedSince = this.request.delegate.ifUnmodifiedSince(); if (ifUnmodifiedSince != null) { + Logger.debug(LOG_TAG, "Making request with X-If-Unmodified-Since = " + ifUnmodifiedSince); request.setHeader("x-if-unmodified-since", ifUnmodifiedSince); } if (request.getMethod().equalsIgnoreCase("DELETE")) {