From 60e151f89931bd159fe62c2bcbdae684f40bffe4 Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Tue, 7 Jan 2025 11:34:55 -0800 Subject: [PATCH] - ensure third-party extensions do not change methods visibility Ref https://github.com/anycable/actioncable-next/issues/7 --- lib/action_cable/connection/base.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb index 314586b..a7a636f 100644 --- a/lib/action_cable/connection/base.rb +++ b/lib/action_cable/connection/base.rb @@ -163,3 +163,7 @@ def send_welcome_message end ActiveSupport.run_load_hooks(:action_cable_connection, ActionCable::Connection::Base) + +# Hack to make sure legacy extensions do not changes the visibility of API methods +# (see https://github.com/anycable/actioncable-next/issues/7) +ActionCable::Connection::Base.send :public, :handle_open, :handle_close, :handle_channel_command, :transmit, :close