botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Any update for "Proactive messages not delivered if SFB window is closed" problem?

Open band888888 opened this issue 8 years ago • 2 comments

Bot Info

  • SDK Platform: .Net
  • SDK Version: 3.12.2.4
  • Active Channels: Skype for Business
  • Deployment Environment: Azure Bot Service, Azure App Service

Issue Description

Bot have been integrated in to Skype for business channel. There is a proactive API on the bot. It's could be called by out side system. When trggier this API will send the proactive message to the user.

However when the user close the chat window the message could not reach any more.Below are the error details.

##Error details

Error details: Microsoft.Rest.HttpOperationException: Conversation does not exist at Microsoft.Bot.Connector.ErrorHandling.d__2`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Bot.Connector.ConversationsExtensions.d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at GDCNaNa.Controllers.NotificationController.d__1.MoveNext()

Code Example

            var userAccount = para.recipient;
            var botAccount = para.fromAccount;
            var connector = new ConnectorClient(new Uri(para.url));

            IMessageActivity message = Activity.CreateMessageActivity();

            string conversationId= para.ConversationID;
            if (!string.IsNullOrEmpty(para.ConversationID) && !string.IsNullOrEmpty(para.ChannelId))
            {
                message.ChannelId = para.ChannelId;
            }
            else
            {
                conversationId = (await connector.Conversations.CreateDirectConversationAsync(botAccount, userAccount)).Id;
            }


            message.ChannelId = para.ChannelId;

            message.From = botAccount;
            message.Recipient = userAccount;
            message.Conversation = new ConversationAccount(id: conversationId);
            
            message.Text = para.topic;
            message.Locale = "en-Us";
            await connector.Conversations.SendToConversationAsync((Activity)message);

           

            var resp = new HttpResponseMessage(HttpStatusCode.OK);
            resp.Content = new StringContent($"<html><body>Message sent, thanks.</body></html>", System.Text.Encoding.UTF8, @"text/html");
            return resp;

Expected Behavior

I think the behavior should be: when user status are not offline should be pop up the window with the message.

Actual Results

Error in the proactive API step.

##Comment Also i saw the same issues raise by our @anujaparikh23 @intranetchris @v46 experts before. #3749 #3636.

Now i try to use the skype web sdk to approch the requirement temporary. However it's much more complicate.

Grateful if you could give me any suggestion or update for this issue. @JasonSowers @nwhitmont @EricDahlvang @fanidamj

band888888 avatar Jan 30 '18 07:01 band888888

You will need to talk to SFB about that. https://www.skypefeedback.com/

JasonSowers avatar Jan 30 '18 17:01 JasonSowers

Thanks @JasonSowers reply.

Folks: @anujaparikh23 @intranetchris @v46

I post the issue on the Skype for business feedback. Please raise me up. Let's them to see the problem. Skype for business Issue feedback voting

Thank you very much.

band888888 avatar Jan 31 '18 08:01 band888888