anchor.diff:          {ok, []} ->
               {ok, _CreatedDocUuid} = create_file_location_for_remote_file(FullFileName, FileId),
               case dao_lib:apply(dao_vfs, get_file_locations, [FileId], fslogic_context:get_protocol_version()) of
  -                {ok, [_]} ->
  -                    ?info("NO CONFLICT, LOCATION CREATED"),
  -                    ok; %todo this assumes each file has at most one file_location
  +                {ok, [_]} -> ok; %todo this assumes each file has at most one file_location
                   {ok, [#db_document{uuid = FirstUuid} | _] = Docs} ->
  -                    ?info("CONFLICT DETECTED ~p", [Docs]),
                       MinimalUuid = lists:foldl(
                           fun(#db_document{uuid = Uuid}, MinUuid) when Uuid < MinUuid -> Uuid;
                              (_, MinUuid) -> MinUuid
  
positive.code:                         fun(#db_document{uuid = Uuid, record = #file_location{storage_file_id = StorageFileId, storage_uuid = StorageUuid}}) ->
                              {ok, #db_document{record = Storage}} = fslogic_objects:get_storage({uuid, StorageUuid}),
                              {SH, _} = fslogic_utils:get_sh_and_id(?CLUSTER_FUSE_ID, Storage, StorageFileId),
                              ?info("DELETING FROM STORAGE ~s, sh ~p", [StorageFileId, SH]),
                              ok = storage_files_manager:delete(SH, StorageFileId),
                              ok = dao_lib:apply(dao_vfs, remove_file_location, [Uuid], fslogic_context:get_protocol_version())
                          end, ToDelete)
  
negative.code: %% ====================================================================
  
  create_file_location_for_remote_file(FullFileName, FileUuid) ->
      {ok, #space_info{space_id = SpaceId} = SpaceInfo} = fslogic_utils:get_space_info_for_path(FullFileName),
      {ok, UserDoc} = fslogic_objects:get_user(),
      FileBaseName = fslogic_path:get_user_file_name(FullFileName, UserDoc),
      {ok, StorageList} = dao_lib:apply(dao_vfs, list_storage, [], fslogic_context:get_protocol_version()),
      #db_document{uuid = UUID, record = #storage_info{} = Storage} = fslogic_storage:select_storage(?CLUSTER_FUSE_ID, StorageList),
      SHI = fslogic_storage:get_sh_for_fuse(?CLUSTER_FUSE_ID, Storage),
      FileId = fslogic_storage:get_new_file_id(SpaceInfo, FileBaseName, UserDoc, SHI, fslogic_context:get_protocol_version()),
      FileLocation = #file_location{file_id = FileUuid, storage_uuid = UUID, storage_file_id = FileId},
      {ok, LocationId} = dao_lib:apply(dao_vfs, save_file_location, [FileLocation], fslogic_context:get_protocol_version()),
  %%     _FuseFileBlocks = [#filelocation_blockavailability{offset = 0, size = ?FILE_BLOCK_SIZE_INF}],
  %%     FileBlock = #file_block{file_location_id = LocationId, offset = 0, size = ?FILE_BLOCK_SIZE_INF},
  %%     {ok, _} = dao_lib:apply(dao_vfs, save_file_block, [FileBlock], fslogic_context:get_protocol_version()),
      {SH, StorageFileId} = fslogic_utils:get_sh_and_id(?CLUSTER_FUSE_ID, Storage, FileId, SpaceId, false),
      ok = storage_files_manager:create(SH, StorageFileId),
      {ok, {LocationId, StorageFileId}}.
  