{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/botbuilder-js/issues/119","repository_url":"https://api.github.com/repos/Microsoft/botbuilder-js","labels_url":"https://api.github.com/repos/Microsoft/botbuilder-js/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/botbuilder-js/issues/119/comments","events_url":"https://api.github.com/repos/Microsoft/botbuilder-js/issues/119/events","html_url":"https://github.com/Microsoft/botbuilder-js/issues/119","id":305748446,"node_id":"MDU6SXNzdWUzMDU3NDg0NDY=","number":119,"title":"make Activity a discriminated type union","user":{"login":"billba","id":11050679,"node_id":"MDQ6VXNlcjExMDUwNjc5","avatar_url":"https://avatars3.githubusercontent.com/u/11050679?v=4","gravatar_id":"","url":"https://api.github.com/users/billba","html_url":"https://github.com/billba","followers_url":"https://api.github.com/users/billba/followers","following_url":"https://api.github.com/users/billba/following{/other_user}","gists_url":"https://api.github.com/users/billba/gists{/gist_id}","starred_url":"https://api.github.com/users/billba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billba/subscriptions","organizations_url":"https://api.github.com/users/billba/orgs","repos_url":"https://api.github.com/users/billba/repos","events_url":"https://api.github.com/users/billba/events{/privacy}","received_events_url":"https://api.github.com/users/billba/received_events","type":"User","site_admin":false},"labels":[{"id":841116805,"node_id":"MDU6TGFiZWw4NDExMTY4MDU=","url":"https://api.github.com/repos/Microsoft/botbuilder-js/labels/dcr","name":"dcr","color":"591faf","default":false},{"id":832745342,"node_id":"MDU6TGFiZWw4MzI3NDUzNDI=","url":"https://api.github.com/repos/Microsoft/botbuilder-js/labels/discussion","name":"discussion","color":"800080","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-15T23:01:19Z","updated_at":"2018-08-16T22:18:55Z","closed_at":"2018-08-16T22:18:55Z","author_association":"MEMBER","body":"Currently `Activity` is an interface of a million optional properties. Issues with this:\r\n* TypeScript doesn't tell you which properties do or not apply to a given activity type. This means you could reference `context.request.text` for a `typing` activity, which is not valid.\r\n* Because most properties are optional, in TypeScript's strict mode (which is now the default) you need to resort to the \"non-null assertion operator\" (e.g. `context.request.members!` for `conversationUpdate` activities)\r\n\r\nThe simple solution is to make `Activity` a discriminated type union.\r\n\r\nA lot of this work has already been done over in [DirectLineJS](https://github.com/Microsoft/BotFramework-DirectLineJS/blob/master/src/directLine.ts#L230). It would need to be updated with missing pieces."}}
{"actor":{"display_login":"sgellock"}}