Closed oscarlaf03 closed 3 months ago
Thanks for opening this issue!
My first instinct says that this could be related to a particular database configuration. The SO thread you linked seems to point in the same direction. Could you share your respective config files?
Hi @hschne as far as I could tell is not a database config issue but rather one of the Rails 7 expected behaviors: to prevent writing to the database while receiving a GET
request to enforce Restful as per here: https://github.com/rails/rails/blob/ea757ae7023fd0f89b6c086831a6f34c80f61f1c/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L230
the way I got around it was through a monkey patch on my development.rb file
module ActiveRecord
module ConnectionAdapters
class AbstractAdapter
def preventing_writes?
false
end
end
end
end
This is not as elegant as I would like I also encapsulated that further under and environment variable to be extra safe and only run RMP as optional under flag ie PROFILER=truer bundle exec rails server
But yeah I would like to have been available as a config variable on rails
Have you seen this type of issue while implementing RMP on any Rails 7 or higher app?
@oscarlaf03 Unfortunately, I failed to reproduce this behaviour with a new application, using Rails 7.1, though.
Here's my baseline and steps for trying to reproduce (using development
). I also tried using PedantMysQLAdapter as well as SQlite, with the same results.
Create a new Rails app with a similar setup to yours.
rails -v
Rails 7.1.3.4
rails new Testing -d mysql
bundle add rails_mini_profiler
rails rails_mini_profiler:install
GET
requests work as expected. I'm not getting any errors. As you already found a workaround I'll close this. I'd love to dig deeper into this, so if you find a way to consistently reproduce this issue with a new app let me know :)
Found a bug? Please fill out the sections below! 👍
Issue Summary
All the POST, OPTIONS and other requests are shown are as expected on the
/rails_mini_profiler
page, but every GET requested is missing due to the fact it cannot get added to thermp_profiled_request
tableI get the following error message:
Steps to Reproduce
Technical details
on my config/initializers/rails_mini_profiler.rb file