Skip to content

Fix misalignment between AdvancedSettings defaults and VCRHandler constructor #55

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

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

Greybird
Copy link
Contributor

Description

When VCRHandler is created with a null AdvancedSettings, or an AdvancedSettings with a null MatchRules property, then the handler _matchRules is set to a new instance of MatchRules.
However, when AdvancedSettings is instanciated, it uses MatchRules.Default by default for its MatchRules property.
As passing no AdvancedSettings is expected to behave exactly like passing a default AdvancedSettings instance, this creates a bug, where if no AdvancedSettings is provided, all requests are matching by default.

Testing

1 Unit tests has been updated, and another has been created to confirm the bug and the fix.

Pull Request Type

Please select the option(s) that are relevant to this PR.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement (fixing a typo, updating readme, renaming a variable name, etc)

@Greybird Greybird requested a review from a team January 26, 2024 18:05
Copy link
Contributor

@nwithan8 nwithan8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! Approved.

@nwithan8 nwithan8 merged commit a558530 into EasyPost:master Jan 26, 2024
@Greybird Greybird deleted the fix/matchrules branch February 5, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants