BaseSecrete / rorvswild

Performances & exceptions monitoring for Ruby on Rails applications
https://www.rorvswild.com
MIT License
331 stars 9 forks source link

Not compatible with Rodauth #28

Closed ledermann closed 5 months ago

ledermann commented 8 months ago

In one of my applications, I'm using Rodauth for user authentication.

After installing rorvswild into this application, an exception is raised inside the gem when trying to authenticate:

Exception screenshot

The full error report is here (private link): https://www.rorvswild.com/applications/136122/errors/47089758

The exception is raised in this line of the gem: https://github.com/BaseSecrete/rorvswild/blob/v1.6.0/lib/rorvswild/plugin/action_controller.rb#L23

When I change the gem's code by ensuring that method_name exists, the exception is not raised anymore:

RorVsWild::Section.start do |section|
  method_name = controller.send(:method_for_action, controller.action_name)
  if method_name
    section.file, section.line = controller.method(method_name).source_location
    section.file = RorVsWild.agent.locator.relative_path(section.file)
    section.command = "#{controller.class}##{method_name}"
  end
  RorVsWild.agent.current_data[:name] = controller_action if RorVsWild.agent.current_data
end

I don't know if this breaks other things, so maybe there's more to do.

alexisbernard commented 8 months ago

Thanks for the detailed report. I'm not familiar with Rodauth. I will create a sample app with it.

alexisbernard commented 5 months ago

Fixed in 1.6.5.