DEV: correct intermittent test failure

DEV: correct intermittent test failure

ActionController::BadRequest can not be re-dispatched, under some conditions
we are getting this vs InvalidParameterError in the following test

diff --git a/lib/middleware/discourse_public_exceptions.rb b/lib/middleware/discourse_public_exceptions.rb
index de34d61..089366d 100644
--- a/lib/middleware/discourse_public_exceptions.rb
+++ b/lib/middleware/discourse_public_exceptions.rb
@@ -20,6 +20,9 @@ module Middleware
       # the Request object has a "broken" .params which can not be accessed
       exception = nil if Rack::QueryParser::InvalidParameterError === exception
 
+      # We also can not dispatch bad requests as no proper params
+      exception = nil if ActionController::BadRequest === exception
+
       if exception
         begin
           fake_controller = ApplicationController.new

GitHub
sha: 939b82ef

1 Like

@ZogStriP I am not sure how this happens but we have a bad seed I guess on our build box #62855 for the record and in that seed instead of getting Rack::QueryParser::InvalidParameterError we get ActionController::BadRequest

We can not re-dispatch BadRequest anyway … so not too much point doing root cause here unless you feel like you want to kill 2 hours.

You first raised the concern about this heisentest proposed fix a few weeks ago in a review :slight_smile: