Module: FiberAudit::Runtime::RailsIntegration::CableHook

Defined in:
lib/fiber_audit/runtime/rails_integration.rb

Instance Method Summary collapse

Instance Method Details

#dispatch_actionObject



271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/fiber_audit/runtime/rails_integration.rb', line 271

def dispatch_action(...)
  integration = RailsIntegration.current
  return super unless integration&.active_for_current_process?

  executed = false
  begin
    integration.context_store.with(:websocket) do
      executed = true
      super
    end
  rescue StandardError
    raise if executed
    # Context setup failed before application code ran
    raise unless integration.send(:fail_open?)

    integration.send(:account_internal_error)
    super
  end
end