Bug 1151484 - Account for null result when polling on a latch during Reading List sync. r=nalexander, a=sledru
authorRichard Newman <rnewman@mozilla.com>
Mon, 06 Apr 2015 10:19:20 -0700
changeset 258324 8a734418a22e
parent 258323 4406ce9ace92
child 258325 d2987ec0e0e7
push id4645
push userryanvm@gmail.com
push date2015-04-07 15:05 +0000
treeherdermozilla-beta@8f0271f2c153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander, sledru
bugs1151484
milestone38.0
Bug 1151484 - Account for null result when polling on a latch during Reading List sync. r=nalexander, a=sledru
mobile/android/base/reading/ReadingListSyncAdapter.java
--- a/mobile/android/base/reading/ReadingListSyncAdapter.java
+++ b/mobile/android/base/reading/ReadingListSyncAdapter.java
@@ -255,16 +255,21 @@ public class ReadingListSyncAdapter exte
         BaseResource.removeHttpResponseObserver(observer);
         long backoffInSeconds = observer.largestBackoffObservedInSeconds.get();
         if (backoffInSeconds > 0) {
           Logger.warn(LOG_TAG, "Observed " + backoffInSeconds + "-second backoff request.");
           storageBackoffHandler.extendEarliestNextRequest(System.currentTimeMillis() + 1000 * backoffInSeconds);
         }
       }
 
+      if (result == null) {
+        // The poll timed out. Let's call this an error.
+        result = Result.Error;
+      }
+
       switch (result) {
       case Success:
         requestPeriodicSync(account, ReadingListSyncAdapter.AFTER_SUCCESS_SYNC_DELAY_SECONDS);
         break;
       case Error:
         requestPeriodicSync(account, ReadingListSyncAdapter.AFTER_ERROR_SYNC_DELAY_SECONDS);
         break;
       case Postponed: