Skip to content

Commit

Permalink
Merge pull request #431 from ably/fix/channel-detach-lamdba
Browse files Browse the repository at this point in the history
Fix lamda used in channel detach
  • Loading branch information
sacOO7 authored Jul 8, 2024
2 parents e37a725 + 3bed6fe commit a265d6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/ably/realtime/channel/channel_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ def send_detach_protocol_message(previous_state)
end
end

on_disconnected_and_connected = lambda do
on_disconnected_and_connected = lambda do |&block|
connection.unsafe_once(:disconnected) do
connection.unsafe_once(:connected) do
yield if pending_state_change_timer
block.call if pending_state_change_timer
end if pending_state_change_timer
end
end
Expand Down
4 changes: 1 addition & 3 deletions spec/acceptance/realtime/channel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -830,10 +830,8 @@ def disconnect_transport
it 'does the detach operation once the connection state is connected (#RTL5h)' do
connection.once(:connected) do
connection.once(:disconnected) do
channel.on :attaching do
channel.detach
end
channel.attach
channel.detach
connection.once(:connected) do
channel.once(:attached) do
channel.once(:detached) do
Expand Down

0 comments on commit a265d6a

Please sign in to comment.