-
Notifications
You must be signed in to change notification settings - Fork 583
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
Changed signatures of SendGridClient is a breaking change #1027
Comments
Yes, this change broke all our code that depends on SendGrid. We had to roll back to 9.17. Edited to clarify: code that uses a NuGet package with a dependency on SendGrid. |
It's unclear to me why this is considered a breaking change. Optional boolean args were added to the end of the constructors as part of #1019, which should not be breaking. Are existing calls to the constructors resolving to a different constructor now? |
The problem that our libraries encountered occurs at runtime, not at compile time. We have a NuGet package that has SendGrid >= 9.14.0 as a dependency. When a user of that library upgraded to SendGrid 9.18.0, they got this exception:
Adding a new, optional parameter to a method or constructor makes a runtime match impossible. Once you have deployed a specific public method signature, you can't change it. You can prevent this problem by creating an overload instead of a new optional parameter. |
TIL. Thanks for the explanation @PunzunLtd I'll work on a fix. |
Issue Summary
The changes in the constructors in 3542159#diff-1b2f60fd3427373842af57c11d5a6e6e is a breaking change.
This will break other libraries bindings to this library, e.g. Microsoft.Azure.WebJobs.Extensions.SendGrid will not work with version 9.18.0
A new constructor, with the new variable has to be introduced instead, and revert the changes to the existing constructors.
Technical details:
The text was updated successfully, but these errors were encountered: