anchor.diff:  %% 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{
  +-spec send_change(req(), datastore:doc(), map()) -> ok.
  +send_change(Req, ChangedDoc = #document{
       seq = Seq,
       key = FileUuid,
       value = #custom_metadata{}
  -}) ->
  -    send_changes(Req, Seq, FileUuid, SpaceId, ChangedDoc, ChangesReqs);
  -
  -send_change(Req, SpaceId, ChangesReqs, ChangedDoc = #document{
  +}, State) ->
  +    send_changes(Req, Seq, FileUuid, ChangedDoc, State);
  +
  +send_change(Req, ChangedDoc = #document{
       seq = Seq,
       key = FileUuid,
       value = #times{}
  -}) ->
  -    send_changes(Req, Seq, FileUuid, SpaceId, ChangedDoc, ChangesReqs);
  -
  -send_change(Req, SpaceId, ChangesReqs, ChangedDoc = #document{
  +}, State) ->
  +    send_changes(Req, Seq, FileUuid, ChangedDoc, State);
  +
  +send_change(Req, ChangedDoc = #document{
       seq = Seq,
       value = #file_location{uuid = FileUuid}
  -}) ->
  -    send_changes(Req, Seq, FileUuid, SpaceId, ChangedDoc, ChangesReqs);
  -
  -send_change(Req, SpaceId, ChangesReqs, ChangedDoc = #document{
  +}, State) ->
  +    send_changes(Req, Seq, FileUuid, ChangedDoc, State);
  +
  +send_change(Req, ChangedDoc = #document{
       seq = Seq,
       key = FileUuid,
       value = #file_meta{}
  -}) ->
  -    send_changes(Req, Seq, FileUuid, SpaceId, ChangedDoc, ChangesReqs).
  +}, State) ->
  +    send_changes(Req, Seq, FileUuid, ChangedDoc, State).
   
   
   %% @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
  +    datastore:doc(), map()) -> ok.
  +send_changes(Req, Seq, FileUuid, ChangedDoc, State) ->
  +    case get_all_docs_changes(FileUuid, ChangedDoc, State) of
           Changes when map_size(Changes) == 0 ->
               ok;
           Changes ->
               FileId =
                   try
                       {ok, Val} = file_id:guid_to_objectid(file_id:pack_guid(
  -                        FileUuid, SpaceId
  +                        FileUuid, maps:get(space_id, State)
                       )),
                       Val
                   catch
  
positive.code:     mutators = Mutators,
      deleted = Deleted,
      value = #file_meta{} = Record
  }) ->
      Fields = lists:foldl(
          fun
              ({<<"name">>, _FieldIndex}, Acc) ->
                  Auth = get(auth),
                  SpaceId = get(space_id),
                  SpaceUuid = fslogic_uuid:spaceid_to_space_dir_uuid(SpaceId),
                  Name = case FileUuid =:= SpaceUuid of
                      true ->
  
negative.code:     mutators = Mutators,
      deleted = Deleted,
      value = Record
  }, _State) ->
      Fields = lists:foldl(fun({FieldName, FieldIndex}, Acc) ->
          Acc#{FieldName => element(FieldIndex, Record)}
      end, #{}, FieldsNamesAndIndexes),
  