anchor.diff:      ?assertMatch({ok, _}, lfm_proxy:stat(P1, SessId(P1), {guid, FileGuid}), ?ATTEMPTS),
       ?assertMatch({ok, _}, write_to_file(P1, SessId(P1), {guid, FileGuid}, 0, crypto:strong_rand_bytes(SpaceSize))),
       ?assertMatch(0, available_size(SupportingProvider, SpaceId), ?ATTEMPTS),
  -    
  +
       ExpectedMessage = #'ServerMessage'{
           message_body = {events, #'Events'{
               events = [#'Event'{
  
positive.code: 
      SpaceSize = available_size(SupportingProvider, SpaceId),
      RootGuid = fslogic_uuid:spaceid_to_space_dir_guid(SpaceId),
      
      {ok, {Conn, _}} = fuse_test_utils:connect_via_macaroon(P1, [{active, true}], SessId(P1)),
      SubId = rpc:call(P1, subscription,  generate_id, [<<"quota_exceeded">>]),
      rpc:call(P1, event, subscribe, [#subscription{id = SubId, type = #quota_exceeded_subscription{}}, SessId(P1)]),
  
negative.code: replicate_file_smaller_than_quota_should_not_fail(Config) ->
      #env{p1 = P1, p2 = P2, file1 = File1} =
          gen_test_env(Config),
      SessId = fun(Worker) ->
          ?config({session_id, {<<"user1">>, ?GET_DOMAIN(Worker)}}, Config) end,
  
      {ok, Guid} = create_file(P1, SessId(P1), f(<<"space3">>, File1)),
      ?assertMatch({ok, _}, write_to_file(P1, SessId(P1), f(<<"space3">>, File1), 0, crypto:strong_rand_bytes(20))),
      ?assertMatch({ok, [#{<<"totalBlocksSize">> := 20}]},
          lfm_proxy:get_file_distribution(P2, SessId(P2), {guid, Guid}), ?ATTEMPTS),
  
      {ok, Tid} = lfm_proxy:schedule_file_replication(P1, SessId(P1), {guid, Guid}, ?GET_DOMAIN_BIN(P2)),
  
      % wait for replication to finish
      ?assertMatch({ok, []}, rpc:call(P1, transfer, list_waiting_transfers, [<<"space_id3">>]), ?ATTEMPTS),
      ?assertMatch({ok, []}, rpc:call(P1, transfer, list_ongoing_transfers, [<<"space_id3">>]), ?ATTEMPTS),
      ?assertEqual(true, lists:member(Tid, list_ended_transfers(P1, <<"space_id3">>)), ?ATTEMPTS),
  
      ?assertMatch({ok, [#{<<"totalBlocksSize">> := 20}, #{<<"totalBlocksSize">> := 20}]},
          lfm_proxy:get_file_distribution(P2, SessId(P2), {guid, Guid}), ?ATTEMPTS),
  
      ok = fsync(P2, SessId(P2), f(<<"space3">>, File1)),
      ?assertEqual(20, current_size(P1, <<"space_id3">>), ?ATTEMPTS),
  