lib/anycable/rails/refinements/subscriptions.rb in anycable-rails-0.6.4 vs lib/anycable/rails/refinements/subscriptions.rb in anycable-rails-0.6.5

- old
+ new

@@ -5,9 +5,14 @@ module Subscriptions # :nodoc: refine ActionCable::Connection::Subscriptions do # Find or add a subscription to the list def fetch(identifier) add("identifier" => identifier) unless subscriptions[identifier] + + unless subscriptions[identifier] + raise "Channel not found: #{ActiveSupport::JSON.decode(identifier).fetch('channel')}" + end + subscriptions[identifier] end end end end