{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/BotBuilder-Samples/issues/43","repository_url":"https://api.github.com/repos/Microsoft/BotBuilder-Samples","labels_url":"https://api.github.com/repos/Microsoft/BotBuilder-Samples/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/BotBuilder-Samples/issues/43/comments","events_url":"https://api.github.com/repos/Microsoft/BotBuilder-Samples/issues/43/events","html_url":"https://github.com/Microsoft/BotBuilder-Samples/issues/43","id":197946566,"number":43,"title":"Context.Call doesn't call Dialog's StartAsync","user":{"login":"michaelsrichter","id":1242059,"avatar_url":"https://avatars.githubusercontent.com/u/1242059?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelsrichter","html_url":"https://github.com/michaelsrichter","followers_url":"https://api.github.com/users/michaelsrichter/followers","following_url":"https://api.github.com/users/michaelsrichter/following{/other_user}","gists_url":"https://api.github.com/users/michaelsrichter/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsrichter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsrichter/subscriptions","organizations_url":"https://api.github.com/users/michaelsrichter/orgs","repos_url":"https://api.github.com/users/michaelsrichter/repos","events_url":"https://api.github.com/users/michaelsrichter/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsrichter/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-29T03:03:38Z","updated_at":"2016-12-29T18:41:30Z","closed_at":"2016-12-29T03:33:07Z","body":"I have the following code in my rootDialog (see below). I am detecting if a user has a profile set up in UserData, if not, I want them to go to the BotUserProfile dialog. There is a series of DialogPrompts in that Dialog, so I need to use Context.Call (not Context.Forward).\r\n\r\nThe problem is that when I call Context.Call from MessageReceivedAsync, it **does not** appear to call StartAsync in the child dialog. In fact, it's not clear to me how any methods get called in the child dialog and all the examples of Context.Call that I can find are for FormFlow, not custom dialogs.  Context.Call appears to just immediately return the ResumeAfter callback.\r\n\r\nBUT, If I move that Context.Call code into the RootDialog's StartAsync, then Context.Call **does** call the child dialog's StartAsync.  This wont work for me as StartAsync is called once per conversation, and I need this check to be performed on every message sent. \r\n\r\nThanks for any help.\r\n\r\n        public async Task StartAsync(IDialogContext context)\r\n        {\r\n            context.Wait(this.MessageReceivedAsync);\r\n        }\r\n\r\n        public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> result)\r\n        {\r\n\r\n            BotUserProfile botUserProfile;\r\n\r\n            if (!context.UserData.TryGetValue(\"botUserProfile\", out botUserProfile))\r\n            {\r\n                if (botUserProfile == null)\r\n                {\r\n                    try\r\n                    {\r\n                        //this doesn't seem to be calling _botUserProfileDialog's StartAsync\r\n                        context.Call(_botUserProfileDialog, ResumeAfterDialog);\r\n                    }\r\n                    catch (Exception e)\r\n                    {\r\n\r\n                        await context.PostUpAsync(e.ToString());\r\n                    }\r\n                }\r\n                else\r\n                {\r\n                    {\r\n                        if (botUserProfile.ActiveUntil < DateTime.UtcNow)\r\n                        {\r\n                            context.UserData.RemoveValue(\"botUserProfile\");\r\n                            context.Call(_botUserProfileDialog, ResumeAfterDialog);\r\n                        }\r\n                    }\r\n                }\r\n                ...\r\n            }"},"comment":{"url":"https://api.github.com/repos/Microsoft/BotBuilder-Samples/issues/comments/269673739","html_url":"https://github.com/Microsoft/BotBuilder-Samples/issues/43#issuecomment-269673739","issue_url":"https://api.github.com/repos/Microsoft/BotBuilder-Samples/issues/43","id":269673739,"user":{"login":"willportnoy","id":17912714,"avatar_url":"https://avatars.githubusercontent.com/u/17912714?v=3","gravatar_id":"","url":"https://api.github.com/users/willportnoy","html_url":"https://github.com/willportnoy","followers_url":"https://api.github.com/users/willportnoy/followers","following_url":"https://api.github.com/users/willportnoy/following{/other_user}","gists_url":"https://api.github.com/users/willportnoy/gists{/gist_id}","starred_url":"https://api.github.com/users/willportnoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willportnoy/subscriptions","organizations_url":"https://api.github.com/users/willportnoy/orgs","repos_url":"https://api.github.com/users/willportnoy/repos","events_url":"https://api.github.com/users/willportnoy/events{/privacy}","received_events_url":"https://api.github.com/users/willportnoy/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T18:41:30Z","updated_at":"2016-12-29T18:41:30Z","body":"I'm happy to hear you found the issue.  By the way, you might find a more active forum at https://github.com/Microsoft/BotBuilder/issues."}}
{"actor":{"display_login":"willportnoy"}}