bigcommerce / bigcommerce-api-ruby

Connect Ruby applications with the Bigcommerce Platform
https://developer.bigcommerce.com
MIT License
79 stars 124 forks source link

Bigcommerce::Request: Do Not Modify Caller's Hash When Accessing Connection #181

Open sshaw opened 1 month ago

sshaw commented 1 month ago

Expected behavior

API request method calls do not modify the caller's references.

Actual behavior

Bigcommerce::Request#raw_request calls params.delete(:connection) removing :connection from caller

Steps to reproduce behavior


options = {
  :page => page,
  :limit  => 250,
  :connection => connection
}

customers = Bigcommerce::Customer.all(options)
# process
# get page 2

options[:page] = page + 1

# NoMethodError because :connection was remove by prior call
customers = Bigcommerce::Customer.all(options)