microsoft / botbuilder-dotnet

Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET.
https://github.com/Microsoft/botframework
MIT License
878 stars 484 forks source link

And the Useless Constructor Overload Award goes to... #6763

Closed daggmano closed 1 month ago

daggmano commented 8 months ago

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?

tracyboehrer commented 7 months ago

@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 commented 1 month ago

This will be resolved in next major release.