influxdb-rails icon indicating copy to clipboard operation
influxdb-rails copied to clipboard

Missing `status` when warden redirects

Open michaelbaisch opened this issue 4 years ago • 4 comments

Hello again,

looking at entries with process_action == hook, I noticed that the status is missing for entries that were redirected with the warden middleware. For redirects within my application with redirect_to, status is correctly set to 302.

I'm not too familiar warden and influxdb-rails/ActiveSupport::Notifications, but my guess is that it's due to the fact that it's another middleware.

If I understand correctly this is the code that does the actual redirect when a user is for example not authenticated: https://github.com/heartcombo/devise/blob/main/lib/devise/failure_app.rb

Greetings, Michael

michaelbaisch avatar Dec 01 '21 17:12 michaelbaisch

So the entry is there but with the wrong status?

ChrisBr avatar Dec 01 '21 17:12 ChrisBr

Can you provide the Rails and devise versions you're using?

ChrisBr avatar Dec 01 '21 17:12 ChrisBr

Yes the entry is there but status is empty. I also just noticed that request_id is also empty, that's maybe related.

rails (6.1.4.1) devise (4.8.0)

michaelbaisch avatar Dec 01 '21 18:12 michaelbaisch

request_id is empty because it's set by a monkey patch in the application controller which we never hit in this case. The status is pulled from the process-action-action-controller event which we seem to receive just without the status.

I will have a look into it but at this point I'm not sure we can do much about this 🤔

ChrisBr avatar Dec 01 '21 18:12 ChrisBr