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

Fix respond_to? method signature for optional second positional arg #39

Merged

Conversation

cmcinnes-mdsol
Copy link
Contributor

dalton's rails 7.1 upgrade uncovered this. rails 7.1 makes the broadcast logger api public https://github.com/rails/rails/blob/7-1-stable/activesupport/CHANGELOG.md#rails-710rc1-september-27-2023. during our db seed process the broadcast logger calls respond_to? with the optional second positional arg: https://github.com/rails/rails/blob/7-1-stable/activesupport/lib/active_support/broadcast_logger.rb#L239 this was causing an ArgumentError: wrong number of arguments (given 2, expected 1) in lorekeeper because lorekeeper has the second arg declared as a kwarg. as far as i can tell it's never been a kwarg but probably nothing has attempted to call it with a second positional arg

@cmcinnes-mdsol
Copy link
Contributor Author

the backtrace of the error:

/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/lorekeeper-2.6.1/lib/lorekeeper/multi_logger.rb:32:in `respond_to?'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.0/lib/active_support/broadcast_logger.rb:219:in `block in respond_to_missing?'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.0/lib/active_support/broadcast_logger.rb:219:in `any?'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.0/lib/active_support/broadcast_logger.rb:219:in `respond_to_missing?'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activejob-7.1.0/lib/active_job/logging.rb:23:in `respond_to?'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activejob-7.1.0/lib/active_job/logging.rb:23:in `tag_logger'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activejob-7.1.0/lib/active_job/logging.rb:14:in `block (2 levels) in <module:Logging>'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.0/lib/active_support/callbacks.rb:130:in `instance_exec'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.0/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.0/lib/active_support/callbacks.rb:141:in `run_callbacks'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activejob-7.1.0/lib/active_job/enqueuing.rb:93:in `enqueue'
/Users/cmcinnes/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activejob-7.1.0/lib/active_job/enqueuing.rb:60:in `perform_later'
/Users/cmcinnes/workspace/dalton/app/models/application_record.rb:87:in `add_as_structured_attribute'

Copy link
Owner

@JordiPolo JordiPolo left a comment

Choose a reason for hiding this comment

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

Thanks!

@JordiPolo JordiPolo merged commit 9fc95df into JordiPolo:master Oct 13, 2023
mjobin-mdsol added a commit to mjobin-mdsol/lorekeeper that referenced this pull request Oct 30, 2023
JordiPolo pushed a commit that referenced this pull request Nov 1, 2023
…f activesupport (#40)

* run for each supported version of activesupport

* ignore enforced method signature merged in #39

* use ENV.fetch

* move rails 4.x for old ruby only

* 2.7 is minimum

* will the cache key update?

* use cache-version
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