lib/submodules/ably-ruby/SPEC.md in ably-rest-0.7.3 vs lib/submodules/ably-ruby/SPEC.md in ably-rest-0.7.5
- old
+ new
@@ -1,11 +1,11 @@
-# Ably Real-time & REST Client Library 0.7.1 Specification
+# Ably Real-time & REST Client Library 0.7.3 Specification
### Ably::Realtime::Channel#history
_(see [spec/acceptance/realtime/channel_history_spec.rb](./spec/acceptance/realtime/channel_history_spec.rb))_
* using JSON and MsgPack protocol
- * [returns a Deferrable](./spec/acceptance/realtime/channel_history_spec.rb#L20)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_history_spec.rb#L20)
* with a single client publishing and receiving
* [retrieves real-time history](./spec/acceptance/realtime/channel_history_spec.rb#L33)
* with two clients publishing messages on the same channel
* [retrieves real-time history on both channels](./spec/acceptance/realtime/channel_history_spec.rb#L45)
* with lots of messages published with a single client and channel
@@ -29,12 +29,12 @@
* #attach
* [emits attaching then attached events](./spec/acceptance/realtime/channel_spec.rb#L49)
* [ignores subsequent #attach calls but calls the success callback if provided](./spec/acceptance/realtime/channel_spec.rb#L59)
* [attaches to a channel](./spec/acceptance/realtime/channel_spec.rb#L72)
* [attaches to a channel and calls the provided block](./spec/acceptance/realtime/channel_spec.rb#L80)
- * [returns a Deferrable](./spec/acceptance/realtime/channel_spec.rb#L87)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L92)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_spec.rb#L87)
+ * [calls the SafeDeferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L92)
* when state is :failed
* [reattaches](./spec/acceptance/realtime/channel_spec.rb#L103)
* when state is :detaching
* [moves straight to attaching and skips detached](./spec/acceptance/realtime/channel_spec.rb#L116)
* with many connections and many channels on each simultaneously
@@ -42,62 +42,64 @@
* failure as a result of insufficient key permissions
* [triggers failed event](./spec/acceptance/realtime/channel_spec.rb#L165)
* [calls the errback of the returned Deferrable](./spec/acceptance/realtime/channel_spec.rb#L174)
* [triggers an error event](./spec/acceptance/realtime/channel_spec.rb#L182)
* [updates the error_reason](./spec/acceptance/realtime/channel_spec.rb#L191)
+ * and subsequent authorisation with suitable permissions
+ * [attaches to the channel successfully and resets the channel error_reason](./spec/acceptance/realtime/channel_spec.rb#L200)
* #detach
- * [detaches from a channel](./spec/acceptance/realtime/channel_spec.rb#L202)
- * [detaches from a channel and calls the provided block](./spec/acceptance/realtime/channel_spec.rb#L212)
- * [emits :detaching then :detached events](./spec/acceptance/realtime/channel_spec.rb#L221)
- * [returns a Deferrable](./spec/acceptance/realtime/channel_spec.rb#L233)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L238)
+ * [detaches from a channel](./spec/acceptance/realtime/channel_spec.rb#L222)
+ * [detaches from a channel and calls the provided block](./spec/acceptance/realtime/channel_spec.rb#L232)
+ * [emits :detaching then :detached events](./spec/acceptance/realtime/channel_spec.rb#L241)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_spec.rb#L253)
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L260)
* when state is :failed
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L251)
+ * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L273)
* when state is :attaching
- * [moves straight to :detaching state and skips :attached](./spec/acceptance/realtime/channel_spec.rb#L262)
+ * [moves straight to :detaching state and skips :attached](./spec/acceptance/realtime/channel_spec.rb#L284)
* when state is :detaching
- * [ignores subsequent #detach calls but calls the callback if provided](./spec/acceptance/realtime/channel_spec.rb#L280)
+ * [ignores subsequent #detach calls but calls the callback if provided](./spec/acceptance/realtime/channel_spec.rb#L302)
* channel recovery in :attaching state
* the transport is disconnected before the ATTACHED protocol message is received
- * PENDING: *[attach times out and fails if not ATTACHED protocol message received](./spec/acceptance/realtime/channel_spec.rb#L299)*
- * PENDING: *[channel is ATTACHED if ATTACHED protocol message is later received](./spec/acceptance/realtime/channel_spec.rb#L300)*
- * PENDING: *[sends an ATTACH protocol message in response to a channel message being received on the attaching channel](./spec/acceptance/realtime/channel_spec.rb#L301)*
+ * PENDING: *[attach times out and fails if not ATTACHED protocol message received](./spec/acceptance/realtime/channel_spec.rb#L321)*
+ * PENDING: *[channel is ATTACHED if ATTACHED protocol message is later received](./spec/acceptance/realtime/channel_spec.rb#L322)*
+ * PENDING: *[sends an ATTACH protocol message in response to a channel message being received on the attaching channel](./spec/acceptance/realtime/channel_spec.rb#L323)*
* #publish
* when attached
- * [publishes messages](./spec/acceptance/realtime/channel_spec.rb#L307)
+ * [publishes messages](./spec/acceptance/realtime/channel_spec.rb#L329)
* when not yet attached
- * [publishes queued messages once attached](./spec/acceptance/realtime/channel_spec.rb#L319)
- * [publishes queued messages within a single protocol message](./spec/acceptance/realtime/channel_spec.rb#L327)
+ * [publishes queued messages once attached](./spec/acceptance/realtime/channel_spec.rb#L341)
+ * [publishes queued messages within a single protocol message](./spec/acceptance/realtime/channel_spec.rb#L349)
* #subscribe
* with an event argument
- * [subscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L350)
+ * [subscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L372)
* with no event argument
- * [subscribes for all events](./spec/acceptance/realtime/channel_spec.rb#L360)
+ * [subscribes for all events](./spec/acceptance/realtime/channel_spec.rb#L382)
* many times with different event names
- * [filters events accordingly to each callback](./spec/acceptance/realtime/channel_spec.rb#L370)
+ * [filters events accordingly to each callback](./spec/acceptance/realtime/channel_spec.rb#L392)
* #unsubscribe
* with an event argument
- * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L393)
+ * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L415)
* with no event argument
- * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L406)
+ * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L428)
* when connection state changes to
* :failed
* an :attached channel
- * [transitions state to :failed](./spec/acceptance/realtime/channel_spec.rb#L429)
- * [triggers an error event on the channel](./spec/acceptance/realtime/channel_spec.rb#L439)
- * [updates the channel error_reason](./spec/acceptance/realtime/channel_spec.rb#L449)
+ * [transitions state to :failed](./spec/acceptance/realtime/channel_spec.rb#L451)
+ * [triggers an error event on the channel](./spec/acceptance/realtime/channel_spec.rb#L461)
+ * [updates the channel error_reason](./spec/acceptance/realtime/channel_spec.rb#L471)
* a :detached channel
- * [remains in the :detached state](./spec/acceptance/realtime/channel_spec.rb#L461)
+ * [remains in the :detached state](./spec/acceptance/realtime/channel_spec.rb#L483)
* a :failed channel
- * [remains in the :failed state and ignores the failure error](./spec/acceptance/realtime/channel_spec.rb#L481)
+ * [remains in the :failed state and ignores the failure error](./spec/acceptance/realtime/channel_spec.rb#L503)
* :closed
* an :attached channel
- * [transitions state to :detached](./spec/acceptance/realtime/channel_spec.rb#L504)
+ * [transitions state to :detached](./spec/acceptance/realtime/channel_spec.rb#L526)
* a :detached channel
- * [remains in the :detached state](./spec/acceptance/realtime/channel_spec.rb#L515)
+ * [remains in the :detached state](./spec/acceptance/realtime/channel_spec.rb#L537)
* a :failed channel
- * [remains in the :failed state and retains the error_reason](./spec/acceptance/realtime/channel_spec.rb#L536)
+ * [remains in the :failed state and retains the error_reason](./spec/acceptance/realtime/channel_spec.rb#L558)
### Ably::Realtime::Client
_(see [spec/acceptance/realtime/client_spec.rb](./spec/acceptance/realtime/client_spec.rb))_
* using JSON and MsgPack protocol
* initialization
@@ -135,166 +137,179 @@
* with invalid key ID part of the key
* [enters the failed state and returns an authorization error](./spec/acceptance/realtime/connection_failures_spec.rb#L40)
* automatic connection retry
* with invalid WebSocket host
* when disconnected
- * [enters the suspended state after multiple attempts to connect](./spec/acceptance/realtime/connection_failures_spec.rb#L94)
+ * [enters the suspended state after multiple attempts to connect](./spec/acceptance/realtime/connection_failures_spec.rb#L95)
* #close
- * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L111)
+ * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L112)
* when connection state is :suspended
- * [enters the failed state after multiple attempts](./spec/acceptance/realtime/connection_failures_spec.rb#L130)
+ * [enters the failed state after multiple attempts if the max_time_in_state is set](./spec/acceptance/realtime/connection_failures_spec.rb#L131)
* #close
- * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L150)
+ * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L151)
* when connection state is :failed
* #close
- * [will not transition state to :close and raises a StateChangeError exception](./spec/acceptance/realtime/connection_failures_spec.rb#L169)
+ * [will not transition state to :close and raises a StateChangeError exception](./spec/acceptance/realtime/connection_failures_spec.rb#L170)
* #error_reason
- * [contains the error when state is disconnected](./spec/acceptance/realtime/connection_failures_spec.rb#L183)
- * [contains the error when state is suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L183)
- * [contains the error when state is failed](./spec/acceptance/realtime/connection_failures_spec.rb#L183)
- * [is reset to nil when :connected](./spec/acceptance/realtime/connection_failures_spec.rb#L192)
- * [is reset to nil when :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L203)
+ * [contains the error when state is disconnected](./spec/acceptance/realtime/connection_failures_spec.rb#L184)
+ * [contains the error when state is suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L184)
+ * [contains the error when state is failed](./spec/acceptance/realtime/connection_failures_spec.rb#L184)
+ * [is reset to nil when :connected](./spec/acceptance/realtime/connection_failures_spec.rb#L193)
+ * [is reset to nil when :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L204)
* #connect
* connection opening times out
- * [attempts to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L230)
- * [calls the errback of the returned Deferrable object when first connection attempt fails](./spec/acceptance/realtime/connection_failures_spec.rb#L243)
+ * [attempts to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L231)
+ * [calls the errback of the returned Deferrable object when first connection attempt fails](./spec/acceptance/realtime/connection_failures_spec.rb#L244)
* when retry intervals are stubbed to attempt reconnection quickly
- * [never calls the provided success block](./spec/acceptance/realtime/connection_failures_spec.rb#L262)
+ * [never calls the provided success block](./spec/acceptance/realtime/connection_failures_spec.rb#L263)
* connection resume
* when DISCONNECTED ProtocolMessage received from the server
- * [reconnects automatically](./spec/acceptance/realtime/connection_failures_spec.rb#L291)
+ * [reconnects automatically and immediately](./spec/acceptance/realtime/connection_failures_spec.rb#L292)
+ * and subsequently fails to reconnect
+ * [retries every CONNECT_RETRY_CONFIG[:disconnected][:retry_every] seconds](./spec/acceptance/realtime/connection_failures_spec.rb#L322)
* when websocket transport is closed
- * [reconnects automatically](./spec/acceptance/realtime/connection_failures_spec.rb#L309)
+ * [reconnects automatically](./spec/acceptance/realtime/connection_failures_spec.rb#L365)
* after successfully reconnecting and resuming
- * [retains connection_id and connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L326)
- * [retains channel subscription state](./spec/acceptance/realtime/connection_failures_spec.rb#L343)
+ * [retains connection_id and connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L382)
+ * [retains channel subscription state](./spec/acceptance/realtime/connection_failures_spec.rb#L399)
* when messages were published whilst the client was disconnected
- * [receives the messages published whilst offline](./spec/acceptance/realtime/connection_failures_spec.rb#L363)
- * when failing to resume because the connection_key is not or no longer valid
- * [updates the connection_id and connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L403)
- * [detaches all channels](./spec/acceptance/realtime/connection_failures_spec.rb#L418)
- * [emits an error on the channel and sets the error reason](./spec/acceptance/realtime/connection_failures_spec.rb#L436)
+ * [receives the messages published whilst offline](./spec/acceptance/realtime/connection_failures_spec.rb#L429)
+ * when failing to resume
+ * because the connection_key is not or no longer valid
+ * [updates the connection_id and connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L470)
+ * [detaches all channels](./spec/acceptance/realtime/connection_failures_spec.rb#L485)
+ * [emits an error on the channel and sets the error reason](./spec/acceptance/realtime/connection_failures_spec.rb#L503)
* fallback host feature
* with custom realtime websocket host option
- * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L472)
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L542)
* with non-production environment
- * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L489)
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L559)
* with production environment
* when the Internet is down
- * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L517)
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L587)
* when the Internet is up
- * [uses a fallback host on every subsequent disconnected attempt until suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L534)
- * [uses the primary host when suspended, and a fallback host on every subsequent suspended attempt](./spec/acceptance/realtime/connection_failures_spec.rb#L553)
+ * [uses a fallback host on every subsequent disconnected attempt until suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L604)
+ * [uses the primary host when suspended, and a fallback host on every subsequent suspended attempt](./spec/acceptance/realtime/connection_failures_spec.rb#L623)
### Ably::Realtime::Connection
_(see [spec/acceptance/realtime/connection_spec.rb](./spec/acceptance/realtime/connection_spec.rb))_
* using JSON and MsgPack protocol
* intialization
- * [connects automatically](./spec/acceptance/realtime/connection_spec.rb#L22)
+ * [connects automatically](./spec/acceptance/realtime/connection_spec.rb#L23)
* with :connect_automatically option set to false
- * [does not connect automatically](./spec/acceptance/realtime/connection_spec.rb#L34)
- * [connects when method #connect is called](./spec/acceptance/realtime/connection_spec.rb#L42)
+ * [does not connect automatically](./spec/acceptance/realtime/connection_spec.rb#L35)
+ * [connects when method #connect is called](./spec/acceptance/realtime/connection_spec.rb#L43)
* with token auth
* for renewable tokens
* that are valid for the duration of the test
* with valid pre authorised token expiring in the future
- * [uses the existing token created by Auth](./spec/acceptance/realtime/connection_spec.rb#L60)
+ * [uses the existing token created by Auth](./spec/acceptance/realtime/connection_spec.rb#L61)
* with implicit authorisation
- * [uses the token created by the implicit authorisation](./spec/acceptance/realtime/connection_spec.rb#L72)
+ * [uses the token created by the implicit authorisation](./spec/acceptance/realtime/connection_spec.rb#L73)
* that expire
* opening a new connection
* with recently expired token
- * [renews the token on connect](./spec/acceptance/realtime/connection_spec.rb#L93)
+ * [renews the token on connect](./spec/acceptance/realtime/connection_spec.rb#L94)
* with immediately expiring token
- * [renews the token on connect, and only makes one subsequent attempt to obtain a new token](./spec/acceptance/realtime/connection_spec.rb#L107)
- * [uses the primary host for subsequent connection and auth requests](./spec/acceptance/realtime/connection_spec.rb#L117)
+ * [renews the token on connect, and only makes one subsequent attempt to obtain a new token](./spec/acceptance/realtime/connection_spec.rb#L108)
+ * [uses the primary host for subsequent connection and auth requests](./spec/acceptance/realtime/connection_spec.rb#L118)
* when connected with a valid non-expired token
* that then expires following the connection being opened
- * PENDING: *[retains connection state](./spec/acceptance/realtime/connection_spec.rb#L167)*
- * PENDING: *[changes state to failed if a new token cannot be issued](./spec/acceptance/realtime/connection_spec.rb#L168)*
+ * PENDING: *[retains connection state](./spec/acceptance/realtime/connection_spec.rb#L166)*
+ * PENDING: *[changes state to failed if a new token cannot be issued](./spec/acceptance/realtime/connection_spec.rb#L167)*
* the server
- * [disconnects the client, and the client automatically renews the token and then reconnects](./spec/acceptance/realtime/connection_spec.rb#L144)
+ * [disconnects the client, and the client automatically renews the token and then reconnects](./spec/acceptance/realtime/connection_spec.rb#L145)
* for non-renewable tokens
* that are expired
* opening a new connection
- * [transitions state to failed](./spec/acceptance/realtime/connection_spec.rb#L183)
+ * [transitions state to failed](./spec/acceptance/realtime/connection_spec.rb#L182)
* when connected
- * PENDING: *[transitions state to failed](./spec/acceptance/realtime/connection_spec.rb#L196)*
+ * PENDING: *[transitions state to failed](./spec/acceptance/realtime/connection_spec.rb#L195)*
* initialization state changes
* with implicit #connect
- * [are triggered in order](./spec/acceptance/realtime/connection_spec.rb#L223)
+ * [are triggered in order](./spec/acceptance/realtime/connection_spec.rb#L222)
* with explicit #connect
- * [are triggered in order](./spec/acceptance/realtime/connection_spec.rb#L229)
+ * [are triggered in order](./spec/acceptance/realtime/connection_spec.rb#L228)
* #connect
- * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L237)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L242)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/connection_spec.rb#L236)
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L241)
* when already connected
- * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L251)
+ * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L250)
* once connected
* connection#id
- * [is a string](./spec/acceptance/realtime/connection_spec.rb#L268)
- * [is unique from the connection#key](./spec/acceptance/realtime/connection_spec.rb#L275)
- * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L282)
+ * [is a string](./spec/acceptance/realtime/connection_spec.rb#L267)
+ * [is unique from the connection#key](./spec/acceptance/realtime/connection_spec.rb#L274)
+ * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L281)
* connection#key
- * [is a string](./spec/acceptance/realtime/connection_spec.rb#L291)
- * [is unique from the connection#id](./spec/acceptance/realtime/connection_spec.rb#L298)
- * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L305)
+ * [is a string](./spec/acceptance/realtime/connection_spec.rb#L290)
+ * [is unique from the connection#id](./spec/acceptance/realtime/connection_spec.rb#L297)
+ * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L304)
* following a previous connection being opened and closed
- * [reconnects and is provided with a new connection ID and connection key from the server](./spec/acceptance/realtime/connection_spec.rb#L315)
+ * [reconnects and is provided with a new connection ID and connection key from the server](./spec/acceptance/realtime/connection_spec.rb#L314)
* #serial connection serial
- * [is set to -1 when a new connection is opened](./spec/acceptance/realtime/connection_spec.rb#L335)
- * [is set to 0 when a message sent ACK is received](./spec/acceptance/realtime/connection_spec.rb#L357)
- * [is set to 1 when the second message sent ACK is received](./spec/acceptance/realtime/connection_spec.rb#L364)
+ * [is set to -1 when a new connection is opened](./spec/acceptance/realtime/connection_spec.rb#L334)
+ * [is set to 0 when a message sent ACK is received](./spec/acceptance/realtime/connection_spec.rb#L356)
+ * [is set to 1 when the second message sent ACK is received](./spec/acceptance/realtime/connection_spec.rb#L363)
* when a message is sent but the ACK has not yet been received
- * [the sent message msgSerial is 0 but the connection serial remains at -1](./spec/acceptance/realtime/connection_spec.rb#L344)
+ * [the sent message msgSerial is 0 but the connection serial remains at -1](./spec/acceptance/realtime/connection_spec.rb#L343)
* #close
- * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L375)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L382)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/connection_spec.rb#L374)
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L381)
* when already closed
- * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L393)
+ * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L392)
* when connection state is
* :initialized
- * [changes the connection state to :closing and then immediately :closed without sending a ProtocolMessage CLOSE](./spec/acceptance/realtime/connection_spec.rb#L421)
+ * [changes the connection state to :closing and then immediately :closed without sending a ProtocolMessage CLOSE](./spec/acceptance/realtime/connection_spec.rb#L420)
* :connected
- * [changes the connection state to :closing and waits for the server to confirm connection is :closed with a ProtocolMessage](./spec/acceptance/realtime/connection_spec.rb#L439)
+ * [changes the connection state to :closing and waits for the server to confirm connection is :closed with a ProtocolMessage](./spec/acceptance/realtime/connection_spec.rb#L438)
* with an unresponsive connection
- * [force closes the connection when a :closed ProtocolMessage response is not received](./spec/acceptance/realtime/connection_spec.rb#L469)
+ * [force closes the connection when a :closed ProtocolMessage response is not received](./spec/acceptance/realtime/connection_spec.rb#L468)
* #ping
- * [echoes a heart beat](./spec/acceptance/realtime/connection_spec.rb#L492)
+ * [echoes a heart beat](./spec/acceptance/realtime/connection_spec.rb#L491)
* when not connected
- * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L502)
+ * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L501)
+ * with a success block that raises an exception
+ * [catches the exception and logs the error](./spec/acceptance/realtime/connection_spec.rb#L508)
* recovery
* #recovery_key
- * [is composed of connection id and serial that is kept up to date with each message ACK received](./spec/acceptance/realtime/connection_spec.rb#L535)
- * [is available when connection is in one of the states: connecting, connected, disconnected, suspended, failed](./spec/acceptance/realtime/connection_spec.rb#L556)
- * [is nil when connection is explicitly CLOSED](./spec/acceptance/realtime/connection_spec.rb#L580)
+ * [is composed of connection id and serial that is kept up to date with each message ACK received](./spec/acceptance/realtime/connection_spec.rb#L545)
+ * [is available when connection is in one of the states: connecting, connected, disconnected, suspended, failed](./spec/acceptance/realtime/connection_spec.rb#L566)
+ * [is nil when connection is explicitly CLOSED](./spec/acceptance/realtime/connection_spec.rb#L590)
* opening a new connection using a recently disconnected connection's #recovery_key
* connection#id and connection#key after recovery
- * [remain the same](./spec/acceptance/realtime/connection_spec.rb#L594)
+ * [remains the same](./spec/acceptance/realtime/connection_spec.rb#L604)
* when messages have been sent whilst the old connection is disconnected
* the new connection
- * [recovers server-side queued messages](./spec/acceptance/realtime/connection_spec.rb#L619)
+ * [recovers server-side queued messages](./spec/acceptance/realtime/connection_spec.rb#L645)
* with :recover option
* with invalid syntax
- * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L644)
+ * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L670)
* with invalid formatted value sent to server
- * [triggers a fatal error on the connection object, sets the #error_reason and disconnects](./spec/acceptance/realtime/connection_spec.rb#L653)
+ * [triggers a fatal error on the connection object, sets the #error_reason and disconnects](./spec/acceptance/realtime/connection_spec.rb#L679)
* with expired (missing) value sent to server
- * [triggers an error on the connection object, sets the #error_reason, yet will connect anyway](./spec/acceptance/realtime/connection_spec.rb#L667)
+ * [triggers an error on the connection object, sets the #error_reason, yet will connect anyway](./spec/acceptance/realtime/connection_spec.rb#L694)
* with many connections simultaneously
- * [opens each with a unique connection#id and connection#key](./spec/acceptance/realtime/connection_spec.rb#L685)
+ * [opens each with a unique connection#id and connection#key](./spec/acceptance/realtime/connection_spec.rb#L713)
* when a state transition is unsupported
- * [emits a StateChangeError](./spec/acceptance/realtime/connection_spec.rb#L705)
+ * [emits a StateChangeError](./spec/acceptance/realtime/connection_spec.rb#L733)
+ * protocol failure
+ * receiving an invalid ProtocolMessage
+ * [emits an error on the connection and logs a fatal error message](./spec/acceptance/realtime/connection_spec.rb#L749)
* undocumented method
* #internet_up?
- * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L720)
+ * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L765)
+ * internet up URL protocol
+ * when using TLS for the connection
+ * [uses TLS for the Internet check to https://internet-up.ably-realtime.com/is-the-internet-up.txt](./spec/acceptance/realtime/connection_spec.rb#L776)
+ * when using a non-secured connection
+ * [uses TLS for the Internet check to http://internet-up.ably-realtime.com/is-the-internet-up.txt](./spec/acceptance/realtime/connection_spec.rb#L786)
* when the Internet is up
- * [calls the block with true](./spec/acceptance/realtime/connection_spec.rb#L726)
- * [calls the success callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L733)
+ * [calls the block with true](./spec/acceptance/realtime/connection_spec.rb#L795)
+ * [calls the success callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L802)
* when the Internet is down
- * [calls the block with false](./spec/acceptance/realtime/connection_spec.rb#L745)
- * [calls the failure callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L752)
+ * [calls the block with false](./spec/acceptance/realtime/connection_spec.rb#L814)
+ * [calls the failure callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L821)
### Ably::Realtime::Channel Message
_(see [spec/acceptance/realtime/message_spec.rb](./spec/acceptance/realtime/message_spec.rb))_
* using JSON and MsgPack protocol
* [sends a String data payload](./spec/acceptance/realtime/message_spec.rb#L25)
@@ -313,320 +328,377 @@
* [will not echo messages to the client but will still broadcast messages to other connected clients](./spec/acceptance/realtime/message_spec.rb#L106)
* publishing lots of messages across two connections
* [sends and receives the messages on both opened connections and calls the success callbacks for each message published](./spec/acceptance/realtime/message_spec.rb#L138)
* without suitable publishing permissions
* [calls the error callback](./spec/acceptance/realtime/message_spec.rb#L183)
+ * server incorrectly resends a message that was already received by the client library
+ * [discards the message and logs it as an error to the channel](./spec/acceptance/realtime/message_spec.rb#L202)
* encoding and decoding encrypted messages
* with AES-128-CBC using crypto-data-128.json fixtures
* item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
* behaves like an Ably encrypter and decrypter
* with #publish and #subscribe
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L266)
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L284)
* item 1 with encrypted encoding cipher+aes-128-cbc/base64
* behaves like an Ably encrypter and decrypter
* with #publish and #subscribe
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L266)
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L284)
* item 2 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
* behaves like an Ably encrypter and decrypter
* with #publish and #subscribe
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L266)
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L284)
* item 3 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
* behaves like an Ably encrypter and decrypter
* with #publish and #subscribe
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L266)
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L284)
* with AES-256-CBC using crypto-data-256.json fixtures
* item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
* behaves like an Ably encrypter and decrypter
* with #publish and #subscribe
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L266)
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L284)
* item 1 with encrypted encoding cipher+aes-256-cbc/base64
* behaves like an Ably encrypter and decrypter
* with #publish and #subscribe
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L266)
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L284)
* item 2 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
* behaves like an Ably encrypter and decrypter
* with #publish and #subscribe
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L266)
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L284)
* item 3 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
* behaves like an Ably encrypter and decrypter
* with #publish and #subscribe
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L266)
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L284)
* with multiple sends from one client to another
- * [encrypts and decrypts all messages](./spec/acceptance/realtime/message_spec.rb#L292)
+ * [encrypts and decrypts all messages](./spec/acceptance/realtime/message_spec.rb#L323)
* subscribing with a different transport protocol
- * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L335)
- * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L335)
- * [delivers a Hash payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L335)
+ * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L366)
+ * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L366)
+ * [delivers a Hash payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L366)
* publishing on an unencrypted channel and subscribing on an encrypted channel with another client
- * [does not attempt to decrypt the message](./spec/acceptance/realtime/message_spec.rb#L354)
+ * [does not attempt to decrypt the message](./spec/acceptance/realtime/message_spec.rb#L385)
* publishing on an encrypted channel and subscribing on an unencrypted channel with another client
- * [delivers the message but still encrypted with a value in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L372)
- * [triggers a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L381)
- * publishing on an encrypted channel and subscribing with a different algorithm on another client
- * [delivers the message but still encrypted with the cipher detials in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L403)
+ * [delivers the message but still encrypted with a value in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L403)
* [triggers a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L412)
- * publishing on an encrypted channel and subscribing with a different key on another client
- * [delivers the message but still encrypted with the cipher details in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L434)
+ * publishing on an encrypted channel and subscribing with a different algorithm on another client
+ * [delivers the message but still encrypted with the cipher detials in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L434)
* [triggers a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L443)
+ * publishing on an encrypted channel and subscribing with a different key on another client
+ * [delivers the message but still encrypted with the cipher details in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L465)
+ * [triggers a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L474)
### Ably::Realtime::Presence history
_(see [spec/acceptance/realtime/presence_history_spec.rb](./spec/acceptance/realtime/presence_history_spec.rb))_
* using JSON and MsgPack protocol
* [provides up to the moment presence history](./spec/acceptance/realtime/presence_history_spec.rb#L21)
* [ensures REST presence history message IDs match ProtocolMessage wrapped message and connection IDs via Realtime](./spec/acceptance/realtime/presence_history_spec.rb#L41)
### Ably::Realtime::Presence
_(see [spec/acceptance/realtime/presence_spec.rb](./spec/acceptance/realtime/presence_spec.rb))_
* using JSON and MsgPack protocol
- * PENDING: *[ensure connection_id is unique and updated on ENTER](./spec/acceptance/realtime/presence_spec.rb#L995)*
- * PENDING: *[ensure connection_id for presence member matches the messages they publish on the channel](./spec/acceptance/realtime/presence_spec.rb#L996)*
- * PENDING: *[stop a call to get when the channel has not been entered](./spec/acceptance/realtime/presence_spec.rb#L997)*
- * PENDING: *[stop a call to get when the channel has been entered but the list is not up to date](./spec/acceptance/realtime/presence_spec.rb#L998)*
- * PENDING: *[presence will resume sync if connection is dropped mid-way](./spec/acceptance/realtime/presence_spec.rb#L999)*
* when attached (but not present) on a presence channel with an anonymous client (no client ID)
- * [maintains state as other clients enter and leave the channel](./spec/acceptance/realtime/presence_spec.rb#L24)
+ * [maintains state as other clients enter and leave the channel](./spec/acceptance/realtime/presence_spec.rb#L118)
* #sync_complete?
* when attaching to a channel without any members present
- * [is true and the presence channel is considered synced immediately](./spec/acceptance/realtime/presence_spec.rb#L53)
+ * [is true and the presence channel is considered synced immediately](./spec/acceptance/realtime/presence_spec.rb#L190)
* when attaching to a channel with members present
- * [is false and the presence channel will subsequently be synced](./spec/acceptance/realtime/presence_spec.rb#L62)
- * when the SYNC of a presence channel spans multiple ProtocolMessage messages
- * with 250 existing (present) members
- * when a new client attaches to the presence channel
- * [emits :present for each member](./spec/acceptance/realtime/presence_spec.rb#L83)
+ * [is false and the presence channel will subsequently be synced](./spec/acceptance/realtime/presence_spec.rb#L199)
+ * 250 existing (present) members on a channel (3 SYNC pages)
+ * requires at least 3 SYNC ProtocolMessages
+ * when a client attaches to the presence channel
+ * [emits :present for each member](./spec/acceptance/realtime/presence_spec.rb#L231)
+ * and a member leaves before the SYNC operation is complete
+ * [emits :leave immediately as the member leaves](./spec/acceptance/realtime/presence_spec.rb#L245)
+ * [ignores presence events with timestamps prior to the current :present event in the MembersMap](./spec/acceptance/realtime/presence_spec.rb#L283)
+ * [does not emit :present after the :leave event has been emitted, and that member is not included in the list of members via #get](./spec/acceptance/realtime/presence_spec.rb#L322)
* #get
- * [#waits until sync is complete](./spec/acceptance/realtime/presence_spec.rb#L102)
+ * [waits until sync is complete](./spec/acceptance/realtime/presence_spec.rb#L368)
* automatic attachment of channel on access to presence object
- * [is implicit if presence state is initalized](./spec/acceptance/realtime/presence_spec.rb#L122)
- * [is disabled if presence state is not initialized](./spec/acceptance/realtime/presence_spec.rb#L130)
+ * [is implicit if presence state is initialized](./spec/acceptance/realtime/presence_spec.rb#L388)
+ * [is disabled if presence state is not initialized](./spec/acceptance/realtime/presence_spec.rb#L396)
* state
* once opened
- * [once opened, enters the :left state if the channel detaches](./spec/acceptance/realtime/presence_spec.rb#L147)
+ * [once opened, enters the :left state if the channel detaches](./spec/acceptance/realtime/presence_spec.rb#L413)
* #enter
- * [allows client_id to be set on enter for anonymous clients](./spec/acceptance/realtime/presence_spec.rb#L170)
- * [raises an exception if client_id is not set](./spec/acceptance/realtime/presence_spec.rb#L204)
- * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L209)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L214)
+ * [allows client_id to be set on enter for anonymous clients](./spec/acceptance/realtime/presence_spec.rb#L436)
+ * [raises an exception if client_id is not set](./spec/acceptance/realtime/presence_spec.rb#L483)
* data attribute
* when provided as argument option to #enter
- * [remains intact following #leave](./spec/acceptance/realtime/presence_spec.rb#L181)
+ * [remains intact following #leave](./spec/acceptance/realtime/presence_spec.rb#L447)
+ * message #connection_id
+ * [matches the current client connection_id](./spec/acceptance/realtime/presence_spec.rb#L471)
+ * without necessary capabilities to join presence
+ * [calls the Deferrable errback on capabilities failure](./spec/acceptance/realtime/presence_spec.rb#L495)
+ * it should behave like a public presence method
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L44)
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L44)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L56)
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L63)
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L73)
+ * if connection fails before success
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L94)
* #update
- * [without previous #enter automatically enters](./spec/acceptance/realtime/presence_spec.rb#L224)
- * [updates the data if :data argument provided](./spec/acceptance/realtime/presence_spec.rb#L249)
- * [updates the data to nil if :data argument is not provided (assumes nil value)](./spec/acceptance/realtime/presence_spec.rb#L259)
- * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L269)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L276)
+ * [without previous #enter automatically enters](./spec/acceptance/realtime/presence_spec.rb#L507)
+ * [updates the data if :data argument provided](./spec/acceptance/realtime/presence_spec.rb#L532)
+ * [updates the data to nil if :data argument is not provided (assumes nil value)](./spec/acceptance/realtime/presence_spec.rb#L542)
* when ENTERED
- * [has no effect on the state](./spec/acceptance/realtime/presence_spec.rb#L234)
+ * [has no effect on the state](./spec/acceptance/realtime/presence_spec.rb#L517)
+ * it should behave like a public presence method
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L44)
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L44)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L56)
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L63)
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L73)
+ * if connection fails before success
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L94)
* #leave
- * [raises an exception if not entered](./spec/acceptance/realtime/presence_spec.rb#L332)
- * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L337)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L344)
+ * [raises an exception if not entered](./spec/acceptance/realtime/presence_spec.rb#L600)
* :data option
* when set to a string
- * [emits the new data for the leave event](./spec/acceptance/realtime/presence_spec.rb#L293)
+ * [emits the new data for the leave event](./spec/acceptance/realtime/presence_spec.rb#L561)
* when set to nil
- * [emits the previously defined value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L306)
+ * [emits the previously defined value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L574)
* when not passed as an argument
- * [emits the previously defined value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L319)
+ * [emits the previously defined value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L587)
+ * it should behave like a public presence method
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L56)
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L63)
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L73)
+ * if connection fails before success
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L94)
* :left event
- * [emits the data defined in enter](./spec/acceptance/realtime/presence_spec.rb#L356)
- * [emits the data defined in update](./spec/acceptance/realtime/presence_spec.rb#L367)
+ * [emits the data defined in enter](./spec/acceptance/realtime/presence_spec.rb#L609)
+ * [emits the data defined in update](./spec/acceptance/realtime/presence_spec.rb#L620)
* entering/updating/leaving presence state on behalf of another client_id
* #enter_client
- * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L418)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L423)
* multiple times on the same channel with different client_ids
- * [has no affect on the client's presence state and only enters on behalf of the provided client_id](./spec/acceptance/realtime/presence_spec.rb#L388)
- * [enters a channel and sets the data based on the provided :data option](./spec/acceptance/realtime/presence_spec.rb#L402)
+ * [has no affect on the client's presence state and only enters on behalf of the provided client_id](./spec/acceptance/realtime/presence_spec.rb#L641)
+ * [enters a channel and sets the data based on the provided :data option](./spec/acceptance/realtime/presence_spec.rb#L655)
+ * message #connection_id
+ * [matches the current client connection_id](./spec/acceptance/realtime/presence_spec.rb#L674)
+ * it should behave like a public presence method
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L44)
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L44)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L56)
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L63)
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L73)
+ * if connection fails before success
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L94)
+ * without necessary capabilities to enter on behalf of another client
+ * [calls the Deferrable errback on capabilities failure](./spec/acceptance/realtime/presence_spec.rb#L696)
* #update_client
- * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L492)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L497)
* multiple times on the same channel with different client_ids
- * [updates the data attribute for the member when :data option provided](./spec/acceptance/realtime/presence_spec.rb#L433)
- * [updates the data attribute to null for the member when :data option is not provided (assumed null)](./spec/acceptance/realtime/presence_spec.rb#L457)
- * [enters if not already entered](./spec/acceptance/realtime/presence_spec.rb#L469)
+ * [updates the data attribute for the member when :data option provided](./spec/acceptance/realtime/presence_spec.rb#L707)
+ * [updates the data attribute to null for the member when :data option is not provided (assumed null)](./spec/acceptance/realtime/presence_spec.rb#L731)
+ * [enters if not already entered](./spec/acceptance/realtime/presence_spec.rb#L743)
+ * it should behave like a public presence method
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L44)
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L44)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L56)
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L63)
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L73)
+ * if connection fails before success
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L94)
* #leave_client
- * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L595)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L600)
* leaves a channel
* multiple times on the same channel with different client_ids
- * [emits the :leave event for each client_id](./spec/acceptance/realtime/presence_spec.rb#L508)
- * [succeeds if that client_id has not previously entered the channel](./spec/acceptance/realtime/presence_spec.rb#L532)
+ * [emits the :leave event for each client_id](./spec/acceptance/realtime/presence_spec.rb#L772)
+ * [succeeds if that client_id has not previously entered the channel](./spec/acceptance/realtime/presence_spec.rb#L796)
* with a new value in :data option
- * [emits the leave event with the new data value](./spec/acceptance/realtime/presence_spec.rb#L556)
+ * [emits the leave event with the new data value](./spec/acceptance/realtime/presence_spec.rb#L820)
* with a nil value in :data option
- * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L569)
+ * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L833)
* with no :data option
- * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L582)
+ * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L846)
+ * it should behave like a public presence method
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L44)
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L44)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L56)
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L63)
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L73)
+ * if connection fails before success
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L94)
* #get
- * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L610)
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L615)
- * [returns the current members on the channel](./spec/acceptance/realtime/presence_spec.rb#L622)
- * [filters by connection_id option if provided](./spec/acceptance/realtime/presence_spec.rb#L637)
- * [filters by client_id option if provided](./spec/acceptance/realtime/presence_spec.rb#L659)
- * [does not wait for SYNC to complete if :wait_for_sync option is false](./spec/acceptance/realtime/presence_spec.rb#L683)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L864)
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L869)
+ * [catches exceptions in the provided method block](./spec/acceptance/realtime/presence_spec.rb#L876)
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L884)
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L884)
+ * [returns the current members on the channel](./spec/acceptance/realtime/presence_spec.rb#L959)
+ * [filters by connection_id option if provided](./spec/acceptance/realtime/presence_spec.rb#L974)
+ * [filters by client_id option if provided](./spec/acceptance/realtime/presence_spec.rb#L996)
+ * [does not wait for SYNC to complete if :wait_for_sync option is false](./spec/acceptance/realtime/presence_spec.rb#L1020)
+ * during a sync
+ * [fails if the connection fails](./spec/acceptance/realtime/presence_spec.rb#L914)
+ * [fails if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L934)
* when a member enters and then leaves
- * [has no members](./spec/acceptance/realtime/presence_spec.rb#L693)
+ * [has no members](./spec/acceptance/realtime/presence_spec.rb#L1030)
* with lots of members on different clients
- * [returns a complete list of members on all clients](./spec/acceptance/realtime/presence_spec.rb#L710)
+ * [returns a complete list of members on all clients](./spec/acceptance/realtime/presence_spec.rb#L1047)
* #subscribe
* with no arguments
- * [calls the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L746)
+ * [calls the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L1083)
* #unsubscribe
* with no arguments
- * [removes the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L766)
+ * [removes the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L1105)
* REST #get
- * [returns current members](./spec/acceptance/realtime/presence_spec.rb#L785)
- * [returns no members once left](./spec/acceptance/realtime/presence_spec.rb#L798)
+ * [returns current members](./spec/acceptance/realtime/presence_spec.rb#L1124)
+ * [returns no members once left](./spec/acceptance/realtime/presence_spec.rb#L1137)
* client_id with ASCII_8BIT
* in connection set up
- * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L815)
+ * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L1154)
* in channel options
- * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L828)
+ * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L1167)
* encoding and decoding of presence message data
- * [encrypts presence message data](./spec/acceptance/realtime/presence_spec.rb#L852)
+ * [encrypts presence message data](./spec/acceptance/realtime/presence_spec.rb#L1191)
* #subscribe
- * [emits decrypted enter events](./spec/acceptance/realtime/presence_spec.rb#L871)
- * [emits decrypted update events](./spec/acceptance/realtime/presence_spec.rb#L883)
- * [emits previously set data for leave events](./spec/acceptance/realtime/presence_spec.rb#L897)
+ * [emits decrypted enter events](./spec/acceptance/realtime/presence_spec.rb#L1210)
+ * [emits decrypted update events](./spec/acceptance/realtime/presence_spec.rb#L1222)
+ * [emits previously set data for leave events](./spec/acceptance/realtime/presence_spec.rb#L1236)
* #get
- * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L913)
+ * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L1252)
* REST #get
- * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L926)
+ * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L1265)
* when cipher settings do not match publisher
- * [delivers an unencoded presence message left with encoding value](./spec/acceptance/realtime/presence_spec.rb#L941)
- * [emits an error when cipher does not match and presence data cannot be decoded](./spec/acceptance/realtime/presence_spec.rb#L954)
+ * [delivers an unencoded presence message left with encoding value](./spec/acceptance/realtime/presence_spec.rb#L1280)
+ * [emits an error when cipher does not match and presence data cannot be decoded](./spec/acceptance/realtime/presence_spec.rb#L1293)
* leaving
- * [expect :left event once underlying connection is closed](./spec/acceptance/realtime/presence_spec.rb#L971)
- * [expect :left event with client data from enter event](./spec/acceptance/realtime/presence_spec.rb#L981)
+ * [expect :left event once underlying connection is closed](./spec/acceptance/realtime/presence_spec.rb#L1310)
+ * [expect :left event with client data from enter event](./spec/acceptance/realtime/presence_spec.rb#L1320)
+ * connection failure mid-way through a large member sync
+ * PENDING: *[resumes the SYNC operation](./spec/acceptance/realtime/presence_spec.rb#L1339)*
### Ably::Realtime::Client#stats
_(see [spec/acceptance/realtime/stats_spec.rb](./spec/acceptance/realtime/stats_spec.rb))_
* using JSON and MsgPack protocol
* fetching stats
* [should return a PaginatedResource](./spec/acceptance/realtime/stats_spec.rb#L10)
- * [should return a Deferrable object](./spec/acceptance/realtime/stats_spec.rb#L17)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/stats_spec.rb#L17)
### Ably::Realtime::Client#time
_(see [spec/acceptance/realtime/time_spec.rb](./spec/acceptance/realtime/time_spec.rb))_
* using JSON and MsgPack protocol
* fetching the service time
* [should return the service time as a Time object](./spec/acceptance/realtime/time_spec.rb#L10)
- * [should return a deferrable object](./spec/acceptance/realtime/time_spec.rb#L19)
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/time_spec.rb#L19)
### Ably::Auth
_(see [spec/acceptance/rest/auth_spec.rb](./spec/acceptance/rest/auth_spec.rb))_
* using JSON and MsgPack protocol
* [has immutable options](./spec/acceptance/rest/auth_spec.rb#L54)
* #request_token
- * [returns the requested token](./spec/acceptance/rest/auth_spec.rb#L62)
+ * [returns a valid requested token in the expected format with valid issued_at and expires_at attributes](./spec/acceptance/rest/auth_spec.rb#L69)
* with option :client_id
- * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L93)
+ * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L95)
* with option :capability
- * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L93)
+ * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L95)
* with option :nonce
- * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L93)
+ * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L95)
* with option :timestamp
- * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L93)
+ * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L95)
* with option :ttl
- * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L93)
+ * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L95)
* with :key_id & :key_secret options
- * [key_id is used in request and signing uses key_secret](./spec/acceptance/rest/auth_spec.rb#L122)
+ * [key_id is used in request and signing uses key_secret](./spec/acceptance/rest/auth_spec.rb#L124)
* with :query_time option
- * [queries the server for the time](./spec/acceptance/rest/auth_spec.rb#L130)
+ * [queries the server for the time](./spec/acceptance/rest/auth_spec.rb#L132)
* without :query_time option
- * [does not query the server for the time](./spec/acceptance/rest/auth_spec.rb#L139)
+ * [does not query the server for the time](./spec/acceptance/rest/auth_spec.rb#L141)
* with :auth_url option
- * when response is valid
- * [requests a token from :auth_url using an HTTP GET request](./spec/acceptance/rest/auth_spec.rb#L186)
+ * when response from :auth_url is a valid token request
+ * [requests a token from :auth_url using an HTTP GET request](./spec/acceptance/rest/auth_spec.rb#L188)
+ * [returns a valid token generated from the token request](./spec/acceptance/rest/auth_spec.rb#L193)
* with :query_params
- * [requests a token from :auth_url with the :query_params](./spec/acceptance/rest/auth_spec.rb#L194)
+ * [requests a token from :auth_url with the :query_params](./spec/acceptance/rest/auth_spec.rb#L200)
* with :headers
- * [requests a token from :auth_url with the HTTP headers set](./spec/acceptance/rest/auth_spec.rb#L202)
+ * [requests a token from :auth_url with the HTTP headers set](./spec/acceptance/rest/auth_spec.rb#L208)
* with POST
- * [requests a token from :auth_url using an HTTP POST instead of the default GET](./spec/acceptance/rest/auth_spec.rb#L210)
+ * [requests a token from :auth_url using an HTTP POST instead of the default GET](./spec/acceptance/rest/auth_spec.rb#L216)
+ * when response from :auth_url is a token
+ * [returns a Token created from the token JSON](./spec/acceptance/rest/auth_spec.rb#L240)
* when response is invalid
* 500
- * [raises ServerError](./spec/acceptance/rest/auth_spec.rb#L223)
+ * [raises ServerError](./spec/acceptance/rest/auth_spec.rb#L255)
* XML
- * [raises InvalidResponseBody](./spec/acceptance/rest/auth_spec.rb#L234)
- * with token_request_block
- * [calls the block when authenticating to obtain the request token](./spec/acceptance/rest/auth_spec.rb#L252)
- * [uses the token request from the block when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L257)
+ * [raises InvalidResponseBody](./spec/acceptance/rest/auth_spec.rb#L266)
+ * with token_request_block that returns a token request
+ * [calls the block when authenticating to obtain the request token](./spec/acceptance/rest/auth_spec.rb#L284)
+ * [uses the token request from the block when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L289)
+ * with token_request_block that returns a token
+ * [calls the block when authenticating to obtain the request token](./spec/acceptance/rest/auth_spec.rb#L317)
+ * [uses the token request from the block when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L322)
* before #authorise has been called
- * [has no current_token](./spec/acceptance/rest/auth_spec.rb#L264)
+ * [has no current_token](./spec/acceptance/rest/auth_spec.rb#L334)
* #authorise
- * [updates the persisted auth options thare are then used for subsequent authorise requests](./spec/acceptance/rest/auth_spec.rb#L311)
+ * [updates the persisted auth options thare are then used for subsequent authorise requests](./spec/acceptance/rest/auth_spec.rb#L381)
* when called for the first time since the client has been instantiated
- * [passes all options to #request_token](./spec/acceptance/rest/auth_spec.rb#L275)
- * [returns a valid token](./spec/acceptance/rest/auth_spec.rb#L280)
- * [issues a new token if option :force => true](./spec/acceptance/rest/auth_spec.rb#L284)
+ * [passes all options to #request_token](./spec/acceptance/rest/auth_spec.rb#L345)
+ * [returns a valid token](./spec/acceptance/rest/auth_spec.rb#L350)
+ * [issues a new token if option :force => true](./spec/acceptance/rest/auth_spec.rb#L354)
* with previous authorisation
- * [does not request a token if current_token has not expired](./spec/acceptance/rest/auth_spec.rb#L295)
- * [requests a new token if token is expired](./spec/acceptance/rest/auth_spec.rb#L300)
- * [issues a new token if option :force => true](./spec/acceptance/rest/auth_spec.rb#L306)
+ * [does not request a token if current_token has not expired](./spec/acceptance/rest/auth_spec.rb#L365)
+ * [requests a new token if token is expired](./spec/acceptance/rest/auth_spec.rb#L370)
+ * [issues a new token if option :force => true](./spec/acceptance/rest/auth_spec.rb#L376)
* with token_request_block
- * [calls the block](./spec/acceptance/rest/auth_spec.rb#L327)
- * [uses the token request returned from the block when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L331)
+ * [calls the block](./spec/acceptance/rest/auth_spec.rb#L397)
+ * [uses the token request returned from the block when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L401)
* for every subsequent #request_token
* without a provided block
- * [calls the originally provided block](./spec/acceptance/rest/auth_spec.rb#L337)
+ * [calls the originally provided block](./spec/acceptance/rest/auth_spec.rb#L407)
* with a provided block
- * [does not call the originally provided block and calls the new #request_token block](./spec/acceptance/rest/auth_spec.rb#L344)
+ * [does not call the originally provided block and calls the new #request_token block](./spec/acceptance/rest/auth_spec.rb#L414)
* #create_token_request
- * [uses the key ID from the client](./spec/acceptance/rest/auth_spec.rb#L360)
- * [uses the default TTL](./spec/acceptance/rest/auth_spec.rb#L364)
- * [uses the default capability](./spec/acceptance/rest/auth_spec.rb#L368)
+ * [uses the key ID from the client](./spec/acceptance/rest/auth_spec.rb#L430)
+ * [uses the default TTL](./spec/acceptance/rest/auth_spec.rb#L434)
+ * [uses the default capability](./spec/acceptance/rest/auth_spec.rb#L438)
* the nonce
- * [is unique for every request](./spec/acceptance/rest/auth_spec.rb#L373)
- * [is at least 16 characters](./spec/acceptance/rest/auth_spec.rb#L378)
+ * [is unique for every request](./spec/acceptance/rest/auth_spec.rb#L443)
+ * [is at least 16 characters](./spec/acceptance/rest/auth_spec.rb#L448)
* with option :ttl
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L389)
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L459)
* with option :capability
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L389)
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L459)
* with option :nonce
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L389)
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L459)
* with option :timestamp
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L389)
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L459)
* with option :client_id
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L389)
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L459)
* with additional invalid attributes
- * [are ignored](./spec/acceptance/rest/auth_spec.rb#L397)
+ * [are ignored](./spec/acceptance/rest/auth_spec.rb#L467)
* when required fields are missing
- * [should raise an exception if key secret is missing](./spec/acceptance/rest/auth_spec.rb#L408)
- * [should raise an exception if key id is missing](./spec/acceptance/rest/auth_spec.rb#L412)
+ * [should raise an exception if key secret is missing](./spec/acceptance/rest/auth_spec.rb#L478)
+ * [should raise an exception if key id is missing](./spec/acceptance/rest/auth_spec.rb#L482)
* with :query_time option
- * [queries the server for the timestamp](./spec/acceptance/rest/auth_spec.rb#L421)
+ * [queries the server for the timestamp](./spec/acceptance/rest/auth_spec.rb#L491)
* with :timestamp option
- * [uses the provided timestamp in the token request](./spec/acceptance/rest/auth_spec.rb#L431)
+ * [uses the provided timestamp in the token request](./spec/acceptance/rest/auth_spec.rb#L501)
* signing
- * [generates a valid HMAC](./spec/acceptance/rest/auth_spec.rb#L448)
+ * [generates a valid HMAC](./spec/acceptance/rest/auth_spec.rb#L518)
* using token authentication
* with :token_id option
- * [authenticates successfully using the provided :token_id](./spec/acceptance/rest/auth_spec.rb#L471)
- * [disallows publishing on unspecified capability channels](./spec/acceptance/rest/auth_spec.rb#L475)
- * [fails if timestamp is invalid](./spec/acceptance/rest/auth_spec.rb#L483)
- * [cannot be renewed automatically](./spec/acceptance/rest/auth_spec.rb#L491)
+ * [authenticates successfully using the provided :token_id](./spec/acceptance/rest/auth_spec.rb#L541)
+ * [disallows publishing on unspecified capability channels](./spec/acceptance/rest/auth_spec.rb#L545)
+ * [fails if timestamp is invalid](./spec/acceptance/rest/auth_spec.rb#L553)
+ * [cannot be renewed automatically](./spec/acceptance/rest/auth_spec.rb#L561)
* when implicit as a result of using :client id
* and requests to the Ably server are mocked
- * [will send a token request to the server](./spec/acceptance/rest/auth_spec.rb#L521)
+ * [will send a token request to the server](./spec/acceptance/rest/auth_spec.rb#L591)
* a token is created
- * [before a request is made](./spec/acceptance/rest/auth_spec.rb#L530)
- * [when a message is published](./spec/acceptance/rest/auth_spec.rb#L534)
- * [with capability and TTL defaults](./spec/acceptance/rest/auth_spec.rb#L538)
+ * [before a request is made](./spec/acceptance/rest/auth_spec.rb#L600)
+ * [when a message is published](./spec/acceptance/rest/auth_spec.rb#L604)
+ * [with capability and TTL defaults](./spec/acceptance/rest/auth_spec.rb#L608)
* when using an :api_key and basic auth
- * [#using_token_auth? is false](./spec/acceptance/rest/auth_spec.rb#L553)
- * [#using_basic_auth? is true](./spec/acceptance/rest/auth_spec.rb#L557)
+ * [#using_token_auth? is false](./spec/acceptance/rest/auth_spec.rb#L623)
+ * [#using_basic_auth? is true](./spec/acceptance/rest/auth_spec.rb#L627)
### Ably::Rest
_(see [spec/acceptance/rest/base_spec.rb](./spec/acceptance/rest/base_spec.rb))_
* transport protocol
* when protocol is not defined it defaults to :msgpack
@@ -830,77 +902,77 @@
### Ably::Rest::Presence
_(see [spec/acceptance/rest/presence_spec.rb](./spec/acceptance/rest/presence_spec.rb))_
* using JSON and MsgPack protocol
* tested against presence fixture data set up in test app
* #get
- * [returns current members on the channel with their action set to :present](./spec/acceptance/rest/presence_spec.rb#L31)
+ * [returns current members on the channel with their action set to :present](./spec/acceptance/rest/presence_spec.rb#L30)
* with :limit option
- * [returns a paged response limiting number of members per page](./spec/acceptance/rest/presence_spec.rb#L45)
+ * [returns a paged response limiting number of members per page](./spec/acceptance/rest/presence_spec.rb#L44)
* #history
- * [returns recent presence activity](./spec/acceptance/rest/presence_spec.rb#L64)
+ * [returns recent presence activity](./spec/acceptance/rest/presence_spec.rb#L62)
* with options
* direction: :forwards
- * [returns recent presence activity forwards with most recent history last](./spec/acceptance/rest/presence_spec.rb#L80)
+ * [returns recent presence activity forwards with most recent history last](./spec/acceptance/rest/presence_spec.rb#L78)
* direction: :backwards
- * [returns recent presence activity backwards with most recent history first](./spec/acceptance/rest/presence_spec.rb#L95)
+ * [returns recent presence activity backwards with most recent history first](./spec/acceptance/rest/presence_spec.rb#L93)
* #history
* with time range options
* :start
* with milliseconds since epoch value
- * [uses this value in the history request](./spec/acceptance/rest/presence_spec.rb#L140)
+ * [uses this value in the history request](./spec/acceptance/rest/presence_spec.rb#L138)
* with Time object value
- * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/presence_spec.rb#L150)
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/presence_spec.rb#L148)
* :end
* with milliseconds since epoch value
- * [uses this value in the history request](./spec/acceptance/rest/presence_spec.rb#L140)
+ * [uses this value in the history request](./spec/acceptance/rest/presence_spec.rb#L138)
* with Time object value
- * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/presence_spec.rb#L150)
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/presence_spec.rb#L148)
* decoding
* valid decodeable content
* #get
- * [automaticaly decodes presence messages](./spec/acceptance/rest/presence_spec.rb#L208)
+ * [automaticaly decodes presence messages](./spec/acceptance/rest/presence_spec.rb#L206)
* #history
- * [automaticaly decodes presence messages](./spec/acceptance/rest/presence_spec.rb#L225)
+ * [automaticaly decodes presence messages](./spec/acceptance/rest/presence_spec.rb#L223)
* invalid data
* #get
- * [returns the messages still encoded](./spec/acceptance/rest/presence_spec.rb#L256)
- * [logs a cipher error](./spec/acceptance/rest/presence_spec.rb#L260)
+ * [returns the messages still encoded](./spec/acceptance/rest/presence_spec.rb#L254)
+ * [logs a cipher error](./spec/acceptance/rest/presence_spec.rb#L258)
* #history
- * [returns the messages still encoded](./spec/acceptance/rest/presence_spec.rb#L280)
- * [logs a cipher error](./spec/acceptance/rest/presence_spec.rb#L284)
+ * [returns the messages still encoded](./spec/acceptance/rest/presence_spec.rb#L278)
+ * [logs a cipher error](./spec/acceptance/rest/presence_spec.rb#L282)
### Ably::Rest::Client#stats
_(see [spec/acceptance/rest/stats_spec.rb](./spec/acceptance/rest/stats_spec.rb))_
* using JSON and MsgPack protocol
* fetching application stats
* by minute
* with :from set to last interval and :limit set to 1
- * [retrieves only one stat](./spec/acceptance/rest/stats_spec.rb#L51)
- * [returns accurate all aggregated message data](./spec/acceptance/rest/stats_spec.rb#L55)
- * [returns accurate inbound realtime all data](./spec/acceptance/rest/stats_spec.rb#L60)
- * [returns accurate inbound realtime message data](./spec/acceptance/rest/stats_spec.rb#L65)
- * [returns accurate outbound realtime all data](./spec/acceptance/rest/stats_spec.rb#L70)
- * [returns accurate persisted presence all data](./spec/acceptance/rest/stats_spec.rb#L75)
- * [returns accurate connections all data](./spec/acceptance/rest/stats_spec.rb#L80)
- * [returns accurate channels all data](./spec/acceptance/rest/stats_spec.rb#L85)
- * [returns accurate api_requests data](./spec/acceptance/rest/stats_spec.rb#L90)
- * [returns accurate token_requests data](./spec/acceptance/rest/stats_spec.rb#L95)
- * [returns stat objects with #interval_granularity equal to :minute](./spec/acceptance/rest/stats_spec.rb#L100)
- * [returns stat objects with #interval_id matching :start](./spec/acceptance/rest/stats_spec.rb#L104)
- * [returns stat objects with #interval_time matching :start Time](./spec/acceptance/rest/stats_spec.rb#L108)
+ * [retrieves only one stat](./spec/acceptance/rest/stats_spec.rb#L50)
+ * [returns all aggregated message data](./spec/acceptance/rest/stats_spec.rb#L54)
+ * [returns inbound realtime all data](./spec/acceptance/rest/stats_spec.rb#L59)
+ * [returns inbound realtime message data](./spec/acceptance/rest/stats_spec.rb#L64)
+ * [returns outbound realtime all data](./spec/acceptance/rest/stats_spec.rb#L69)
+ * [returns persisted presence all data](./spec/acceptance/rest/stats_spec.rb#L74)
+ * [returns connections all data](./spec/acceptance/rest/stats_spec.rb#L79)
+ * [returns channels all data](./spec/acceptance/rest/stats_spec.rb#L84)
+ * [returns api_requests data](./spec/acceptance/rest/stats_spec.rb#L89)
+ * [returns token_requests data](./spec/acceptance/rest/stats_spec.rb#L94)
+ * [returns stat objects with #interval_granularity equal to :minute](./spec/acceptance/rest/stats_spec.rb#L99)
+ * [returns stat objects with #interval_id matching :start](./spec/acceptance/rest/stats_spec.rb#L103)
+ * [returns stat objects with #interval_time matching :start Time](./spec/acceptance/rest/stats_spec.rb#L107)
* with :start set to first interval, :limit set to 1 and direction :forwards
- * [returns the first interval stats as stats are provided forwards from :start](./spec/acceptance/rest/stats_spec.rb#L118)
- * [returns 3 pages of stats](./spec/acceptance/rest/stats_spec.rb#L122)
+ * [returns the first interval stats as stats are provided forwards from :start](./spec/acceptance/rest/stats_spec.rb#L117)
+ * [returns 3 pages of stats](./spec/acceptance/rest/stats_spec.rb#L121)
* with :end set to last interval, :limit set to 1 and direction :backwards
- * [returns the 3rd interval stats first as stats are provided backwards from :end](./spec/acceptance/rest/stats_spec.rb#L135)
- * [returns 3 pages of stats](./spec/acceptance/rest/stats_spec.rb#L139)
+ * [returns the 3rd interval stats first as stats are provided backwards from :end](./spec/acceptance/rest/stats_spec.rb#L134)
+ * [returns 3 pages of stats](./spec/acceptance/rest/stats_spec.rb#L138)
* by hour
- * [should aggregate the stats for that period](./spec/acceptance/rest/stats_spec.rb#L163)
+ * [should aggregate the stats for that period](./spec/acceptance/rest/stats_spec.rb#L162)
* by day
- * [should aggregate the stats for that period](./spec/acceptance/rest/stats_spec.rb#L163)
+ * [should aggregate the stats for that period](./spec/acceptance/rest/stats_spec.rb#L162)
* by month
- * [should aggregate the stats for that period](./spec/acceptance/rest/stats_spec.rb#L163)
+ * [should aggregate the stats for that period](./spec/acceptance/rest/stats_spec.rb#L162)
### Ably::Rest::Client#time
_(see [spec/acceptance/rest/time_spec.rb](./spec/acceptance/rest/time_spec.rb))_
* using JSON and MsgPack protocol
* fetching the service time
@@ -1117,65 +1189,65 @@
* [is false when class type differs](./spec/shared/model_behaviour.rb#L50)
* is immutable
* [prevents changes](./spec/shared/model_behaviour.rb#L76)
* [dups options](./spec/shared/model_behaviour.rb#L80)
* #timestamp
- * [retrieves attribute :timestamp as Time object from ProtocolMessage](./spec/unit/models/message_spec.rb#L21)
+ * [retrieves attribute :timestamp as Time object from ProtocolMessage](./spec/unit/models/message_spec.rb#L22)
* #connection_id attribute
* when this model has a connectionId attribute
* but no protocol message
- * [uses the model value](./spec/unit/models/message_spec.rb#L36)
+ * [uses the model value](./spec/unit/models/message_spec.rb#L37)
* with a protocol message with a different connectionId
- * [uses the model value](./spec/unit/models/message_spec.rb#L44)
+ * [uses the model value](./spec/unit/models/message_spec.rb#L45)
* when this model has no connectionId attribute
* and no protocol message
- * [uses the model value](./spec/unit/models/message_spec.rb#L54)
+ * [uses the model value](./spec/unit/models/message_spec.rb#L55)
* with a protocol message with a connectionId
- * [uses the model value](./spec/unit/models/message_spec.rb#L62)
+ * [uses the model value](./spec/unit/models/message_spec.rb#L63)
* initialized with
* :name
* as UTF_8 string
- * [is permitted](./spec/unit/models/message_spec.rb#L89)
- * [remains as UTF-8](./spec/unit/models/message_spec.rb#L93)
+ * [is permitted](./spec/unit/models/message_spec.rb#L90)
+ * [remains as UTF-8](./spec/unit/models/message_spec.rb#L94)
* as SHIFT_JIS string
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L101)
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L105)
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L102)
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L106)
* as ASCII_8BIT string
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L113)
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L117)
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L114)
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L118)
* as Integer
- * [raises an argument error](./spec/unit/models/message_spec.rb#L125)
+ * [raises an argument error](./spec/unit/models/message_spec.rb#L126)
* as Nil
- * [is permitted](./spec/unit/models/message_spec.rb#L133)
+ * [is permitted](./spec/unit/models/message_spec.rb#L134)
* :client_id
* as UTF_8 string
- * [is permitted](./spec/unit/models/message_spec.rb#L89)
- * [remains as UTF-8](./spec/unit/models/message_spec.rb#L93)
+ * [is permitted](./spec/unit/models/message_spec.rb#L90)
+ * [remains as UTF-8](./spec/unit/models/message_spec.rb#L94)
* as SHIFT_JIS string
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L101)
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L105)
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L102)
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L106)
* as ASCII_8BIT string
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L113)
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L117)
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L114)
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L118)
* as Integer
- * [raises an argument error](./spec/unit/models/message_spec.rb#L125)
+ * [raises an argument error](./spec/unit/models/message_spec.rb#L126)
* as Nil
- * [is permitted](./spec/unit/models/message_spec.rb#L133)
+ * [is permitted](./spec/unit/models/message_spec.rb#L134)
* :encoding
* as UTF_8 string
- * [is permitted](./spec/unit/models/message_spec.rb#L89)
- * [remains as UTF-8](./spec/unit/models/message_spec.rb#L93)
+ * [is permitted](./spec/unit/models/message_spec.rb#L90)
+ * [remains as UTF-8](./spec/unit/models/message_spec.rb#L94)
* as SHIFT_JIS string
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L101)
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L105)
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L102)
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L106)
* as ASCII_8BIT string
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L113)
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L117)
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L114)
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L118)
* as Integer
- * [raises an argument error](./spec/unit/models/message_spec.rb#L125)
+ * [raises an argument error](./spec/unit/models/message_spec.rb#L126)
* as Nil
- * [is permitted](./spec/unit/models/message_spec.rb#L133)
+ * [is permitted](./spec/unit/models/message_spec.rb#L134)
### Ably::Models::PaginatedResource
_(see [spec/unit/models/paginated_resource_spec.rb](./spec/unit/models/paginated_resource_spec.rb))_
* [returns correct length from body](./spec/unit/models/paginated_resource_spec.rb#L30)
* [supports alias methods for length](./spec/unit/models/paginated_resource_spec.rb#L34)
@@ -1460,46 +1532,53 @@
* [is false when class type differs](./spec/unit/models/token_spec.rb#L82)
### Ably::Modules::EventEmitter
_(see [spec/unit/modules/event_emitter_spec.rb](./spec/unit/modules/event_emitter_spec.rb))_
* #trigger event fan out
- * [should emit an event for any number of subscribers](./spec/unit/modules/event_emitter_spec.rb#L18)
- * [sends only messages to matching event names](./spec/unit/modules/event_emitter_spec.rb#L27)
+ * [should emit an event for any number of subscribers](./spec/unit/modules/event_emitter_spec.rb#L19)
+ * [sends only messages to matching event names](./spec/unit/modules/event_emitter_spec.rb#L28)
* #on subscribe to multiple events
- * [with the same block](./spec/unit/modules/event_emitter_spec.rb#L59)
+ * [with the same block](./spec/unit/modules/event_emitter_spec.rb#L60)
* event callback changes within the callback block
* when new event callbacks are added
- * [is unaffected and processes the prior event callbacks once](./spec/unit/modules/event_emitter_spec.rb#L83)
- * [adds them for the next emitted event](./spec/unit/modules/event_emitter_spec.rb#L89)
+ * [is unaffected and processes the prior event callbacks once](./spec/unit/modules/event_emitter_spec.rb#L84)
+ * [adds them for the next emitted event](./spec/unit/modules/event_emitter_spec.rb#L90)
* when callbacks are removed
- * [is unaffected and processes the prior event callbacks once](./spec/unit/modules/event_emitter_spec.rb#L110)
- * [removes them for the next emitted event](./spec/unit/modules/event_emitter_spec.rb#L115)
+ * [is unaffected and processes the prior event callbacks once](./spec/unit/modules/event_emitter_spec.rb#L111)
+ * [removes them for the next emitted event](./spec/unit/modules/event_emitter_spec.rb#L116)
+ * #on
+ * [calls the block every time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L129)
+ * [catches exceptions in the provided block, logs the error and continues](./spec/unit/modules/event_emitter_spec.rb#L136)
* #once
- * [calls the block the first time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L128)
- * [does not remove other blocks after it is called](./spec/unit/modules/event_emitter_spec.rb#L135)
+ * [calls the block the first time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L158)
+ * [does not remove other blocks after it is called](./spec/unit/modules/event_emitter_spec.rb#L165)
+ * [catches exceptions in the provided block, logs the error and continues](./spec/unit/modules/event_emitter_spec.rb#L173)
+ * #unsafe_once
+ * [calls the block the first time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L181)
+ * [does not catch exceptions in provided blocks](./spec/unit/modules/event_emitter_spec.rb#L188)
* #off
* with event names as arguments
- * [deletes matching callbacks](./spec/unit/modules/event_emitter_spec.rb#L156)
- * [deletes all callbacks if not block given](./spec/unit/modules/event_emitter_spec.rb#L161)
- * [continues if the block does not exist](./spec/unit/modules/event_emitter_spec.rb#L166)
+ * [deletes matching callbacks](./spec/unit/modules/event_emitter_spec.rb#L206)
+ * [deletes all callbacks if not block given](./spec/unit/modules/event_emitter_spec.rb#L211)
+ * [continues if the block does not exist](./spec/unit/modules/event_emitter_spec.rb#L216)
* without any event names
- * [deletes all matching callbacks](./spec/unit/modules/event_emitter_spec.rb#L173)
- * [deletes all callbacks if not block given](./spec/unit/modules/event_emitter_spec.rb#L178)
+ * [deletes all matching callbacks](./spec/unit/modules/event_emitter_spec.rb#L223)
+ * [deletes all callbacks if not block given](./spec/unit/modules/event_emitter_spec.rb#L228)
### Ably::Modules::StateEmitter
_(see [spec/unit/modules/state_emitter_spec.rb](./spec/unit/modules/state_emitter_spec.rb))_
- * [#state returns current state](./spec/unit/modules/state_emitter_spec.rb#L25)
- * [#state= sets current state](./spec/unit/modules/state_emitter_spec.rb#L29)
- * [#change_state sets current state](./spec/unit/modules/state_emitter_spec.rb#L33)
+ * [#state returns current state](./spec/unit/modules/state_emitter_spec.rb#L28)
+ * [#state= sets current state](./spec/unit/modules/state_emitter_spec.rb#L32)
+ * [#change_state sets current state](./spec/unit/modules/state_emitter_spec.rb#L36)
* #change_state with arguments
- * [passes the arguments through to the triggered callback](./spec/unit/modules/state_emitter_spec.rb#L41)
+ * [passes the arguments through to the triggered callback](./spec/unit/modules/state_emitter_spec.rb#L44)
* #state?
- * [returns true if state matches](./spec/unit/modules/state_emitter_spec.rb#L52)
- * [returns false if state does not match](./spec/unit/modules/state_emitter_spec.rb#L56)
+ * [returns true if state matches](./spec/unit/modules/state_emitter_spec.rb#L55)
+ * [returns false if state does not match](./spec/unit/modules/state_emitter_spec.rb#L59)
* and convenience predicates for states
- * [returns true for #initializing? if state matches](./spec/unit/modules/state_emitter_spec.rb#L61)
- * [returns false for #connecting? if state does not match](./spec/unit/modules/state_emitter_spec.rb#L65)
+ * [returns true for #initializing? if state matches](./spec/unit/modules/state_emitter_spec.rb#L64)
+ * [returns false for #connecting? if state does not match](./spec/unit/modules/state_emitter_spec.rb#L68)
### Ably::Realtime::Channel
_(see [spec/unit/realtime/channel_spec.rb](./spec/unit/realtime/channel_spec.rb))_
* #initializer
* as UTF_8 string
@@ -1529,17 +1608,21 @@
* callbacks
* [are supported for valid STATE events](./spec/unit/realtime/channel_spec.rb#L118)
* [fail with unacceptable STATE event names](./spec/unit/realtime/channel_spec.rb#L124)
* subscriptions
* #subscribe
- * [to all events](./spec/unit/realtime/channel_spec.rb#L159)
- * [to specific events](./spec/unit/realtime/channel_spec.rb#L165)
+ * [without a block raises an invalid ArgumentError](./spec/unit/realtime/channel_spec.rb#L162)
+ * [with no event name specified subscribes the provided block to all events](./spec/unit/realtime/channel_spec.rb#L166)
+ * [with a single event name subscribes that block to matching events](./spec/unit/realtime/channel_spec.rb#L172)
+ * [with a multiple event name arguments subscribes that block to all of those event names](./spec/unit/realtime/channel_spec.rb#L179)
+ * [with a multiple duplicate event name arguments subscribes that block to all of those unique event names once](./spec/unit/realtime/channel_spec.rb#L191)
* #unsubscribe
- * [to all events](./spec/unit/realtime/channel_spec.rb#L181)
- * [to specific events](./spec/unit/realtime/channel_spec.rb#L187)
- * [to specific non-matching events](./spec/unit/realtime/channel_spec.rb#L193)
- * [all callbacks by not providing a callback](./spec/unit/realtime/channel_spec.rb#L199)
+ * [with no event name specified unsubscribes that block from all events](./spec/unit/realtime/channel_spec.rb#L206)
+ * [with a single event name argument unsubscribes the provided block with the matching event name](./spec/unit/realtime/channel_spec.rb#L212)
+ * [with multiple event name arguments unsubscribes each of those matching event names with the provided block](./spec/unit/realtime/channel_spec.rb#L218)
+ * [with a non-matching event name argument has no effect](./spec/unit/realtime/channel_spec.rb#L224)
+ * [with no block argument unsubscribes all blocks for the event name argument](./spec/unit/realtime/channel_spec.rb#L230)
### Ably::Realtime::Channels
_(see [spec/unit/realtime/channels_spec.rb](./spec/unit/realtime/channels_spec.rb))_
* creating channels
* [#get creates a channel](./spec/unit/realtime/channels_spec.rb#L13)
@@ -1547,11 +1630,11 @@
* [[] creates a channel](./spec/unit/realtime/channels_spec.rb#L24)
* #fetch
* [retrieves a channel if it exists](./spec/unit/realtime/channels_spec.rb#L31)
* [calls the block if channel is missing](./spec/unit/realtime/channels_spec.rb#L36)
* destroying channels
- * [#release detatches and then releases the channel resoures](./spec/unit/realtime/channels_spec.rb#L44)
+ * [#release detaches and then releases the channel resources](./spec/unit/realtime/channels_spec.rb#L44)
* is Enumerable
* [allows enumeration](./spec/unit/realtime/channels_spec.rb#L61)
* [provides #length](./spec/unit/realtime/channels_spec.rb#L77)
* #each
* [returns an enumerator](./spec/unit/realtime/channels_spec.rb#L66)
@@ -1582,33 +1665,35 @@
* [constructs an api_key](./spec/shared/client_initializer_behaviour.rb#L95)
* with a string key instead of options hash
* [sets the api_key](./spec/shared/client_initializer_behaviour.rb#L103)
* [sets the key_id](./spec/shared/client_initializer_behaviour.rb#L107)
* [sets the key_secret](./spec/shared/client_initializer_behaviour.rb#L111)
- * with token
+ * with a string token key instead of options hash
* [sets the token_id](./spec/shared/client_initializer_behaviour.rb#L119)
+ * with token
+ * [sets the token_id](./spec/shared/client_initializer_behaviour.rb#L127)
* endpoint
- * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L125)
+ * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L133)
* with environment option
- * [uses an alternate endpoint](./spec/shared/client_initializer_behaviour.rb#L132)
+ * [uses an alternate endpoint](./spec/shared/client_initializer_behaviour.rb#L140)
* tls
- * [defaults to TLS](./spec/shared/client_initializer_behaviour.rb#L151)
+ * [defaults to TLS](./spec/shared/client_initializer_behaviour.rb#L159)
* set to false
- * [uses plain text](./spec/shared/client_initializer_behaviour.rb#L142)
- * [uses HTTP](./spec/shared/client_initializer_behaviour.rb#L146)
+ * [uses plain text](./spec/shared/client_initializer_behaviour.rb#L150)
+ * [uses HTTP](./spec/shared/client_initializer_behaviour.rb#L154)
* logger
* default
- * [uses Ruby Logger](./spec/shared/client_initializer_behaviour.rb#L158)
- * [specifies Logger::ERROR log level](./spec/shared/client_initializer_behaviour.rb#L162)
+ * [uses Ruby Logger](./spec/shared/client_initializer_behaviour.rb#L166)
+ * [specifies Logger::ERROR log level](./spec/shared/client_initializer_behaviour.rb#L170)
* with log_level :none
- * [silences all logging with a NilLogger](./spec/shared/client_initializer_behaviour.rb#L170)
+ * [silences all logging with a NilLogger](./spec/shared/client_initializer_behaviour.rb#L178)
* with custom logger and log_level
- * [uses the custom logger](./spec/shared/client_initializer_behaviour.rb#L188)
- * [sets the custom log level](./spec/shared/client_initializer_behaviour.rb#L192)
+ * [uses the custom logger](./spec/shared/client_initializer_behaviour.rb#L196)
+ * [sets the custom log level](./spec/shared/client_initializer_behaviour.rb#L200)
* delegators
- * [delegates :client_id to .auth](./spec/shared/client_initializer_behaviour.rb#L202)
- * [delegates :auth_options to .auth](./spec/shared/client_initializer_behaviour.rb#L207)
+ * [delegates :client_id to .auth](./spec/shared/client_initializer_behaviour.rb#L210)
+ * [delegates :auth_options to .auth](./spec/shared/client_initializer_behaviour.rb#L215)
* delegation to the REST Client
* [passes on the options to the initializer](./spec/unit/realtime/client_spec.rb#L15)
* for attribute
* [#environment](./spec/unit/realtime/client_spec.rb#L23)
* [#use_tls?](./spec/unit/realtime/client_spec.rb#L23)
@@ -1626,22 +1711,68 @@
* callbacks
* [are supported for valid STATE events](./spec/unit/realtime/presence_spec.rb#L13)
* [fail with unacceptable STATE event names](./spec/unit/realtime/presence_spec.rb#L19)
* subscriptions
* #subscribe
- * [to all presence state actions](./spec/unit/realtime/presence_spec.rb#L60)
- * [to specific presence state actions](./spec/unit/realtime/presence_spec.rb#L66)
+ * [without a block raises an invalid ArgumentError](./spec/unit/realtime/presence_spec.rb#L62)
+ * [with no action specified subscribes the provided block to all action](./spec/unit/realtime/presence_spec.rb#L66)
+ * [with a single action argument subscribes that block to matching actions](./spec/unit/realtime/presence_spec.rb#L72)
+ * [with a multiple action arguments subscribes that block to all of those actions](./spec/unit/realtime/presence_spec.rb#L79)
+ * [with a multiple duplicate action arguments subscribes that block to all of those unique actions once](./spec/unit/realtime/presence_spec.rb#L91)
* #unsubscribe
- * [to all presence state actions](./spec/unit/realtime/presence_spec.rb#L86)
- * [to specific presence state actions](./spec/unit/realtime/presence_spec.rb#L92)
- * [to specific non-matching presence state actions](./spec/unit/realtime/presence_spec.rb#L98)
- * [all callbacks by not providing a callback](./spec/unit/realtime/presence_spec.rb#L104)
+ * [with no action specified unsubscribes that block from all events](./spec/unit/realtime/presence_spec.rb#L106)
+ * [with a single action argument unsubscribes the provided block with the matching action](./spec/unit/realtime/presence_spec.rb#L112)
+ * [with multiple action arguments unsubscribes each of those matching actions with the provided block](./spec/unit/realtime/presence_spec.rb#L118)
+ * [with a non-matching action argument has no effect](./spec/unit/realtime/presence_spec.rb#L124)
+ * [with no block argument unsubscribes all blocks for the action argument](./spec/unit/realtime/presence_spec.rb#L130)
### Ably::Realtime
_(see [spec/unit/realtime/realtime_spec.rb](./spec/unit/realtime/realtime_spec.rb))_
* [constructor returns an Ably::Realtime::Client](./spec/unit/realtime/realtime_spec.rb#L6)
+### Ably::Models::ProtocolMessage
+_(see [spec/unit/realtime/safe_deferrable_spec.rb](./spec/unit/realtime/safe_deferrable_spec.rb))_
+ * behaves like a safe Deferrable
+ * #errback
+ * [adds a callback that is called when #fail is called](./spec/shared/safe_deferrable_behaviour.rb#L15)
+ * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L22)
+ * #fail
+ * [calls the callbacks defined with #errback, but not the ones added for success #callback](./spec/shared/safe_deferrable_behaviour.rb#L32)
+ * #callback
+ * [adds a callback that is called when #succed is called](./spec/shared/safe_deferrable_behaviour.rb#L44)
+ * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L51)
+ * #succeed
+ * [calls the callbacks defined with #callback, but not the ones added for #errback](./spec/shared/safe_deferrable_behaviour.rb#L61)
+
+### Ably::Models::Message
+_(see [spec/unit/realtime/safe_deferrable_spec.rb](./spec/unit/realtime/safe_deferrable_spec.rb))_
+ * behaves like a safe Deferrable
+ * #errback
+ * [adds a callback that is called when #fail is called](./spec/shared/safe_deferrable_behaviour.rb#L15)
+ * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L22)
+ * #fail
+ * [calls the callbacks defined with #errback, but not the ones added for success #callback](./spec/shared/safe_deferrable_behaviour.rb#L32)
+ * #callback
+ * [adds a callback that is called when #succed is called](./spec/shared/safe_deferrable_behaviour.rb#L44)
+ * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L51)
+ * #succeed
+ * [calls the callbacks defined with #callback, but not the ones added for #errback](./spec/shared/safe_deferrable_behaviour.rb#L61)
+
+### Ably::Models::PresenceMessage
+_(see [spec/unit/realtime/safe_deferrable_spec.rb](./spec/unit/realtime/safe_deferrable_spec.rb))_
+ * behaves like a safe Deferrable
+ * #errback
+ * [adds a callback that is called when #fail is called](./spec/shared/safe_deferrable_behaviour.rb#L15)
+ * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L22)
+ * #fail
+ * [calls the callbacks defined with #errback, but not the ones added for success #callback](./spec/shared/safe_deferrable_behaviour.rb#L32)
+ * #callback
+ * [adds a callback that is called when #succed is called](./spec/shared/safe_deferrable_behaviour.rb#L44)
+ * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L51)
+ * #succeed
+ * [calls the callbacks defined with #callback, but not the ones added for #errback](./spec/shared/safe_deferrable_behaviour.rb#L61)
+
### Ably::Rest::Channels
_(see [spec/unit/rest/channel_spec.rb](./spec/unit/rest/channel_spec.rb))_
* #initializer
* as UTF_8 string
* [is permitted](./spec/unit/rest/channel_spec.rb#L16)
@@ -1711,33 +1842,35 @@
* [constructs an api_key](./spec/shared/client_initializer_behaviour.rb#L95)
* with a string key instead of options hash
* [sets the api_key](./spec/shared/client_initializer_behaviour.rb#L103)
* [sets the key_id](./spec/shared/client_initializer_behaviour.rb#L107)
* [sets the key_secret](./spec/shared/client_initializer_behaviour.rb#L111)
- * with token
+ * with a string token key instead of options hash
* [sets the token_id](./spec/shared/client_initializer_behaviour.rb#L119)
+ * with token
+ * [sets the token_id](./spec/shared/client_initializer_behaviour.rb#L127)
* endpoint
- * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L125)
+ * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L133)
* with environment option
- * [uses an alternate endpoint](./spec/shared/client_initializer_behaviour.rb#L132)
+ * [uses an alternate endpoint](./spec/shared/client_initializer_behaviour.rb#L140)
* tls
- * [defaults to TLS](./spec/shared/client_initializer_behaviour.rb#L151)
+ * [defaults to TLS](./spec/shared/client_initializer_behaviour.rb#L159)
* set to false
- * [uses plain text](./spec/shared/client_initializer_behaviour.rb#L142)
- * [uses HTTP](./spec/shared/client_initializer_behaviour.rb#L146)
+ * [uses plain text](./spec/shared/client_initializer_behaviour.rb#L150)
+ * [uses HTTP](./spec/shared/client_initializer_behaviour.rb#L154)
* logger
* default
- * [uses Ruby Logger](./spec/shared/client_initializer_behaviour.rb#L158)
- * [specifies Logger::ERROR log level](./spec/shared/client_initializer_behaviour.rb#L162)
+ * [uses Ruby Logger](./spec/shared/client_initializer_behaviour.rb#L166)
+ * [specifies Logger::ERROR log level](./spec/shared/client_initializer_behaviour.rb#L170)
* with log_level :none
- * [silences all logging with a NilLogger](./spec/shared/client_initializer_behaviour.rb#L170)
+ * [silences all logging with a NilLogger](./spec/shared/client_initializer_behaviour.rb#L178)
* with custom logger and log_level
- * [uses the custom logger](./spec/shared/client_initializer_behaviour.rb#L188)
- * [sets the custom log level](./spec/shared/client_initializer_behaviour.rb#L192)
+ * [uses the custom logger](./spec/shared/client_initializer_behaviour.rb#L196)
+ * [sets the custom log level](./spec/shared/client_initializer_behaviour.rb#L200)
* delegators
- * [delegates :client_id to .auth](./spec/shared/client_initializer_behaviour.rb#L202)
- * [delegates :auth_options to .auth](./spec/shared/client_initializer_behaviour.rb#L207)
+ * [delegates :client_id to .auth](./spec/shared/client_initializer_behaviour.rb#L210)
+ * [delegates :auth_options to .auth](./spec/shared/client_initializer_behaviour.rb#L215)
* initializer options
* TLS
* disabled
* [fails for any operation with basic auth and attempting to send an API key over a non-secure connection](./spec/unit/rest/client_spec.rb#L17)
* :use_token_auth
@@ -1787,8 +1920,8 @@
-------
## Test summary
- * Passing tests: 864
- * Pending tests: 11
+ * Passing tests: 942
+ * Pending tests: 7
* Failing tests: 0