Search code examples
azurebotframeworkbots

Why does my Azure Web App Bot work fine in some Channels but not in Facebook or "Test in Web Chat"


We had our bot up and running fine on our website and in our mobile app but it just stopped working with Facebook one day. Once we started looking into it we found out Facebook wasnt the only channel broken but the "Test in Web Client" withen Azure Portal was broken as well.

Soon as the bot launched all you received was the default error in code message.

After some digging we found the error was

Error resolving type specified in JSON ‘ChatBot.DialogServiceInterfaces.Models.UserProfileData, ChatBot.DialogServiceInterfaces’. Path ‘UserProfileData.$type’.

What would cause this error?


Solution

  • So a big difference between the "Facebook" \"Test in web client" and the desktop emulator \ Web Channel is that the first two Authenticate AutoMagically using the token already established either a facebook token or an Microsoft Token accordingly. When the Botframework recognizes an Identity it will attempt to restore the previous session. At least to whatever extent that session might have been persisted. If theres a problem with the recovery of that information it can cause those channels to fail while other channels work fine.

    In our case we changed the location of our UserProfileData class. When the Framework went to rehydrate the class it couldnt find it to hydrate it so it lost its mind and and threw that message.