Skip to content

STJ-23: BUGFIX: deprecation_tracker breaking with unknown keywords #157

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

Conversation

julioalucero
Copy link

STJ-23: BUGFIX: deprecation_tracker breaking with unknown keywords

Description

BUGFIX: Prevent DeprecationTracker from crashing when receiving unknown keyword arguments.

In certain environments (e.g. when using sass-embedded), the warn method receives unexpected keyword arguments such as :deprecation, :span, or :stack. Previously, these unrecognized keywords would raise an ArgumentError and interrupt execution. This patch safely handles unknown keyword arguments while preserving known ones.

Motivation and Context

Fixes #152 — DeprecationTracker was breaking during setup in projects using sass-embedded due to unhandled keyword arguments in warn.

This update ensures that warn forwards all known and unknown keyword arguments safely to super, and gracefully falls back to known keywords if the parent method does not accept extras.

How Has This Been Tested?

  • Added a test to verify that warn can accept unknown keyword arguments (e.g. :deprecation, :span, :stack) without raising errors.
  • Ran the full test suite using Ruby 2.7 and Ruby 3.2 to ensure backward and forward compatibility.
  • Verified that the warn method continues to capture and store deprecation messages as expected.

Screenshots:

I will abide by the code of conduct

etagwerker added a commit that referenced this pull request Jul 30, 2025
…aking-unknown-keywords

STJ-23: BUGFIX: deprecation_tracker breaking with unknown keywords #157
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.

[BUG] NextRails deprecation_tracker breaking with unknown keywords:
2 participants