private void HandleMutationBy(MutationPacket mutationPacket, Guid requester) { if (!TryApply(mutationPacket, out Mutation mutation, out MutationResult result)) { if (requester.Equals(Guid.Empty)) { log.Warning($"Mutation[{mutationPacket.GetId()}] failed. Reason: {result.GetFailureReason()}. Details: {mutation.GetType().Name} on fragment[{fragmentKeyFactory.FromBytes(mutationPacket.GetKey()).AsString()}].\nStackTrace: {Environment.StackTrace}"); SafeInvoker.Invoke(log, OnMutationFailedCallback, mutationPacket.GetId(), result.GetFailureReason()); } else { server.Send(requester, new MutationFailedPacket(mutationPacket.GetId(), result.GetFailureReason())); } return; } server.Broadcast(mutationPacket); }
protected override void Request(MutationPacket mutationPacket, Mutation mutation) { client.Send(mutationPacket); pending.Add(mutationPacket.GetId(), $"{mutation.GetType().Name} on fragment[{fragmentKeyFactory.FromBytes(mutationPacket.GetKey()).AsString()}].\nStackTrace: {Environment.StackTrace}"); }