Update 3.13.0.3 breaks FormFlow .Field using enum
Bot Info
- SDK Platform: .NET
- SDK Version: 3.12.2.4
- Active Channels: None
- Deployment Environment: Local development with Emulator
Issue Description
I'm doing simple FormFlow with just 3 input and save responses to UserData (stored using local CosmosDB simulator). First input is from enum (Yes or No), indicating whether to proceed or not. The other two are strings and SetActive depending on the first input button selection. The first input is not saved to UserData, only the two strings are saved.
Update to 3.13.0.3. Start debug and cannot even start the conversation, 500 Internal Server Error. I delete botdb database in the CosmosDB simulator and I can start conversation. Now the
Now, running 3.13.0.3. all choices from enum not working.
One more, UserData created using 3.12.2.4 is not compatible with 3.13.0.3?
Code Example (with issue)
public enum AddOfficial { Yes = 1, No = 2 }
[Serializable]
public class OfficialInfo
{
public TextLabels.AddOfficial? AskAddOfficial { get; set; }
public string OfficialName { get; set; }
public string OfficialID { get; set; }
public static IForm<OfficialInfo> BuildForm()
{
return new FormBuilder<OfficialInfo>()
.Field(new FieldReflector<OfficialInfo>(nameof(AskAddOfficial))
.SetPrompt(new PromptAttribute(TextLabels.PromptSetOfficialPersonalNFOAsk + "{||}"))
.SetFieldDescription(new DescribeAttribute(TextLabels.DescribeSetOfficialPersonalNFOAsk))
.SetActive(x => true)
.SetNext((value, x) =>
{
if (x.AskAddOfficial.Value == TextLabels.AddOfficial.Yes)
{
return new NextStep(new[] { nameof(OfficialName) });
}
else if (x.AskAddOfficial.Value == TextLabels.AddOfficial.No) { return new NextStep(); }
else { return new NextStep(new[] { nameof(AskAddOfficial) }); }
}))
.Field(new FieldReflector<OfficialInfo>(nameof(OfficialName))
.SetPrompt(new PromptAttribute(TextLabels.PromptSetPersonalNFOOfficialName))
.SetFieldDescription(new DescribeAttribute(TextLabels.DescribeSetPersonalNFOOfficialName))
.SetActive(x => !x.AskAddOfficial.HasValue || x.AskAddOfficial == TextLabels.AddOfficial.Yes)
)
.Field(new FieldReflector<OfficialInfo>(nameof(OfficialID))
.SetPrompt(new PromptAttribute(TextLabels.PromptSetPersonalNFOOfficialID))
.SetFieldDescription(new DescribeAttribute(TextLabels.DescribeSetPersonalNFOOfficialID))
.SetActive(x => !x.AskAddOfficial.HasValue || x.AskAddOfficial == TextLabels.AddOfficial.Yes)
)
//.OnCompletion(SaveUserData)
.Build();
}
}
Yes, v3.13.0.3 broke form flow. It's not only specific to enums.
Could this also result in other phenomena? After upgrading to 3.13.0.3 I experienced the problem described here (yes/no buttons no longer clickable) in Webchat, but on the same dialogs I am now also experiencing crashes on the Facebook connector. Is this related?
@tiloc I think so.
https://github.com/Microsoft/BotBuilder/compare/[email protected]#diff-22d3aafad398bb6777ae1c317a342eedL41
/// </summary>
public CardAction()
{
- this.Type = ActionTypes.ImBack;
+ CustomInit();
}
- /// The type of action implemented by this button. Defaults to <see cref="ActionTypes.ImBack"/>
+ /// An initialization method that performs custom operations like setting defaults
+ /// </summary>
+ partial void CustomInit();
I upgraded the nuget package to 3.13.1 and everything is back to normal. Yes/No is clickable in Web Chat and Facebook Messenger behaves again as desired.
@tiloc glad to hear that!
Well done 😊. Thank you.