-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Replace log_process_action to append_info_to_payload #4375
Replace log_process_action to append_info_to_payload #4375
Conversation
408ae7f
to
9caae50
Compare
Is there any appetite for landing this change? Happy to help get it across the line if anything outstanding. |
@@ -543,6 +543,18 @@ class AuthenticationOthersTest < Devise::IntegrationTest | |||
refute warden.authenticated?(:user) | |||
end | |||
end | |||
|
|||
test 'not signed in should returns notification payload with 401 status' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo, returns
=> return
Would love to see this re-reviewed. |
I hope this PR will be merge. |
@rafaelfranca @lucasmazza |
This broke my logging when I upgraded from 4.3.0 to 4.4.0, and 4.4.1 is still broken. I'm on Rails 5.1.4 I noticed that logs in my app started reporting I'm checking how to fix it |
@rafaelsales I'm not sure it's related, we released this on v4.4.0 |
@tegon sorry, I had a typo in the version numbers of my comment. Just fixed. If I revert this particular commit, the previous behavior is established. I'm building a test case to reproduce. |
@tegon Here's the test case to reproduce - this commit was made on top of the latest master: I tried to dig in a little bit and I found out that in the following snippet of this PR, the def append_info_to_payload(payload)
super
payload[:status] ||= 401 unless payload[:exception]
end |
@rafaelsales I see. Can you open a PR for this? If you don't know how to solve it, just add a failing test example so that other person can work on it. |
Sure, thanks |
I did some investigation on this. Cross-linking my thoughts in the Lograge issue tracker: roidrage/lograge#67 (comment) |
This implementation replace
log_process_action
toappend_info_to_payload
that way the status should be present in ActiveSupport::Notifications's payload and at the logIt's based on what AR is doing:
https://github.com/rails/rails/blob/92703a9ea5d8b96f30e0b706b801c9185ef14f0e/activerecord/lib/active_record/railties/controller_runtime.rb#L35
No test change was needed but one test was include.