Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port: Fix invalid cast exception when sending delay activities through cloud adapter (#5617) #1692

Closed
github-actions bot opened this issue Jun 3, 2021 · 1 comment
Labels
ExemptFromDailyDRIReport Use this label to exclude the issue from the DRI report. needs-triage The issue has just been created and it has not been reviewed by the team. parity The issue describes a gap in parity between two or more platforms.

Comments

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

The changes in Fix invalid cast exception when sending delay activities through cloud adapter (#5617) may need to be ported to maintain parity with microsoft/botbuilder-dotnet.

Fixes https://github.com/microsoft/BotFramework-Composer/issues/7880

Description

The cloud adapter tried to cast a delay activity's value to int. Because the value is an object, all numbers are boxed and therefore cannot be unboxed and cast to a different numeric type using a normal cast operation. We need to use Convert.ToInt32 instead.

The problem was also present in the test adapter so I've fixed it there too. The problem was not present in the Bot Framework HTTP adapter, but for the sake of completeness I've included a test for it anyway. The problem was present in the allow-null-ID test adapter and I fixed it there because I saw that it's supposed to mimic the other adapters, but I didn't include a test for it because it's not part of a public library.

Specific Changes

  • Change (int) to Convert.ToInt32 in the cloud adapter, the test adapter, and the allow-null-ID test adapter
  • Clean up some using statements
  • Add delay tests

Testing

  • CloudAdapterTests.CloudAdapterDelay
  • BotFrameworkHttpAdapterTests.Delay
  • TestAdapterTests.TestAdapter_Delay

Please review and, if necessary, port the changes.

@github-actions github-actions bot added ExemptFromDailyDRIReport Use this label to exclude the issue from the DRI report. needs-triage The issue has just been created and it has not been reviewed by the team. parity The issue describes a gap in parity between two or more platforms. labels Jun 3, 2021
@mrivera-ms
Copy link
Contributor

Closing because this fix will be included in #1694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExemptFromDailyDRIReport Use this label to exclude the issue from the DRI report. needs-triage The issue has just been created and it has not been reviewed by the team. parity The issue describes a gap in parity between two or more platforms.
Projects
None yet
Development

No branches or pull requests

1 participant