lib/ably/realtime/channel/channel_state_machine.rb in ably-1.1.7 vs lib/ably/realtime/channel/channel_state_machine.rb in ably-1.1.8
- old
+ new
@@ -24,13 +24,17 @@
transition :from => :attaching, :to => [:attached, :detaching, :failed, :suspended]
transition :from => :attached, :to => [:attaching, :detaching, :detached, :failed, :suspended]
transition :from => :detaching, :to => [:detached, :attaching, :attached, :failed, :suspended]
transition :from => :detached, :to => [:attaching, :attached, :failed]
transition :from => :suspended, :to => [:attaching, :attached, :detached, :failed]
- transition :from => :failed, :to => [:attaching]
+ transition :from => :failed, :to => [:attaching, :initialized]
after_transition do |channel, transition|
channel.synchronize_state_with_statemachine
+ end
+
+ after_transition(to: [:initialized]) do |channel|
+ channel.clear_error_reason
end
after_transition(to: [:attaching]) do |channel|
channel.manager.attach
end