code: private void cancelRetryFuture() {
          if (retryFuture != null && !retryFuture.isDone()) {
              retryFuture.cancel(true);
          }
          retryFuture = null;
      }
docs: helper function to cancel retry future. not in iOS code.