From 66e323eb82d880833c30670608ac7776da1635aa Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Fri, 21 Jun 2024 10:20:27 +0530 Subject: [PATCH] Refactored doc comments, log messages and removed use of alias [] for get --- lib/ably/models/protocol_message.rb | 1 + lib/ably/realtime/channels.rb | 2 +- lib/ably/realtime/client/incoming_message_dispatcher.rb | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ably/models/protocol_message.rb b/lib/ably/models/protocol_message.rb index 19f8f1e6..0088fded 100644 --- a/lib/ably/models/protocol_message.rb +++ b/lib/ably/models/protocol_message.rb @@ -274,6 +274,7 @@ def to_s end # True if the ProtocolMessage appears to be invalid, however this is not a guarantee + # Used for validating incoming protocol messages, so no need to add unnecessary checks # @return [Boolean] # @api private def invalid? diff --git a/lib/ably/realtime/channels.rb b/lib/ably/realtime/channels.rb index feb47005..e7cf788d 100644 --- a/lib/ably/realtime/channels.rb +++ b/lib/ably/realtime/channels.rb @@ -52,7 +52,7 @@ def release(channel) # @api private def set_channel_serials(serials) serials.each do |channel_name, channel_serial| - self[channel_name].properties.channel_serial = channel_serial + get(channel_name).properties.channel_serial = channel_serial end end diff --git a/lib/ably/realtime/client/incoming_message_dispatcher.rb b/lib/ably/realtime/client/incoming_message_dispatcher.rb index f625983d..596c558b 100644 --- a/lib/ably/realtime/client/incoming_message_dispatcher.rb +++ b/lib/ably/realtime/client/incoming_message_dispatcher.rb @@ -47,8 +47,8 @@ def dispatch_protocol_message(*args) protocol_message.action == :attached ) get_channel(protocol_message.channel).tap do |channel| - logger.info "Setting channel serial for channel #{channel.name}" - logger.info "Previous serial #{channel.properties.channel_serial}, new serial #{protocol_message.channel_serial}" + logger.info "Setting channel serial for channel #{channel.name}, " << + "Previous: #{channel.properties.channel_serial}, New: #{protocol_message.channel_serial}" channel.properties.channel_serial = protocol_message.channel_serial end end