anchor.diff:  -spec stream_loop(req(), maps:map()) -> ok.
   stream_loop(Req, State = #{
       timeout := Timeout,
  -    ref := Ref,
  -    space_id := SpaceId,
  -    changes_reqs := ChangesReqs
  +    ref := Ref
   }) ->
       receive
           {Ref, stream_ended} ->
               ok;
           {Ref, #document{} = ChangedDoc} ->
               try
  -                send_change(Req, SpaceId, ChangesReqs, ChangedDoc)
  +                send_change(Req, ChangedDoc, State)
               catch
                   _:E ->
                       % Can appear when document connected with deleted file_meta appears
  
positive.code: %% Parse and send change received from db stream, to the client.
  %% @end
  %%--------------------------------------------------------------------
  -spec send_change(req(), od_space:id(), [change_req()], datastore:doc()) -> ok.
  send_change(Req, SpaceId, ChangesReqs, ChangedDoc = #document{
      seq = Seq,
      key = FileUuid,
      value = #custom_metadata{}
  }) ->
      send_changes(Req, Seq, FileUuid, SpaceId, ChangedDoc, ChangesReqs);
  
  send_change(Req, SpaceId, ChangesReqs, ChangedDoc = #document{
      seq = Seq,
      key = FileUuid,
      value = #times{}
  }) ->
      send_changes(Req, Seq, FileUuid, SpaceId, ChangedDoc, ChangesReqs);
  
  send_change(Req, SpaceId, ChangesReqs, ChangedDoc = #document{
      seq = Seq,
      value = #file_location{uuid = FileUuid}
  }) ->
      send_changes(Req, Seq, FileUuid, SpaceId, ChangedDoc, ChangesReqs);
  
  send_change(Req, SpaceId, ChangesReqs, ChangedDoc = #document{
      seq = Seq,
      key = FileUuid,
      value = #file_meta{}
  }) ->
      send_changes(Req, Seq, FileUuid, SpaceId, ChangedDoc, ChangesReqs).
  
  
  %% @private
  -spec send_changes(req(), datastore_doc:seq(), file_meta:uuid(),
      od_space:id(), datastore:doc(), [change_req()]) -> ok.
  send_changes(Req, Seq, FileUuid, SpaceId, ChangedDoc, ChangesReqs) ->
      case get_all_docs_changes(ChangesReqs, FileUuid, ChangedDoc) of
          Changes when map_size(Changes) == 0 ->
              ok;
          Changes ->
              FileId =
                  try
                      {ok, Val} = file_id:guid_to_objectid(file_id:pack_guid(
                          FileUuid, SpaceId
                      )),
                      Val
                  catch
  
negative.code:     mutators = Mutators,
      deleted = Deleted,
      value = Record
  }, _State) ->
      Fields = lists:foldl(fun({FieldName, FieldIndex}, Acc) ->
          Acc#{FieldName => element(FieldIndex, Record)}
      end, #{}, FieldsNamesAndIndexes),
  