anchor.diff:          [{since, Since}, {until, infinity}], []
       ).
   
  +-spec stop_changes_stream(pid()) -> ok.
  +stop_changes_stream(Stream) ->
  +    try
  +        gen_server:stop(Stream)
  +    catch
  +        exit:noproc ->
  +            ok
  +    end.
  +
   %%-------------------------------------------------------------------
   %% @private
   %% @doc
  
positive.code:     {noreply, NewState :: state()} |
      {noreply, NewState :: state(), timeout() | hibernate} |
      {stop, Reason :: term(), NewState :: state()}.
  handle_cast(_Request, #state{mode = Mode} = State)
      when Mode =:= retry orelse Mode =:= resuming ->
      % ignore because stream is in retry mode
      {noreply, State};
  handle_cast({change, {ok, end_of_stream}}, State = #state{mode = retry}) ->
      % all changes sent by changes_stream before stopping it have already arrived
      {noreply, State#state{changes_flushed = true}};
  
negative.code:     {noreply, consume_change_and_enter_retry_mode_on_error(State, DocOrDocs)};
  handle_cast({change, {error, _Seq, Reason}}, State = #state{mode = stream}) ->
      {stop, Reason, State};
  handle_cast(_Request, #state{mode = Mode} = State)
      when Mode =:= retry orelse Mode =:= resuming ->
      % ignore because stream is in retry/resuming mode
      {noreply, State};
  handle_cast(Request, #state{} = State) ->
      ?log_bad_request(Request),
      {noreply, State}.
  