Closed jeffblake closed 4 years ago
We have not choice but to call the storage engine here:
If the client presents us with a cookie saying it is authorized we need to check in with the storage engine to see if it is indeed authorized.
That said, we can rescue this exception, I will check something in now.
Thanks!
I think I'm on the right track with this one...
I noticed 50 or so failed (status 500) requests due to a communication error with Memcached. I found that strange, because they were end-user requests where Miniprofiler was not turned on.
Stack trace:
I see two problems here,
https://github.com/MiniProfiler/rack-mini-profiler/blob/0a747e590ee8723bb3c20502554c9883989dd816/lib/mini_profiler/profiler.rb#L184 calls into Memcached even if the request has not been authorized
handle_cookie
(above) is called outside of where storage service exceptions are handled, e.g. here https://github.com/MiniProfiler/rack-mini-profiler/blob/0a747e590ee8723bb3c20502554c9883989dd816/lib/mini_profiler/profiler.rb#L372I would expect MiniProfiler to not communicate with Memcached unless I've authorized MiniProfiler to run on that request, and I'd also expect Miniprofiler to do nothing and pass along to the next rack app if any exceptions were raised
Settings:
If a request is authorized, I call
Rack::MiniProfiler.authorize_request if admin_user_signed_in?
in a before_action in the ApplicationControllerPlatform Rails Heroku latest versions