{"action":"created","issue":{"url":"https://api.github.com/repos/ServiceStack/Issues/issues/250","labels_url":"https://api.github.com/repos/ServiceStack/Issues/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/ServiceStack/Issues/issues/250/comments","events_url":"https://api.github.com/repos/ServiceStack/Issues/issues/250/events","html_url":"https://github.com/ServiceStack/Issues/issues/250","id":60974289,"number":250,"title":"Batched request dont work using async service handler","user":{"login":"malat","id":3868621,"avatar_url":"https://avatars.githubusercontent.com/u/3868621?v=3","gravatar_id":"","url":"https://api.github.com/users/malat","html_url":"https://github.com/malat","followers_url":"https://api.github.com/users/malat/followers","following_url":"https://api.github.com/users/malat/following{/other_user}","gists_url":"https://api.github.com/users/malat/gists{/gist_id}","starred_url":"https://api.github.com/users/malat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malat/subscriptions","organizations_url":"https://api.github.com/users/malat/orgs","repos_url":"https://api.github.com/users/malat/repos","events_url":"https://api.github.com/users/malat/events{/privacy}","received_events_url":"https://api.github.com/users/malat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-03-13T03:39:52Z","updated_at":"2015-03-14T23:10:13Z","closed_at":"2015-03-13T22:57:56Z","body":"\r\nBatched request seems to failed when the service handler is async\r\n\r\n\r\n```csharp\r\n\r\n[Route(\"/batch/async\")]\r\n    public class AsyncBatchRequest : IReturn<BatchResult>\r\n    {\r\n        public Guid Id { get; set; }\r\n    }\r\n\r\n    public class BatchResult\r\n    {\r\n        public Guid Id { get; set; }\r\n    }\r\n\r\n    public class AsyncBatchService : IService\r\n    {\r\n        public Task<BatchResult> Any(AsyncBatchRequest request)\r\n        {\r\n            return Task.FromResult(new BatchResult\r\n            {\r\n                Id = request.Id\r\n            });\r\n        }\r\n    }\r\n\r\n```\r\n\r\nFailing test\r\n\r\n```csharp\r\npublic class AsyncBatchTests\r\n    {\r\n        public async Task BatchRequestShouldWorkWithAsyncHandler()\r\n        {\r\n            var client = new JsonServiceClient(\"http://localhost:52784/\");\r\n            var batch = new[] { new AsyncBatchRequest { Id = Guid.NewGuid() }, new AsyncBatchRequest { Id = Guid.NewGuid() } };\r\n\r\n            var results = await client.SendAllAsync(batch);\r\n            var guids = results.Select(r => r.Id);\r\n\r\n            Assert.IsTrue(guids.SequenceEqual(batch.Select(b => b.Id)));\r\n        }\r\n    }\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/ServiceStack/Issues/issues/comments/80757401","html_url":"https://github.com/ServiceStack/Issues/issues/250#issuecomment-80757401","issue_url":"https://api.github.com/repos/ServiceStack/Issues/issues/250","id":80757401,"user":{"login":"malat","id":3868621,"avatar_url":"https://avatars.githubusercontent.com/u/3868621?v=3","gravatar_id":"","url":"https://api.github.com/users/malat","html_url":"https://github.com/malat","followers_url":"https://api.github.com/users/malat/followers","following_url":"https://api.github.com/users/malat/following{/other_user}","gists_url":"https://api.github.com/users/malat/gists{/gist_id}","starred_url":"https://api.github.com/users/malat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malat/subscriptions","organizations_url":"https://api.github.com/users/malat/orgs","repos_url":"https://api.github.com/users/malat/repos","events_url":"https://api.github.com/users/malat/events{/privacy}","received_events_url":"https://api.github.com/users/malat/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T23:10:13Z","updated_at":"2015-03-14T23:10:13Z","body":"\r\nGreat I have update and everything seems ok but now I realize that we got other issue using the auto batched feature... If one of the handler is raising a exception the client will receive a mix of good and exception response, and will not be able to deserialize the response... any workaround for that ?\r\n\r\nAlso is there a way to know if the current request processing pipeline is a AutoBatched one ? Maybe I could used this to dynamically disable GZIP at the service level...\r\n\r\nAnd last did SS has any hook to let me transform the entire response ? a kind of GlobalResponseFilter that allowed to modify the response but at the transport level... I know I could properly do that in a custom http module but I will prefer to use SS if I can\r\n\r\nThanks again for your thoughts\r\n\r\n"}}