{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-mobile-apps-net-files-client/issues/61","repository_url":"https://api.github.com/repos/Azure/azure-mobile-apps-net-files-client","labels_url":"https://api.github.com/repos/Azure/azure-mobile-apps-net-files-client/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-mobile-apps-net-files-client/issues/61/comments","events_url":"https://api.github.com/repos/Azure/azure-mobile-apps-net-files-client/issues/61/events","html_url":"https://github.com/Azure/azure-mobile-apps-net-files-client/pull/61","id":157128654,"number":61,"title":"Managed API first pass","user":{"login":"danderson00","id":1265935,"avatar_url":"https://avatars.githubusercontent.com/u/1265935?v=3","gravatar_id":"","url":"https://api.github.com/users/danderson00","html_url":"https://github.com/danderson00","followers_url":"https://api.github.com/users/danderson00/followers","following_url":"https://api.github.com/users/danderson00/following{/other_user}","gists_url":"https://api.github.com/users/danderson00/gists{/gist_id}","starred_url":"https://api.github.com/users/danderson00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danderson00/subscriptions","organizations_url":"https://api.github.com/users/danderson00/orgs","repos_url":"https://api.github.com/users/danderson00/repos","events_url":"https://api.github.com/users/danderson00/events{/privacy}","received_events_url":"https://api.github.com/users/danderson00/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Azure/azure-mobile-apps-net-files-client/labels/cla-not-required","name":"cla-not-required","color":"009800"},{"url":"https://api.github.com/repos/Azure/azure-mobile-apps-net-files-client/labels/in%20progress","name":"in progress","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-27T04:39:29Z","updated_at":"2016-05-31T20:01:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Azure/azure-mobile-apps-net-files-client/pulls/61","html_url":"https://github.com/Azure/azure-mobile-apps-net-files-client/pull/61","diff_url":"https://github.com/Azure/azure-mobile-apps-net-files-client/pull/61.diff","patch_url":"https://github.com/Azure/azure-mobile-apps-net-files-client/pull/61.patch"},"body":"This is the first pass at the alternate API, calling it \"Managed\". A big PR, but I will add comments to relevant sections in code files to explain what is going on. No existing functionality was harmed in the making of this PR.\r\n\r\nChanges to the consumer API are almost entirely focused around *extension methods* on the `MobileServiceSyncTable<T>` class. After filling a couple of gaps, the existing online (`MobileServiceTable<T>`) version of the API already does what I envisaged.\r\n\r\nSome important things for discussion\r\n- by necessity, this replaces the existing API, i.e. consumers cannot import both the `MobileServices.Files` and `MobileServices.Files.Managed` namespaces\r\n  - some extension methods have been reimplemented with the same signature - this would cause collisions. For example, DeleteFileAsync needs to delete the file from the local file system\r\n  - invoking methods from the existing API could break stuff (e.g. AddFileSync - this won't add the file to the local store, breaking pushes)\r\n  - keeping the API isolated is good anyway\r\n  - the whole not being able to import both namespaces is an issue, but I don't know a better way since we are using extension methods. There may be a better way.\r\n- for some strange reason, the Azure storage library only exposes a method DownloadToStream that accepts a writeable stream instead of returning a readable stream (like other good citizens, e.g. HttpResponse)\r\n  - currently, I'm just loading this into a MemoryStream and resetting the position to 0, but this is horribly inefficient\r\n  - we need to be able to just stream the data correctly to the consumer (e.g. image viewer), i.e. provide it a readable stream\r\n  - I can't find any \"DuplexStream\" or \"BufferStream\" that will do the job\r\n  - WTF\r\n\r\nThere are now three end to end scenarios that do basic validation in various scenarios:\r\n- vanilla online\r\n- vanilla offline\r\n- managed offline\r\n\r\nI'll show you how to run these. Adding doco is todo.\r\n\r\n#### Remaining tasks\r\n- efficiently pipe write stream to read stream\r\n- add reasonable default storage locations for each platform\r\n- make stored filename configurable / overridable\r\n- more tests\r\n- documentation on how to run tests\r\n- xmldoc\r\n- other things I can't recall right now"},"comment":{"url":"https://api.github.com/repos/Azure/azure-mobile-apps-net-files-client/issues/comments/222802852","html_url":"https://github.com/Azure/azure-mobile-apps-net-files-client/pull/61#issuecomment-222802852","issue_url":"https://api.github.com/repos/Azure/azure-mobile-apps-net-files-client/issues/61","id":222802852,"user":{"login":"fabiocav","id":2507935,"avatar_url":"https://avatars.githubusercontent.com/u/2507935?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiocav","html_url":"https://github.com/fabiocav","followers_url":"https://api.github.com/users/fabiocav/followers","following_url":"https://api.github.com/users/fabiocav/following{/other_user}","gists_url":"https://api.github.com/users/fabiocav/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiocav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiocav/subscriptions","organizations_url":"https://api.github.com/users/fabiocav/orgs","repos_url":"https://api.github.com/users/fabiocav/repos","events_url":"https://api.github.com/users/fabiocav/events{/privacy}","received_events_url":"https://api.github.com/users/fabiocav/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T20:01:43Z","updated_at":"2016-05-31T20:01:43Z","body":"Took a first quick pass with some minor comments. I should have read your PR description more carefully as it would have saved me from asking some of the questions.\r\nFor the two main discussion points you had above:\r\n1- I like the approach, looks like you were able to fit it in pretty nicely\r\n2- As discussed, the use of `OpenReadAsync` (and required changes) should address this, so we should be good"}}
{"actor":{"display_login":"fabiocav"}}