{"action":"created","issue":{"url":"https://api.github.com/repos/Faithlife/FaithlifeUtility/issues/17","repository_url":"https://api.github.com/repos/Faithlife/FaithlifeUtility","labels_url":"https://api.github.com/repos/Faithlife/FaithlifeUtility/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/Faithlife/FaithlifeUtility/issues/17/comments","events_url":"https://api.github.com/repos/Faithlife/FaithlifeUtility/issues/17/events","html_url":"https://github.com/Faithlife/FaithlifeUtility/pull/17","id":295667799,"number":17,"title":"Don't delegate WrappingStream.CopyToAsync().","user":{"login":"ddunkin","id":264744,"avatar_url":"https://avatars2.githubusercontent.com/u/264744?v=4","gravatar_id":"","url":"https://api.github.com/users/ddunkin","html_url":"https://github.com/ddunkin","followers_url":"https://api.github.com/users/ddunkin/followers","following_url":"https://api.github.com/users/ddunkin/following{/other_user}","gists_url":"https://api.github.com/users/ddunkin/gists{/gist_id}","starred_url":"https://api.github.com/users/ddunkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddunkin/subscriptions","organizations_url":"https://api.github.com/users/ddunkin/orgs","repos_url":"https://api.github.com/users/ddunkin/repos","events_url":"https://api.github.com/users/ddunkin/events{/privacy}","received_events_url":"https://api.github.com/users/ddunkin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-08T21:14:50Z","updated_at":"2018-02-09T17:25:35Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/Faithlife/FaithlifeUtility/pulls/17","html_url":"https://github.com/Faithlife/FaithlifeUtility/pull/17","diff_url":"https://github.com/Faithlife/FaithlifeUtility/pull/17.diff","patch_url":"https://github.com/Faithlife/FaithlifeUtility/pull/17.patch"},"body":"The default implementation calls ReadAsync, which will delegate. A class that inherits from WrappingStream and overrides ReadAsync but not CopyToAsync, e.g. TruncatedStream, will not behave as expected."},"comment":{"url":"https://api.github.com/repos/Faithlife/FaithlifeUtility/issues/comments/364500610","html_url":"https://github.com/Faithlife/FaithlifeUtility/pull/17#issuecomment-364500610","issue_url":"https://api.github.com/repos/Faithlife/FaithlifeUtility/issues/17","id":364500610,"user":{"login":"bgrainger","id":188129,"avatar_url":"https://avatars2.githubusercontent.com/u/188129?v=4","gravatar_id":"","url":"https://api.github.com/users/bgrainger","html_url":"https://github.com/bgrainger","followers_url":"https://api.github.com/users/bgrainger/followers","following_url":"https://api.github.com/users/bgrainger/following{/other_user}","gists_url":"https://api.github.com/users/bgrainger/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrainger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrainger/subscriptions","organizations_url":"https://api.github.com/users/bgrainger/orgs","repos_url":"https://api.github.com/users/bgrainger/repos","events_url":"https://api.github.com/users/bgrainger/events{/privacy}","received_events_url":"https://api.github.com/users/bgrainger/received_events","type":"User","site_admin":false},"created_at":"2018-02-09T17:25:35Z","updated_at":"2018-02-09T17:25:35Z","author_association":"OWNER","body":"The ultimate problem here is that `TruncatedStream` bases its implementation on a class that is designed to forward *all* operations to the wrapped stream, and it has to be 100% sure to override all of them.\r\n\r\nIt would have been safer to throw `NotSupportedException` (in `WrappingStream`) by default and make derived types override the methods they want to support. (Then we could have added a `PassThroughWrappingStream` that did delegate all methods, for cases when that's needed. Or perhaps keep `WrappingStream` as-is and introduce a new `WrappingStreamBase` that doesn't delegate.)\r\n\r\nThe right fix here is to fix `TruncatedStream` (and any other classes derived from `WrappingStream`) that shouldn't just pass through the `CopyAsync` method."}}
{"actor":{"display_login":"bgrainger"}}