botbuilder-dotnet icon indicating copy to clipboard operation
botbuilder-dotnet copied to clipboard

And the Useless Constructor Overload Award goes to...

Open daggmano opened this issue 11 months ago • 1 comments

Version

Bot Framework DotNet SDK 4.22.2

Describe the bug

The constructor for a TeamsChannelAccount object has two overloads, both filled with optional parameters. The combination of these constructors means that, in practice, NONE (or perhaps only one) of the parameters are actually optional.

To Reproduce

  1. Create a TeamsChannelAccount object by only passing in an id value (first parameter).
  2. Attempt to build.
  3. See error.

Expected behavior

Since all parameters are optional, I would expect to be able to pass in 1, 2, 3, 4, 5, 6, 7 or 8 parameters and have a successful build.

Additional context

See overloads in libraries/Microsoft.Bot.Schema/Teams/TeamsChannelAccount.cs. The constructor in lines 45-58 is completely superfluous and can only cause problems - unless there's some secret understanding I'm missing?

daggmano avatar Mar 17 '24 23:03 daggmano

@daggmano Oh come now. Perhaps an honorable mention, but the actual award? We'll take a look. As long as it isn't breaking we can perhaps get back on your "meh, they're ok" list.

tracyboehrer avatar Apr 10 '24 18:04 tracyboehrer

This will be resolved in next major release.

tracyboehrer avatar Sep 26 '24 18:09 tracyboehrer