Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jan 25, 2022

Resolves #283

  • Added tests RSL1a and RSL1b for both REST and Realtime clients
  • Ensure RSL1l, RSL1l1
  • Ensure RSL1h
  • Ensure RSL1k1, RSL1k2
  • Refactored publish() method in REST client
  • Refactored publish() method in Realtime client
  • Added build_messages() in conversations.rb and converting name, data, attributes to Ably::Models::Message
# Publish a single message with (name, data) form (1)
channel.publish 'click', { x: 1, y: 2 }
      
# Publish a single message with single Hash form (2)
message = { name: 'click', data: { x: 1, y: 2 } }
channel.publish message
      
# Publish an array of message Hashes form (3)
messages = [
  { name: 'click', data: { x: 1, y: 2 } },
  { name: 'click', data: { x: 2, y: 3 } }
]
channel.publish messages
      
# Publish an array of Ably::Models::Message objects form (4)
messages = [
  Ably::Models::Message(name: 'click', data: { x: 1, y: 2 })
  Ably::Models::Message(name: 'click', data: { x: 2, y: 3 })
]
channel.publish messages
      
# Publish a single Ably::Models::Message object form (5)
message = Ably::Models::Message(name: 'click', data: { x: 1, y: 2 })
channel.publish message
      

… Fixed how messages array are prepared. Added tests. Fixed comments.
@ghost ghost changed the title RSL1a, RSL1b, RSL1l, RSL1l1 RSL1a, RSL1b, RSL1l, RSL1l1, RSL1h Jan 25, 2022
@ghost ghost changed the title RSL1a, RSL1b, RSL1l, RSL1l1, RSL1h RSL1a, RSL1b, RSL1l, RSL1l1, RSL1h, RSL1k1, RSL1k2 Jan 25, 2022
@ghost ghost self-assigned this Jan 31, 2022
@ghost ghost marked this pull request as ready for review January 31, 2022 16:54
@ghost ghost changed the title RSL1a, RSL1b, RSL1l, RSL1l1, RSL1h, RSL1k1, RSL1k2 RSL1a, RSL1b Jan 31, 2022
@ghost ghost requested a review from owenpearson January 31, 2022 16:54
Copy link
Member

@owenpearson owenpearson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look good to me. Just needs a couple of small changes to inline documentation.

@ghost ghost requested review from TheSmartnik and owenpearson February 17, 2022 08:14
Copy link
Member

@owenpearson owenpearson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks 👍

@QuintinWillison QuintinWillison removed their request for review March 1, 2022 10:12
@owenpearson owenpearson merged commit ada8e40 into main Mar 4, 2022
@owenpearson owenpearson deleted the SDK-1067 branch March 4, 2022 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Write spec tests for RSL1a, b, h, k1, k2, l, l1 (Channels)

2 participants