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

🔧 Ensure ResponseParser config is mutable and non-global #381

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Jan 22, 2025

When ResponseParser was initialized without any explicit config, it used Config.global directly. This meant that changes to parser.config were also changes to the global config!

When ResponseParser is initialized with a config hash, that creates a frozen config object. This meant that changes to parser.config were impossible.

So, when the given config is global or frozen, we create a new config and inherit from the given config. We want to continue using the given config as-is in other cases, so the client and its parser can share the same exact config.

When ResponseParser was initialized without any explicit config, it used
Config.global directly.  This meant that changes to `parser.config` were
also changes to the _global_ config!

When ResponseParser is initialized with a config hash, that creates
a frozen config object.  This meant that changes to `parser.config` were
impossible.

So, when the given config is global or frozen, we create a new config
and inherit from the given config.  We want to continue using the given
config as-is in other cases, so the client and its parser can share the
same exact config.
@nevans nevans added the enhancement New feature or request label Jan 22, 2025
@nevans nevans merged commit 340d3e7 into master Jan 23, 2025
37 checks passed
@nevans nevans deleted the response-parser-config branch January 23, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

1 participant