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

Changed signatures of SendGridClient is a breaking change #1027

Closed
jenscski opened this issue Jul 20, 2020 · 4 comments · Fixed by #1029
Closed

Changed signatures of SendGridClient is a breaking change #1027

jenscski opened this issue Jul 20, 2020 · 4 comments · Fixed by #1029
Labels
status: work in progress Twilio or the community is in the process of implementing type: bug bug in the library

Comments

@jenscski
Copy link

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:

  • sendgrid-csharp version: 9.18.0
@PunzunLtd
Copy link

PunzunLtd commented Jul 20, 2020

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.

@childish-sambino
Copy link
Contributor

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?

@childish-sambino childish-sambino added status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library labels Jul 21, 2020
@PunzunLtd
Copy link

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:

System.MissingMethodException : Method not found: 'Void SendGrid.SendGridClient..ctor(System.String, System.String, System.Collections.Generic.Dictionary`2<System.String,System.String>, System.String, System.String)'.

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.

@childish-sambino
Copy link
Contributor

TIL. Thanks for the explanation @PunzunLtd

I'll work on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: work in progress Twilio or the community is in the process of implementing type: bug bug in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants