sentry-rails: excluded_exceptions triggers a Rails deprecation warning for ActionController::InvalidAuthenticityToken
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Grep the sentry-rails gem for Sentry::Rails::IGNORE_DEFAULT to find the default exclusion list, then read Sentry::Configuration#excluded_exception_classes, which resolves each name via Object.const_get. The change is to stop listing ActionController::InvalidAuthenticityToken when ActionController::InvalidCrossOriginRequest is already present and defined, so the deprecated constant is never resolved. Done looks like capturing an exception under Rails main with no DEPRECATION WARNING, plus the existing configuration specs still passing.
Written by the indexing model from the issue text.
Description
Rails main (8.2) deprecates ActionController::InvalidAuthenticityToken in favour of ActionController::InvalidCrossOriginRequest (release notes). The old name is now a deprecated constant that warns when it is resolved.
Sentry::Rails::IGNORE_DEFAULT still lists "ActionController::InvalidAuthenticityToken", and Sentry::Configuration#excluded_exception_classes resolves every name with Object.const_get. So the first exception that Sentry captures in each process prints:
DEPRECATION WARNING: ActionController::InvalidAuthenticityToken has been deprecated and will be removed in Rails 9.0. Use ActionController::InvalidCrossOriginRequest instead.
Versions: sentry-ruby / sentry-rails 7.2.0 (7.3.0 has the same list), Rails main.
Suggested fix: leave "ActionController::InvalidAuthenticityToken" out of the default list when ActionController::InvalidCrossOriginRequest is defined, because the list already holds that name and the old name refers to the same class.
Workaround:
Sentry::Configuration.after(:initialize) do
excluded_exceptions.delete("ActionController::InvalidAuthenticityToken")
end
- Dominant language
- Ruby
- Stars
- 990
- Forks
- 553
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 31
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/sentry-ruby
-
Shorter rate limit in the same header replaces a longer onePossibly taken @sentry-junior claimed this 5 days ago. OpenBug Ruby
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-ruby#3211 · 1 comment ·
Maintainers usually reply within 1 day
-
Events dropped client-side for size are only logged at debug level and not recorded as lostPossibly taken @sentry-junior claimed this 5 days ago. OpenBug Junior: repro Ruby
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-ruby#3209 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Ship fewer files with the gemsPossibly taken @solnic claimed this 1 day ago. OpenImprovement Ruby Waiting for: Product Owner
getsentry/sentry-ruby#3223 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
active_job breaking change Next Major sentry-delayed_job sentry-rails sentry-resque sentry-sidekiq
Difficulty 4/5 3-5 days Newbie friendliness 48/100
getsentry/sentry-ruby#3222 · 1 comment ·
Maintainers usually reply within 1 day
-
Feature Ruby Waiting for: Product Owner
Difficulty 3/5 1-2 days Newbie friendliness 54/100
getsentry/sentry-ruby#3217 · 1 comment ·
Maintainers usually reply within 1 day
All issues in getsentry/sentry-ruby
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
開発用DockerイメージにPlaywrightのシステム依存を追加するPossibly taken @momocus claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sakazuki-org/sakazuki#1453 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
jenkins-infra/jenkins.io#9615 · 1 comment ·
Maintainers usually reply within 1 day
-
fix(ocr): compile the Tesseract-free pipeline with Tokio runtimePossibly taken @Goldziher claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day