Revert back to initialize_from
from Util.convert_to_stripe_object
#806
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
r? @ob-stripe
cc @stripe/api-libraries @brandur-stripe
In ea736eb, on #790, we changed most uses of
initialize_from
to beUtil.convert_to_stripe_object
. We believed this to be equivalent, but this was incorrect; as @AnotherJoSmith pointed out, this returned new objects without mutating instances in-place (or, more precisely, copying over previous attributes).For example, I believe this would have broken flows like this:
I hope to implement a smoother fix to this in a follow-on, but for now, I reverted the offending commit, and tracked down the only new instances of
Util.convert_to_stripe_object
that have happened since (see this diff and grep `Util.convert_to_stripe_object).I also hope to add tests shortly, but want to bias to getting this out.