Skip to content

Conversation

@danarnold
Copy link
Member

  • Duplicate params to avoid modifying input hash
  • Bump version

@danarnold danarnold requested review from Copilot and jclusso June 4, 2025 17:44

This comment was marked as outdated.

@danarnold danarnold requested review from Copilot and jclusso June 4, 2025 18:07
jclusso
jclusso previously approved these changes Jun 4, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that the original input params hash isn’t mutated during API requests and bumps the version.

  • Added a test to verify that Emailable.verify doesn’t modify the provided params hash
  • Updated the request method in lib/emailable/client.rb to duplicate params before deleting :api_key and :access_token

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/authentication_test.rb Added test_does_not_modify_params to guard against param mutation
lib/emailable/client.rb Introduced params_copy and switched to using it instead of mutating params
Comments suppressed due to low confidence (1)

lib/emailable/client.rb:20

  • [nitpick] The variable name params_copy is generic. Consider renaming it to something more descriptive, such as request_params or sanitized_params, to clarify its purpose.
params_copy = params.dup

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@danarnold danarnold merged commit 277cfbd into master Jun 4, 2025
7 checks passed
@danarnold danarnold deleted the dup-params branch June 4, 2025 18:20
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.

3 participants