anchor.diff:                                 {[], 0}, DocInfos),
       {ok, Missing} = couch_api_wrap:get_missing_revs(Target, IdRevs),
   
  +    %%build list of docinfo for all missing ids
  +    MissingDocInfoList = lists:filter(
  +                           fun(#doc_info{id = Id, rev = _Rev} = _DocInfo) ->
  +                                   case lists:keyfind(Id, 1, Missing) of
  +                                       %% not a missing key
  +                                       false ->
  +                                           false;
  +                                       %% a missing key
  +                                       _  -> true
  +                                   end
  +                           end,
  +                           DocInfos),
  +
       ?xdcr_debug("after conflict resolution at target (~p), out of all ~p docs "
                   "the number of docs we need to replicate is: ~p",
                   [Target#httpdb.url, AllRevsCount, length(Missing)]),
  -    Missing.
  +
  +    MissingDocInfoList.
  
positive.code:     {ok, DataRepd1} = local_process_batch([], Cp, Source, Target, #batch{}),
      {ok, DataRepd1 + Size};
  
  local_process_batch([IdRevs | Rest], Cp, #db{} = Source,
                      #httpdb{} = Target, Batch) ->
      {ok, {_, DocList, _}} = fetch_doc(
                                        Source, IdRevs, fun local_doc_handler/2,
                                        {Target, [], Cp}),
      {Batch2, DataFlushed} = lists:foldl(
                           fun(Doc, {Batch0, DataFlushed1}) ->
  
negative.code:             exit({failed_write, Props})
      end.
  
  %% return list of Docsinfos of missing keys
  -spec find_missing(list(), #httpdb{}) -> list().
  find_missing(DocInfos, Target) ->
      {IdRevs, AllRevsCount} = lists:foldr(
                                 fun(#doc_info{id = Id, rev = Rev}, {IdRevAcc, CountAcc}) ->
  