Ably Realtime & REST Client Library 1.2.7 Specification

Ably::Realtime::Auth

(see {spec/acceptance/realtime/auth_spec.rb}[./spec/acceptance/realtime/auth_spec.rb]) * using JSON protocol * with basic auth * authentication_security_requirements_met? * returns true * key * contains the API key * key_name * contains the API key name * key_secret * contains the API key secret * using_basic_auth? * is true when using Basic Auth * using_token_auth? * is false when using Basic Auth * with token auth * client_id * contains the ClientOptions client ID * current_token_details * contains the current token after auth * token_renewable? * is true when an API key exists * options (auth_options) * contains the configured auth options * token_params * contains the configured auth options * using_basic_auth? * is false when using Token Auth * using_token_auth? * is true when using Token Auth * methods * create_token_request * returns a token request asynchronously * create_token_request_async * returns a token request synchronously * request_token * returns a token asynchronously * request_token_async * returns a token synchronously * authorize * with token auth * returns a token asynchronously * with auth_callback blocking * with a slow auth callback response * asynchronously authenticates * when implicitly called, with an explicit ClientOptions client_id * and an incompatible client_id in a TokenDetails object passed to the auth callback * rejects a TokenDetails object with an incompatible client_id and fails with an exception * and an incompatible client_id in a TokenRequest object passed to the auth callback and fails with an exception * rejects a TokenRequests object with an incompatible client_id and fails with an exception * when explicitly called, with an explicit ClientOptions client_id * and an incompatible client_id in a TokenDetails object passed to the auth callback * rejects a TokenDetails object with an incompatible client_id and fails with an exception * when already authenticated with a valid token * ensures message delivery continuity whilst upgrading (#RTC8a1) * when INITIALIZED * obtains a token and connects to Ably (#RTC8c, #RTC8b1) * when CONNECTING * aborts the current connection process, obtains a token, and connects to Ably again (#RTC8b) * when FAILED * obtains a token and connects to Ably (#RTC8c, #RTC8b1) * when CLOSED * obtains a token and connects to Ably (#RTC8c, #RTC8b1, #RTC8a3) * when in the CONNECTED state * with a valid token in the AUTH ProtocolMessage sent * PENDING: {obtains a new token (that upgrades from anonymous to identified) and upgrades the connection after receiving an updated CONNECTED ProtocolMessage (#RTC8a, #RTC8a3)}[./spec/acceptance/realtime/auth_spec.rb#L409] * obtains a new token (as anonymous user before & after) and upgrades the connection after receiving an updated CONNECTED ProtocolMessage (#RTC8a, #RTC8a3) * when DISCONNECTED * PENDING: {obtains a token, upgrades from anonymous to identified, and connects to Ably immediately (#RTC8c, #RTC8b1)}[./spec/acceptance/realtime/auth_spec.rb#L481] * obtains a similar anonymous token and connects to Ably immediately (#RTC8c, #RTC8b1) * when SUSPENDED * obtains a token and connects to Ably immediately (#RTC8c, #RTC8b1) * when client is identified * transitions the connection state to FAILED if the client_id changes (#RSA15c, #RTC8a2) * when auth fails * transitions the connection state to the FAILED state (#RSA15c, #RTC8a2, #RTC8a3) * when the authCallback fails * calls the error callback of authorize and leaves the connection intact (#RSA4c3) * when upgrading capabilities * is allowed (#RTC8a1) * when downgrading capabilities (RTC8a1) * is allowed and channels are detached * authorize_async * returns a token synchronously * server initiated AUTH ProtocolMessage * when received * should immediately start a new authentication process (#RTN22) * when not received * should expect the connection to be disconnected by the server but should resume automatically (#RTN22a) * auth_params * returns the auth params asynchronously * auth_params_sync * returns the auth params synchronously * auth_header * returns an auth header asynchronously * auth_header_sync * returns an auth header synchronously * client_id_validated? * when using basic auth * before connected * is false as basic auth users do not have an identity * once connected * is true * contains a validated wildcard client_id * when using a token string * with a valid client_id * before connected * is false as identification is not possible from an opaque token string * #client_id is nil * once connected * is true * #client_id is populated * with no client_id (anonymous) * before connected * is false as identification is not possible from an opaque token string * once connected * is true * with a wildcard client_id (anonymous) * before connected * is false as identification is not possible from an opaque token string * once connected * is true * when using a token * with a client_id * is true * once connected * is true * with no client_id (anonymous) * is true * once connected * is true * with a wildcard client_id (anonymous) * is true * once connected * is true * when using a token request with a client_id * is not true as identification is not confirmed until authenticated * once connected * is true as identification is completed following CONNECTED ProtocolMessage * deprecated authorise * logs a deprecation warning (#RSA10l) * returns a valid token (#RSA10l) * when using JWT * when using auth_url * when credentials are valid * client successfully fetches a channel and publishes a message * when credentials are wrong * disconnected includes and invalid signature message * when token is expired * receives a 40142 error from the server * when using auth_callback * when credentials are valid * authentication succeeds and client can post a message * when credentials are invalid * authentication fails and reason for disconnection is invalid signature * when the client is initialized with ClientOptions and the token is a JWT token * when credentials are valid * posts successfully to a channel * when credentials are invalid * fails with an invalid signature error * when JWT token expires * client disconnects, a new token is requested via auth_callback and the client gets reconnected * and an AUTH procol message is received * client reauths correctly without going through a disconnection * when the JWT token request includes a client_id * the client_id is the same that was specified in the auth_callback that generated the JWT token * when the JWT token request includes a subscribe-only capability * client fails to publish to a channel with subscribe-only capability and publishes successfully on a channel with permissions

Ably::Realtime::Channel#history

(see {spec/acceptance/realtime/channel_history_spec.rb}[./spec/acceptance/realtime/channel_history_spec.rb]) * using JSON protocol * returns a SafeDeferrable that catches exceptions in callbacks and logs them * with a single client publishing and receiving * retrieves realtime history * with two clients publishing messages on the same channel * retrieves realtime history on both channels * with lots of messages published with a single client and channel * as one ProtocolMessage * retrieves history forwards with pagination through :limit option * retrieves history backwards with pagination through :limit option * in multiple ProtocolMessages * retrieves limited history forwards with pagination * retrieves limited history backwards with pagination * and REST history * return the same results with unique matching message IDs * with option until_attach: true * retrieves all messages before channel was attached * fails the deferrable unless the state is attached * when channel receives update event after an attachment * updates attach_serial * and two pages of messages * retrieves two pages of messages before channel was attached

Ably::Realtime::Channel

(see {spec/acceptance/realtime/channel_spec.rb}[./spec/acceptance/realtime/channel_spec.rb]) * using JSON protocol * initialization * with :auto_connect option set to false on connection * remains initialized when accessing a channel * opens a connection implicitly on #attach * attach * returns a SafeDeferrable that catches exceptions in callbacks and logs them * calls the SafeDeferrable callback on success (#RTL4d) * when initialized * emits attaching then attached events * ignores subsequent #attach calls but calls the success callback if provided * attaches to a channel * attaches to a channel and calls the provided block (#RTL4d) * sets attach_serial property after the attachment (#RTL15a) * sends an ATTACH and waits for an ATTACHED (#RTL4c) * implicitly attaches the channel (#RTL7c) * context when channel options contain modes * sends an ATTACH with options as flags (#RTL4l) * when channel is reattaching * sends ATTACH_RESUME flag along with other modes (RTL4j) * context when channel options contain params * sends an ATTACH with params (#RTL4k) * when received attached * decodes flags and sets it as modes on channel options (#RTL4m) * set params as channel options params (#RTL4k1) * when the implicit channel attach fails * registers the listener anyway (#RTL7c) * when an ATTACHED acknowledge is not received on the current connection * sends another ATTACH each time the connection becomes connected * when state is :attached * does nothing (#RTL4a) * when state is :failed * reattaches and sets the errorReason to nil (#RTL4g) * when state is :detaching * does the attach operation after the completion of the pending request (#RTL4h) * with many connections and many channels on each simultaneously * attaches all channels * failure as a result of insufficient key permissions * emits failed event (#RTL4e) * calls the errback of the returned Deferrable (#RTL4d) * updates the error_reason * and subsequent authorisation with suitable permissions * attaches to the channel successfully and resets the channel error_reason * with connection state * is initialized (#RTL4i) * is connecting (#RTL4i) * is disconnected (#RTL4i) * clean attach (RTL4j) * when channel wasn’t previously attached * doesn’t send ATTACH_RESUME * when channel was explicitly detached * doesn’t send ATTACH_RESUME * detach * when state is :attached * it detaches from a channel (#RTL5d) * detaches from a channel and calls the provided block (#RTL5d, #RTL5e) * emits :detaching then :detached events * returns a SafeDeferrable that catches exceptions in callbacks and logs them * calls the Deferrable callback on success * and DETACHED message is not received within realtime request timeout * fails the deferrable and returns to the previous state (#RTL5f, #RTL5e) * when state is :failed * fails the deferrable (#RTL5b) * when state is :attaching * waits for the attach to complete and then moves to detached * when state is :detaching * ignores subsequent #detach calls but calls the callback if provided (#RTL5i) * when state is :suspended * moves the channel state immediately to DETACHED state (#RTL5j) * when state is :initialized * does nothing as there is no channel to detach (#RTL5a) * returns a valid deferrable * when state is :detached * does nothing as the channel is detached (#RTL5a) * when connection state is * closing * fails the deferrable (#RTL5b) * failed and channel is failed * fails the deferrable (#RTL5b) * failed and channel is detached * fails the deferrable (#RTL5b) * initialized * does the detach operation once the connection state is connected (#RTL5h) * connecting * does the detach operation once the connection state is connected (#RTL5h) * disconnected * does the detach operation once the connection state is connected (#RTL5h) * automatic channel recovery * when an ATTACH request times out * moves to the SUSPENDED state (#RTL4f) * if a subsequent ATTACHED is received on an ATTACHED channel * ignores the additional ATTACHED if resumed is true (#RTL12) * emits an UPDATE only when resumed is true (#RTL12) * emits an UPDATE when resumed is true and includes the reason error from the ProtocolMessage (#RTL12) * publish * when channel is attached (RTL6c1) * publishes messages * #(RTL17) * when channel is initialized * sends messages only on attach * when channel is attaching * sends messages only on attach * when channel is detaching * stops sending message * when channel is detached * stops sending message * when channel is failed * errors when trying to send a message * when channel is not attached in state Initializing (RTL6c1) * publishes messages immediately and does not implicitly attach (#RTL6c1) * when channel is Attaching (RTL6c1) * publishes messages immediately (#RTL6c1) * when channel is Detaching (RTL6c1) * publishes messages immediately (#RTL6c1) * when channel is Detached (RTL6c1) * publishes messages immediately (#RTL6c1) * with :queue_messages client option set to false (RTL6c4) * and connection state connected (RTL6c4) * publishes the message * and connection state initialized (RTL6c4) * fails the deferrable * and connection state connecting (RTL6c4) * fails the deferrable * and connection state disconnected (RTL6c4) * fails the deferrable * and connection state suspended (RTL6c4) * fails the deferrable * and connection state closing (RTL6c4) * fails the deferrable * and connection state closed (RTL6c4) * fails the deferrable * and the channel state is failed (RTL6c4) * fails the deferrable * with name and data arguments * publishes the message and return true indicating success * and additional attributes * publishes the message with the attributes and return true indicating success * and additional invalid attributes * throws an exception * with an array of Hash objects with :name and :data attributes * publishes an array of messages in one ProtocolMessage * with an array of Message objects * publishes an array of messages in one ProtocolMessage * nil attributes * when name is nil * publishes the message without a name attribute in the payload * when data is nil * publishes the message without a data attribute in the payload * with neither name or data attributes * publishes the message without any attributes in the payload * with two invalid message out of 12 * before client_id is known (validated) * calls the errback once * when client_id is known (validated) * raises an exception * only invalid messages * before client_id is known (validated) * calls the errback once * when client_id is known (validated) * raises an exception * with many many messages and many connections simultaneously * publishes all messages, all success callbacks are called, and a history request confirms all messages were published * with more than allowed messages in a single publish * rejects the publish * identified clients * when authenticated with a wildcard client_id * with a valid client_id in the message * succeeds * with a wildcard client_id in the message * throws an exception * with a non-String client_id in the message * throws an exception * with an empty client_id in the message * succeeds and publishes without a client_id * when authenticated with a Token string with an implicit client_id * before the client is CONNECTED and the client’s identity has been obtained * with a valid client_id in the message * succeeds * with an invalid client_id in the message * succeeds in the client library ( while connecting ) but then fails when delivered to Ably * with an empty client_id in the message * succeeds and publishes with an implicit client_id * after the client is CONNECTED and the client’s identity is known * with a valid client_id in the message * succeeds * with an invalid client_id in the message * throws an exception * with an empty client_id in the message * succeeds and publishes with an implicit client_id * when authenticated with a valid client_id * with a valid client_id * succeeds * with a wildcard client_id in the message * throws an exception * with an invalid client_id in the message * throws an exception * with an empty client_id in the message * succeeds and publishes with an implicit client_id * when anonymous and no client_id * with a client_id in the message * throws an exception * with a wildcard client_id in the message * throws an exception * with an empty client_id in the message * succeeds and publishes with an implicit client_id * message size exceeded (TO3l8) * and max_message_size is default (65536 bytes) * should allow to send a message (32 bytes) * should not allow to send a message (700000 bytes) * and max_message_size is customized (11 bytes) * and the message size is 30 bytes * should not allow to send a message * and max_message_size is nil * and the message size is 30 bytes * should allow to send a message * and the message size is 65537 bytes * should not allow to send a message * subscribe * with an event argument * subscribes for a single event * before attach * receives messages as soon as attached * with no event argument * subscribes for all events * with a callback that raises an exception * logs the error and continues * many times with different event names * filters events accordingly to each callback * unsubscribe * with an event argument * unsubscribes for a single event * with no event argument * unsubscribes for a single event * when connection state changes to * :failed * an :attaching channel * transitions state to :failed (#RTL3a) * an :attached channel * transitions state to :failed (#RTL3a) * updates the channel error_reason (#RTL3a) * a :detached channel * remains in the :detached state (#RTL3a) * a :failed channel * remains in the :failed state and ignores the failure error (#RTL3a) * a channel ATTACH request * fails the deferrable (#RTL4b) * :closed * an :attached channel * transitions state to :detached (#RTL3b) * an :attaching channel (RTL3b) * transitions state to :detached * a :detached channel * remains in the :detached state (#RTL3b) * a :failed channel * remains in the :failed state and retains the error_reason (#RTL3b) * a channel ATTACH request when connection CLOSED * fails the deferrable (#RTL4b) * a channel ATTACH request when connection CLOSING * fails the deferrable (#RTL4b) * :suspended * an :attaching channel * transitions state to :suspended (#RTL3c) * an :attached channel * transitions state to :suspended (#RTL3c) * reattaching (RTN15c3) * transitions state automatically to :attaching once the connection is re-established * sends ATTACH_RESUME flag when reattaching (RTL4j) * a :detached channel * remains in the :detached state (#RTL3c) * a :failed channel * remains in the :failed state and retains the error_reason (#RTL3c) * a channel ATTACH request when connection SUSPENDED (RTL4b) * fails the deferrable * :connected * a :suspended channel * is automatically reattached (#RTL3d) * when re-attach attempt fails * returns to a suspended state (#RTL3d) * :disconnected * with an initialized channel * has no effect on the channel states (#RTL3e) * with an attaching channel * has no effect on the channel states (#RTL3e) * with an attached channel * has no effect on the channel states (#RTL3e) * with a detached channel * has no effect on the channel states (#RTL3e) * with a failed channel * has no effect on the channel states (#RTL3e) * presence * returns a Ably::Realtime::Presence object * set_options (RTL16a) * when channel is attaching * behaves like an update that sends ATTACH message * sends an ATTACH message on options change * when channel is attached * behaves like an update that sends ATTACH message * sends an ATTACH message on options change * when channel is initialized * doesn’t send ATTACH message * channel state change * emits a ChannelStateChange object * ChannelStateChange object * has current state * has a previous state * has the event that generated the state change (#TA5) * has an empty reason when there is no error * on failure * has a reason Error object when there is an error on the channel * resume (RTL2f) * is false when a channel first attaches * is true when a connection is recovered and the channel is attached * is false when a connection fails to recover and the channel is attached * when a connection resume fails * is false when channel_serial goes nil (RTP5a1) and the channel is automatically re-attached * is true when channel_serial is intact and the channel is automatically re-attached * moves to * suspended * all queued messages fail with NACK (#RTL11) * all published messages awaiting an ACK do nothing (#RTL11a) * failed * all queued messages fail with NACK (#RTL11) * all published messages awaiting an ACK do nothing (#RTL11a) * when it receives a server-initiated DETACHED (RTL13) * and channel is initialized (RTL13) * does nothing * and channel is failed * does nothing (#RTL13) * and channel is attached * reattaches immediately (#RTL13a) with ATTACH_RESUME flag(RTL4j) * and channel is suspended * reattaches immediately (#RTL13a) with ATTACH_RESUME flag(RTL4j) * when connection is no longer connected * will not attempt to reattach (#RTL13c) * and channel is attaching * will move to the SUSPENDED state and then attempt to ATTACH with the ATTACHING state (#RTL13b) * when it receives an ERROR ProtocolMessage * should transition to the failed state and the error_reason should be set (#RTL14)

Ably::Realtime::Channels

(see {spec/acceptance/realtime/channels_spec.rb}[./spec/acceptance/realtime/channels_spec.rb]) * using JSON protocol * when channel supposed to trigger reattachment per RTL16a (RTS3c1) * will raise an error * params keys are the same but values are different * will raise an error * using shortcut method channel on the client object * behaves like a channel * returns a channel object * returns channel object and passes the provided options * using get method on client#channels * behaves like a channel * returns a channel object * returns channel object and passes the provided options * accessing an existing channel object with different options * overrides the existing channel options and returns the channel object * shows deprecation warning * accessing an existing channel object without specifying any channel options * returns the existing channel without modifying the channel options * using undocumented array accessor [] method on client#channels * behaves like a channel * returns a channel object * returns channel object and passes the provided options

Ably::Realtime::Client

(see {spec/acceptance/realtime/client_spec.rb}[./spec/acceptance/realtime/client_spec.rb]) * using JSON protocol * initialization * basic auth * is enabled by default with a provided :key option * with an invalid API key * logs an entry with a help href url matching the code #TI5 * :tls option * set to false to force a plain-text connection * fails to connect because a private key cannot be sent over a non-secure connection * token auth * with TLS enabled * and a pre-generated Token provided with the :token option * connects using token auth * with valid :key and :use_token_auth option set to true * automatically authorizes on connect and generates a token * with TLS disabled * and a pre-generated Token provided with the :token option * connects using token auth * with valid :key and :use_token_auth option set to true * automatically authorizes on connect and generates a token * with a Proc for the :auth_callback option * calls the Proc * uses the token request returned from the callback when requesting a new token * when the returned token has a client_id * sets Auth#client_id to the new token’s client_id immediately when connecting * sets Client#client_id to the new token’s client_id immediately when connecting * with a wildcard client_id token * and an explicit client_id in ClientOptions * allows uses the explicit client_id in the connection * and client_id omitted in ClientOptions * uses the token provided clientId in the connection * with an invalid wildcard “” :client_id raises an exception * realtime connection settings * defaults * disconnected_retry_timeout is 15s * suspended_retry_timeout is 30s * overriden in ClientOptions * disconnected_retry_timeout is updated * suspended_retry_timeout is updated * connection * provides access to the Connection object * channels * provides access to the Channels collection object * auth * provides access to the Realtime::Auth object * request (RSC19) get * returns an HttpPaginatedResponse object * 404 request to invalid URL * returns an object with 404 status code and error message * paged results * provides paging * post * supports post * delete * supports delete * patch * supports patch * put * supports put * publish (TBC) * publishing a message implicity connects and publishes the message successfully on the provided channel * publishing does not result in a channel being created * publishing supports an array of Message objects * publishing supports an array of Hash objects * publishing on a closed connection fails * with extras * publishing supports extras * queue_messages ClientOption * when true * will queue messages whilst connecting and publish once connected * when false * will reject messages on an initializing connection * with more than allowed messages in a single publish * rejects the publish

Ably::Realtime::Connection failures

(see {spec/acceptance/realtime/connection_failures_spec.rb}[./spec/acceptance/realtime/connection_failures_spec.rb]) * using JSON protocol * authentication failure * when API key is invalid * with invalid app part of the key * enters the failed state and returns a not found error * with invalid key name part of the key * enters the failed state and returns an authorization error * with auth_url * opening a new connection * request fails due to network failure * the connection moves to the disconnected state and tries again, returning again to the disconnected state (#RSA4c, #RSA4c1, #RSA4c2) * request fails due to invalid content * the connection moves to the disconnected state and tries again, returning again to the disconnected state (#RSA4c, #RSA4c1, #RSA4c2) * request fails due to slow response and subsequent timeout * the connection moves to the disconnected state and tries again, returning again to the disconnected state (#RSA4c, #RSA4c1, #RSA4c2) * request fails once due to slow response but succeeds the second time * the connection moves to the disconnected state and tries again, returning again to the disconnected state (#RSA4c, #RSA4c1, #RSA4c2) * existing CONNECTED connection * authorize request failure leaves connection in existing condition * the connection remains in the CONNECTED state and authorize fails (#RSA4c, #RSA4c1, #RSA4c3) * with auth_callback * opening a new connection * when callback fails due to an exception * the connection moves to the disconnected state and tries again, returning again to the disconnected state (#RSA4c, #RSA4c1, #RSA4c2) * existing CONNECTED connection * when callback fails due to the request taking longer than realtime_request_timeout * the authorization request fails as configured in the realtime_request_timeout (#RSA4c, #RSA4c1, #RSA4c3) * automatic connection retry * with invalid WebSocket host * when disconnected * enters the suspended state after multiple attempts to connect * for the first time * reattempts connection immediately and then waits disconnected_retry_timeout for a subsequent attempt * close * transitions connection state to :closed * when connection state is :suspended * stays in the suspended state after any number of reconnection attempts * for the first time * waits suspended_retry_timeout before attempting to reconnect * close * transitions connection state to :closed * when connection state is :failed * close * will not transition state to :close and fails with an InvalidStateChange exception * error_reason * contains the error when state is disconnected * contains the error when state is suspended * contains the error when state is failed * is reset to nil when :connected * is reset to nil when :closed * connect * connection opening times out * attempts to reconnect * when retry intervals are stubbed to attempt reconnection quickly * never calls the provided success block * connection resume * when DISCONNECTED ProtocolMessage received from the server * reconnects automatically and immediately (#RTN15a) * when protocolMessage contains token error * library does not have a means to renew the token (RTN15h1) * moves connection state to failed * library have a means to renew the token (RTN15h2) * attempts to reconnect * connection state freshness is monitored * resumes connections when disconnected within the connection_state_ttl period (#RTN15g) * when connection_state_ttl period has passed since being disconnected * clears the local connection state and uses a new connection when the connection_state_ttl period has passed (#RTN15g) * when connection_state_ttl period has passed since last activity on the connection * does not clear the local connection state when the connection_state_ttl period has passed since last activity, but the idle timeout has not passed (#RTN15g1, #RTN15g2) * clears the local connection state and uses a new connection when the connection_state_ttl + max_idle_interval period has passed since last activity (#RTN15g1, #RTN15g2) * still reattaches the channels automatically following a new connection being established (#RTN15g2) * and subsequently fails to reconnect * retries every 15 seconds * when websocket transport is abruptly disconnected * reconnects automatically * hosts used * reconnects with the default host * after successfully reconnecting and resuming * retains connection_id and updates the connection_key (#RTN15e, #RTN16d) * includes the error received in the connection state change from Ably but leaves the channels attached * retains channel subscription state * retains the client_msg_serial (#RTN15c2, #RTN15c3) * when messages were published whilst the client was disconnected * receives the messages published whilst offline * when failing to resume * because the connection_key is not or no longer valid * updates the connection_id and connection_key * issue a reattach for all attached channels and fail all message awaiting an ACK (#RTN15c3) * issue a reattach for all attaching channels and fail all queued messages (#RTN15c3) * issue a attach for all suspended channels (#RTN15c3) * sets the error reason on each channel * continues to use the client_msg_serial (#RTN15c3) * as the DISCONNECTED window to resume has passed * starts a new connection automatically and does not try and resume * when an ERROR protocol message is received * whilst connecting * with a token error code in the range 40140 <= code < 40150 (RTN14b) * triggers a re-authentication * with an error code indicating an error other than a token failure (RTN14g, RTN15i) * causes the connection to fail * with no error code indicating an error other than a token failure (RTN14g, RTN15i) * causes the connection to fail * whilst connected * with a token error code in the range 40140 <= code < 40150 (RTN14b) * triggers a re-authentication * with an error code indicating an error other than a token failure (RTN14g, RTN15i) * causes the connection to fail * with no error code indicating an error other than a token failure (RTN14g, RTN15i) * causes the connection to fail * whilst resuming * with a token error code in the region 40140 <= code < 40150 (RTN15c5) * triggers a re-authentication and then resumes the connection * with any other error (RTN15c4) * moves the connection to the failed state * fallback host feature * with custom realtime websocket host option * never uses a fallback host * with custom realtime websocket port option * never uses a fallback host * with non-production environment * :fallback_hosts_use_default is unset * uses fallback hosts by default * :fallback_hosts_use_default is true * uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k7) * does not use a fallback host if the connection connects on the default host and then later becomes disconnected * :fallback_hosts array is provided * uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6) * with production environment * when the Internet is down * never uses a fallback host * when the Internet is up * and default options * uses a fallback host + the original host once on every subsequent disconnected attempt until suspended * uses the primary host when suspended, and then every fallback host and the primary host again on every subsequent suspended attempt * uses the correct host name for the WebSocket requests to the fallback hosts * :fallback_hosts array is provided by an empty array * uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6) * :fallback_hosts array is provided * uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6)

Ably::Realtime::Connection

(see {spec/acceptance/realtime/connection_spec.rb}[./spec/acceptance/realtime/connection_spec.rb]) * using JSON protocol * intialization * connects automatically * current_host * is available immediately after the client is instanced * with :auto_connect option set to false * does not connect automatically * connects when method #connect is called * with token auth * for renewable tokens * that are valid for the duration of the test * with valid pre authorized token expiring in the future * uses the existing token created by Auth * that expire * opening a new connection * with almost expired tokens * renews token every time after it expires * with immediately expired token and no fallback hosts * renews the token on connect, and makes one immediate subsequent attempt to obtain a new token (#RSA4b) * when disconnected_retry_timeout is 0.5 seconds * renews the token on connect, and continues to attempt renew based on the retry schedule * using implicit token auth * uses the primary host for subsequent connection and auth requests * when connected with a valid non-expired token * that then expires following the connection being opened * the server * disconnects the client, and the client automatically renews the token and then reconnects * connection state * retains messages published when disconnected three times during authentication * and subsequent token is invalid * transitions the connection to the failed state * for non-renewable tokens * that are expired * opening a new connection * transitions state to failed (#RSA4a) * when connected * transitions state to failed (#RSA4a) * with opaque token string that contain an implicit client_id * string * sets the Client#client_id and Auth#client_id once CONNECTED * that is incompatible with the current client client_id * fails the connection * wildcard * configures the Client#client_id and Auth#client_id with a wildcard once CONNECTED * initialization state changes * with implicit connect * are emitted in order * with explicit connect * are emitted in order * connect with no fallbacks * returns a SafeDeferrable that catches exceptions in callbacks and logs them * calls the Deferrable callback on success * calls the provided block on success even if state changes to disconnected first * when can’t connect to host * logs error on failed connection attempt * when explicitly reconnecting disconnected/suspended connection in retry (RTN11c) * when suspended * reconnects immediately * when disconnected * reconnects immediately * when reconnecting a failed connection * transitions all channels state to initialized and cleares error_reason * with invalid auth details * calls the Deferrable errback only once on connection failure * when already connected * does nothing and no further state changes are emitted * connection#id * is null before connecting * connection#key * is null before connecting * once connected * connection#id * is a string * is unique from the connection#key * is unique for every connection * connection#key * is a string * is unique from the connection#id * is unique for every connection * following a previous connection being opened and closed * reconnects and is provided with a new connection ID and connection key from the server * when closing * fails the deferrable before the connection is closed * msgSerial * when messages are queued for publish before a connection is established * the msgSerial is always incrementing (and not reset when the new connection is established) ensuring messages are never de-duped by the realtime service * close * returns a SafeDeferrable that catches exceptions in callbacks and logs them * calls the Deferrable callback on success * when already closed * does nothing and no further state changes are emitted * when connection state is * :initialized * changes the connection state to :closing and then immediately :closed without sending a ProtocolMessage CLOSE * :connecting RTN12f * :connected does not arrive when trying to close * moves to closed * :connected arrive when trying to close * moves to connected and then to closed * :connected * changes the connection state to :closing and waits for the server to confirm connection is :closed with a ProtocolMessage * with an unresponsive connection * force closes the connection when a :closed ProtocolMessage response is not received * :suspended RTN12d * immediatly closes connection * :disconnected RTN12d * immediatly closes connection * ping * echoes a heart beat (#RTN13a) * sends a unique ID in each protocol message (#RTN13e) * waits until the connection becomes CONNECTED when in the CONNETING state * with incompatible states * when not connected * fails the deferrable (#RTN13b) * when suspended * fails the deferrable (#RTN13b) * when failed * fails the deferrable (#RTN13b) * when closed * fails the deferrable (#RTN13b) * when it becomes closed * fails the deferrable (#RTN13b) * with a success block that raises an exception * catches the exception and logs the error * when ping times out * fails the deferrable logs a warning (#RTN13a, #RTN13c) * yields to the block with a nil value * Heartbeats (RTN23) * heartbeat interval * when reduced artificially * is the sum of the max_idle_interval and realtime_request_timeout (#RTN23a) * disconnects the transport if no heartbeat received since connected (#RTN23a) * disconnects the transport if no heartbeat received since last event received (#RTN23a) * transport-level heartbeats are supported in the websocket transport * provides the heartbeats argument in the websocket connection params (#RTN23b) * receives websocket heartbeat messages (#RTN23b) [slow test as need to wait for heartbeat] * with websocket heartbeats disabled (undocumented) * does not provide the heartbeats argument in the websocket connection params (#RTN23b) * receives websocket protocol messages (#RTN23b) [slow test as need to wait for heartbeat] * details * is nil before connected * contains the ConnectionDetails object once connected (#RTN21) * contains the new ConnectionDetails object once a subsequent connection is created (#RTN21) * with a different default connection_state_ttl * updates the private Connection#connection_state_ttl when received from Ably in ConnectionDetails * recovery * recovery_key * is available when connection is in one of the states: connecting, connected, disconnected * is nil when connection is explicitly CLOSED * opening a new connection using a recently disconnected connection’s recovery_key * connection#id after recovery * remains the same * when messages have been sent whilst the old connection is disconnected * the new connection * recovers server-side queued messages * when messages have been published * the new connection * uses the correct msgSerial from the old connection * when messages are published before the new connection is recovered * the new connection * uses the correct msgSerial from the old connection for the queued messages * with :recover option * with invalid syntax * logs recovery decode error as a warning and connects successfully * with invalid connection key * connects but sets the error reason and includes the reason in the state change * with many connections simultaneously * opens each with a unique connection#id and connection#key * when a state transition is unsupported * logs the invalid state change as fatal * protocol failure * receiving an invalid ProtocolMessage * emits an error on the connection and logs a fatal error message * undocumented method * internet_up? * returns a Deferrable * 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 * when using a non-secured connection * uses TLS for the Internet check to http://internet-up.ably-realtime.com/is-the-internet-up.txt * when the Internet is up * calls the block with true * calls the success callback of the Deferrable * with a TLS connection * checks the Internet up URL over TLS * with a non-TLS connection * checks the Internet up URL over TLS * when the Internet is down * calls the block with false * calls the failure callback of the Deferrable * state change side effects * when connection enters the :disconnected state * queues messages to be sent and all channels remain attached * when connection enters the :suspended state * moves the channels into the suspended state and prevents publishing of messages on those channels * when connection enters the :failed state * sets all channels to failed and prevents publishing of messages on those channels * connection state change * emits event to all and single subscribers * emits a ConnectionStateChange object * ConnectionStateChange object * has current state * has a previous state * has the event that generated the state change (#TH5) * has an empty reason when there is no error * on failure * has a reason Error object when there is an error on the connection * retry_in * is nil when a retry is not required * is 0 when first attempt to connect fails * is 0 when an immediate reconnect will occur * contains the next retry period when an immediate reconnect will not occur * whilst CONNECTED * when a CONNECTED message is received (RTN24) * emits an UPDATE event * updates the ConnectionDetail and Connection attributes (#RTC8a1) * when a CONNECTED message with an error is received * emits an UPDATE event * version params * sends the protocol version param v (#G4, #RTN2f) * sends the lib version param agent (#RCS7d) * transport_params (RTC1f) * pases transport_params to query * when changing default param * overrides default param (#RTC1f1)

Ably::Realtime::Channel Message

(see {spec/acceptance/realtime/message_spec.rb}[./spec/acceptance/realtime/message_spec.rb]) * using JSON protocol * sends a String data payload * with supported data payload content type * JSON Object (Hash) * is encoded and decoded to the same hash * JSON Array * is encoded and decoded to the same Array * String * is encoded and decoded to the same Array * Binary * is encoded and decoded to the same Array * a single Message object (RSL1a) * publishes the message * an array of Message objects (RSL1a) * publishes three messages * an array of hashes (RSL1a) * publishes three messages * a name with data payload (RSL1a, RSL1b) * publishes a message * with supported extra payload content type (RTL6h, RSL6a2) * JSON Object (Hash) * is encoded and decoded to the same hash * JSON Array * is encoded and decoded to the same Array * nil * is encoded and decoded to the same Array * with unsupported data payload content type * Integer * is raises an UnsupportedDataType 40013 exception * Float * is raises an UnsupportedDataType 40013 exception * Boolean * is raises an UnsupportedDataType 40013 exception * False * is raises an UnsupportedDataType 40013 exception * with ASCII_8BIT message name * is converted into UTF_8 * when the message publisher has a client_id * contains a #client_id attribute * connection_id attribute * over realtime * matches the sender connection#id * when retrieved over REST * matches the sender connection#id * local echo when published * is enabled by default * with :echo_messages option set to false * will not echo messages to the client but will still broadcast messages to other connected clients * will not echo messages to the client from other REST clients publishing using that connection_key * will echo messages with a valid connection_id to the client from other REST clients publishing using that connection_key * 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 * without suitable publishing permissions * calls the error callback * encoding and decoding encrypted messages * with AES-128-CBC using crypto-data-128.json fixtures (RTL7d) * 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * with AES-256-CBC using crypto-data-256.json fixtures (RTL7d) * 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 4 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 5 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 6 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 7 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 8 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 9 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 10 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 11 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 12 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 13 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 14 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 15 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 16 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 17 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 18 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 19 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 20 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 21 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 22 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 23 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 24 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 25 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 26 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 27 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 28 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 29 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 30 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 31 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 32 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 33 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 34 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 35 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 36 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 37 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 38 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 39 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 40 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 41 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 42 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 43 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 44 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 45 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 46 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 47 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 48 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 49 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 50 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 51 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 52 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 53 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 54 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 55 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 56 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 57 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 58 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 59 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 60 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 61 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 62 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 63 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 64 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 65 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 66 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 67 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 68 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 69 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 70 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 71 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 72 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 73 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 (#RTL7d) * sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d) * with multiple sends from one client to another * encrypts and decrypts all messages * receives raw messages with the correct encoding * subscribing with a different transport protocol * delivers a String ASCII-8BIT payload to the receiver * delivers a String UTF-8 payload to the receiver * delivers a Hash payload to the receiver * publishing on an unencrypted channel and subscribing on an encrypted channel with another client * does not attempt to decrypt the message * 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 (#RTL7e) * logs a Cipher error (#RTL7e) * 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 (#RTL7e) * emits a Cipher error on the channel (#RTL7e) * 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 * emits a Cipher error on the channel * when message is published, the connection disconnects before the ACK is received, and the connection is resumed * publishes the message again, later receives the ACK and only one message is ever received from Ably * when message is published, the connection disconnects before the ACK is received * the connection is not resumed * calls the errback for all messages * the connection becomes suspended * calls the errback for all messages * the connection becomes failed * calls the errback for all messages * message encoding interoperability * over a JSON transport * when decoding string * ensures that client libraries have compatible encoding and decoding using common fixtures * when encoding string * ensures that client libraries have compatible encoding and decoding using common fixtures * when decoding string * ensures that client libraries have compatible encoding and decoding using common fixtures * when encoding string * ensures that client libraries have compatible encoding and decoding using common fixtures * when decoding jsonObject * ensures that client libraries have compatible encoding and decoding using common fixtures * when encoding jsonObject * ensures that client libraries have compatible encoding and decoding using common fixtures * when decoding jsonArray * ensures that client libraries have compatible encoding and decoding using common fixtures * when encoding jsonArray * ensures that client libraries have compatible encoding and decoding using common fixtures * when decoding binary * ensures that client libraries have compatible encoding and decoding using common fixtures * when encoding binary * ensures that client libraries have compatible encoding and decoding using common fixtures * over a MsgPack transport * when publishing a string using JSON protocol * receives the message over MsgPack and the data matches * when retrieving a string using JSON protocol * is compatible with a publishes using MsgPack * when publishing a string using JSON protocol * receives the message over MsgPack and the data matches * when retrieving a string using JSON protocol * is compatible with a publishes using MsgPack * when publishing a jsonObject using JSON protocol * receives the message over MsgPack and the data matches * when retrieving a jsonObject using JSON protocol * is compatible with a publishes using MsgPack * when publishing a jsonArray using JSON protocol * receives the message over MsgPack and the data matches * when retrieving a jsonArray using JSON protocol * is compatible with a publishes using MsgPack * when publishing a binary using JSON protocol * receives the message over MsgPack and the data matches * when retrieving a binary using JSON protocol * is compatible with a publishes using MsgPack

Ably::Realtime::Presence history

(see {spec/acceptance/realtime/presence_history_spec.rb}[./spec/acceptance/realtime/presence_history_spec.rb]) * using JSON protocol * provides up to the moment presence history * ensures REST presence history message IDs match ProtocolMessage wrapped message and connection IDs via Realtime

Ably::Realtime::Presence

(see {spec/acceptance/realtime/presence_spec.rb}[./spec/acceptance/realtime/presence_spec.rb]) * using JSON protocol * 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 (#RTP2e) * sync_complete? and SYNC flags (RTP1) * when attaching to a channel without any members present * sync_complete? is true, no members are received and the presence channel is synced (#RTP1) * when attaching to a channel with members present * sync_complete? is false, there is a presence flag, and the presence channel is subsequently synced (#RTP1) * 101 existing (present) members on a channel (2 SYNC pages) * requiring at least 2 SYNC ProtocolMessages * when a client attaches to the presence channel * emits :present for each member * and a member enters before the SYNC operation is complete * emits a :enter immediately and the member is :present once the sync is complete (#RTP2g) * and a member leaves before the SYNC operation is complete * emits :leave immediately as the member leaves and cleans up the ABSENT member after (#RTP2f, #RTP2g) * ignores presence events with timestamps / identifiers prior to the current :present event in the MembersMap (#RTP2c) * does not emit :present after the :leave event has been emitted, and that member is not included in the list of members via #get (#RTP2f) * get * by default * waits until sync is complete (#RTP11c1) * with :wait_for_sync option set to false (RTP11c1) * it does not wait for sync * state * once opened * once opened, enters the :left state if the channel detaches * enter * data attribute * when provided as argument option to enter * changes to value provided in #leave * message connection_id * matches the current client connection_id * without necessary capabilities to join presence * calls the Deferrable errback on capabilities failure * it should behave like a public presence method * presence enter : raise an exception if the channel is detached * presence enter : raise an exception if the channel becomes detached * presence enter : raise an exception if the channel is failed * presence enter : raise an exception if the channel becomes failed * implicitly attaches the channel * returns a SafeDeferrable that catches exceptions in callbacks and logs them * allows a block to be passed in that is executed upon success * calls the Deferrable callback on success * catches exceptions in the provided method block and logs them to the logger * when :queue_messages client option is false * and connection state initialized * fails the deferrable * and connection state connecting * fails the deferrable * and connection state disconnected * fails the deferrable * and connection state connected * publishes the message * with supported data payload content type * JSON Object (Hash) * is encoded and decoded to the same hash * JSON Array * is encoded and decoded to the same Array * String * is encoded and decoded to the same Array * Binary * is encoded and decoded to the same Array * with unsupported data payload content type * Integer * raises an UnsupportedDataType 40013 exception * Float * raises an UnsupportedDataType 40013 exception * Boolean * raises an UnsupportedDataType 40013 exception * False * raises an UnsupportedDataType 40013 exception * if connection fails before success * calls the Deferrable errback if channel is detached * update * without previous #enter automatically enters * updates the data if :data argument provided * updates the data to nil if :data argument is not provided (assumes nil value) * when ENTERED * has no effect on the state * it should behave like a public presence method * presence update : raise an exception if the channel is detached * presence update : raise an exception if the channel becomes detached * presence update : raise an exception if the channel is failed * presence update : raise an exception if the channel becomes failed * implicitly attaches the channel * returns a SafeDeferrable that catches exceptions in callbacks and logs them * allows a block to be passed in that is executed upon success * calls the Deferrable callback on success * catches exceptions in the provided method block and logs them to the logger * when :queue_messages client option is false * and connection state initialized * fails the deferrable * and connection state connecting * fails the deferrable * and connection state disconnected * fails the deferrable * and connection state connected * publishes the message * with supported data payload content type * JSON Object (Hash) * is encoded and decoded to the same hash * JSON Array * is encoded and decoded to the same Array * String * is encoded and decoded to the same Array * Binary * is encoded and decoded to the same Array * with unsupported data payload content type * Integer * raises an UnsupportedDataType 40013 exception * Float * raises an UnsupportedDataType 40013 exception * Boolean * raises an UnsupportedDataType 40013 exception * False * raises an UnsupportedDataType 40013 exception * if connection fails before success * calls the Deferrable errback if channel is detached * leave * succeeds and does not emit an event (#RTP10d) * :data option * when set to a string * emits the new data for the leave event * when set to nil * emits the last value for the data attribute when leaving * when not passed as an argument (i.e. nil) * emits the previous value for the data attribute when leaving * and sync is complete * does not cache members that have left * it should behave like a public presence method * returns a SafeDeferrable that catches exceptions in callbacks and logs them * allows a block to be passed in that is executed upon success * calls the Deferrable callback on success * catches exceptions in the provided method block and logs them to the logger * with supported data payload content type * JSON Object (Hash) * is encoded and decoded to the same hash * JSON Array * is encoded and decoded to the same Array * String * is encoded and decoded to the same Array * Binary * is encoded and decoded to the same Array * with unsupported data payload content type * Integer * raises an UnsupportedDataType 40013 exception * Float * raises an UnsupportedDataType 40013 exception * Boolean * raises an UnsupportedDataType 40013 exception * False * raises an UnsupportedDataType 40013 exception * if connection fails before success * calls the Deferrable errback if channel is detached * :left event * emits the data defined in enter * emits the data defined in update * entering/updating/leaving presence state on behalf of another client_id * enter_client * 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 * enters a channel and sets the data based on the provided :data option * message connection_id * matches the current client connection_id * without necessary capabilities to enter on behalf of another client * calls the Deferrable errback on capabilities failure * it should behave like a public presence method * presence enter_client : raise an exception if the channel is detached * presence enter_client : raise an exception if the channel becomes detached * presence enter_client : raise an exception if the channel is failed * presence enter_client : raise an exception if the channel becomes failed * implicitly attaches the channel * returns a SafeDeferrable that catches exceptions in callbacks and logs them * allows a block to be passed in that is executed upon success * calls the Deferrable callback on success * catches exceptions in the provided method block and logs them to the logger * when :queue_messages client option is false * and connection state initialized * fails the deferrable * and connection state connecting * fails the deferrable * and connection state disconnected * fails the deferrable * and connection state connected * publishes the message * with supported data payload content type * JSON Object (Hash) * is encoded and decoded to the same hash * JSON Array * is encoded and decoded to the same Array * String * is encoded and decoded to the same Array * Binary * is encoded and decoded to the same Array * with unsupported data payload content type * Integer * raises an UnsupportedDataType 40013 exception * Float * raises an UnsupportedDataType 40013 exception * Boolean * raises an UnsupportedDataType 40013 exception * False * raises an UnsupportedDataType 40013 exception * if connection fails before success * calls the Deferrable errback if channel is detached * it should behave like a presence on behalf of another client method * :enter_client when authenticated with a wildcard client_id * and a valid client_id * succeeds * and a wildcard client_id * throws an exception * and an empty client_id * throws an exception * and a client_id that is not a string type * throws an exception * :enter_client when authenticated with a valid client_id * and another invalid client_id * before authentication * allows the operation and then Ably rejects the operation * after authentication * throws an exception * and a wildcard client_id * throws an exception * and an empty client_id * throws an exception * :enter_client when anonymous and no client_id * and another invalid client_id * before authentication * allows the operation and then Ably rejects the operation * after authentication * throws an exception * and a wildcard client_id * throws an exception * and an empty client_id * throws an exception * update_client * multiple times on the same channel with different client_ids * updates the data attribute for the member when :data option provided * updates the data attribute to null for the member when :data option is not provided (assumed null) * enters if not already entered * it should behave like a public presence method * presence update_client : raise an exception if the channel is detached * presence update_client : raise an exception if the channel becomes detached * presence update_client : raise an exception if the channel is failed * presence update_client : raise an exception if the channel becomes failed * implicitly attaches the channel * returns a SafeDeferrable that catches exceptions in callbacks and logs them * allows a block to be passed in that is executed upon success * calls the Deferrable callback on success * catches exceptions in the provided method block and logs them to the logger * when :queue_messages client option is false * and connection state initialized * fails the deferrable * and connection state connecting * fails the deferrable * and connection state disconnected * fails the deferrable * and connection state connected * publishes the message * with supported data payload content type * JSON Object (Hash) * is encoded and decoded to the same hash * JSON Array * is encoded and decoded to the same Array * String * is encoded and decoded to the same Array * Binary * is encoded and decoded to the same Array * with unsupported data payload content type * Integer * raises an UnsupportedDataType 40013 exception * Float * raises an UnsupportedDataType 40013 exception * Boolean * raises an UnsupportedDataType 40013 exception * False * raises an UnsupportedDataType 40013 exception * if connection fails before success * calls the Deferrable errback if channel is detached * it should behave like a presence on behalf of another client method * :update_client when authenticated with a wildcard client_id * and a valid client_id * succeeds * and a wildcard client_id * throws an exception * and an empty client_id * throws an exception * and a client_id that is not a string type * throws an exception * :update_client when authenticated with a valid client_id * and another invalid client_id * before authentication * allows the operation and then Ably rejects the operation * after authentication * throws an exception * and a wildcard client_id * throws an exception * and an empty client_id * throws an exception * :update_client when anonymous and no client_id * and another invalid client_id * before authentication * allows the operation and then Ably rejects the operation * after authentication * throws an exception * and a wildcard client_id * throws an exception * and an empty client_id * throws an exception * leave_client * leaves a channel * multiple times on the same channel with different client_ids * emits the :leave event for each client_id * succeeds if that client_id has not previously entered the channel * with a new value in :data option * emits the leave event with the new data value * with a nil value in :data option * emits the leave event with the previous value as a convenience * with no :data option * emits the leave event with the previous value as a convenience * it should behave like a public presence method * presence leave_client : raise an exception if the channel is detached * presence leave_client : raise an exception if the channel becomes detached * presence leave_client : raise an exception if the channel is failed * presence leave_client : raise an exception if the channel becomes failed * implicitly attaches the channel * returns a SafeDeferrable that catches exceptions in callbacks and logs them * allows a block to be passed in that is executed upon success * calls the Deferrable callback on success * catches exceptions in the provided method block and logs them to the logger * when :queue_messages client option is false * and connection state initialized * fails the deferrable * and connection state connecting * fails the deferrable * and connection state disconnected * fails the deferrable * and connection state connected * publishes the message * with supported data payload content type * JSON Object (Hash) * is encoded and decoded to the same hash * JSON Array * is encoded and decoded to the same Array * String * is encoded and decoded to the same Array * Binary * is encoded and decoded to the same Array * with unsupported data payload content type * Integer * raises an UnsupportedDataType 40013 exception * Float * raises an UnsupportedDataType 40013 exception * Boolean * raises an UnsupportedDataType 40013 exception * False * raises an UnsupportedDataType 40013 exception * if connection fails before success * calls the Deferrable errback if channel is detached * it should behave like a presence on behalf of another client method * :leave_client when authenticated with a wildcard client_id * and a valid client_id * succeeds * and a wildcard client_id * throws an exception * and an empty client_id * throws an exception * and a client_id that is not a string type * throws an exception * :leave_client when authenticated with a valid client_id * and another invalid client_id * before authentication * allows the operation and then Ably rejects the operation * after authentication * throws an exception * and a wildcard client_id * throws an exception * and an empty client_id * throws an exception * :leave_client when anonymous and no client_id * and another invalid client_id * before authentication * allows the operation and then Ably rejects the operation * after authentication * throws an exception * and a wildcard client_id * throws an exception * and an empty client_id * throws an exception * get * returns a SafeDeferrable that catches exceptions in callbacks and logs them * calls the Deferrable callback on success * catches exceptions in the provided method block * implicitly attaches the channel (#RTP11b) * fails if the connection is DETACHED (#RTP11b) * fails if the connection is FAILED (#RTP11b) * returns the current members on the channel (#RTP11a) * filters by connection_id option if provided (#RTP11c3) * filters by client_id option if provided (#RTP11c2) * does not wait for SYNC to complete if :wait_for_sync option is false (#RTP11c1) * returns the list of members and waits for SYNC to complete by default (#RTP11a) * when the channel is SUSPENDED * with wait_for_sync: true * results in an error with @code@ @91005@ and a @message@ stating that the presence state is out of sync (#RTP11d) * with wait_for_sync: false * returns the current PresenceMap and does not wait for the channel to change to the ATTACHED state (#RTP11d) * during a sync * when :wait_for_sync is true * fails if the connection becomes FAILED (#RTP11b) * fails if the channel becomes detached (#RTP11b) * when a member enters and then leaves * has no members * when a member enters and the presence map is updated * adds the member as being :present (#RTP2d) * with lots of members on different clients * returns a complete list of members on all clients * subscribe * implicitly attaches * with no arguments * calls the callback for all presence events * with event name * calls the callback for specified presence event * with a callback that raises an exception * logs the error and continues * unsubscribe * with no arguments * removes the callback for all presence events * with event name * removes the callback for specified presence event * REST get * returns current members * returns no members once left * client_id with ASCII_8BIT * in connection set up * is converted into UTF_8 * in channel options * is converted into UTF_8 * encoding and decoding of presence message data * encrypts presence message data * subscribe * emits decrypted enter events * emits decrypted update events * emits previously set data for leave events * get * returns a list of members with decrypted data * REST get * returns a list of members with decrypted data * when cipher settings do not match publisher * delivers an unencoded presence message left with encoding value * emits an error when cipher does not match and presence data cannot be decoded * leaving * expect :left event once underlying connection is closed * expect :left event with client data from enter event * connection failure mid-way through a large member sync * resumes the SYNC operation (#RTP3) * server-initiated sync * with multiple SYNC pages * is initiated with a SYNC message and completed with a later SYNC message with no cursor value part of the channelSerial (#RTP18a, #RTP18b) * with a single SYNC page * is initiated and completed with a single SYNC message (and no channelSerial) (#RTP18a, #RTP18c) * when members exist in the PresenceMap before a SYNC completes * removes the members that are no longer present (#RTP19) * when the client does not have presence subscribe privileges but is present on the channel * receives presence updates for all presence events generated by the current connection and the presence map is kept up to date (#RTP17a) * local PresenceMap for presence members entered by this client * maintains a copy of the member map for any member that shares this connection’s connection ID (#RTP17) * RTP17b * updates presence members on leave * does no update presence members on fabricated leave * when a channel becomes attached again * and the resume flag is false * and the presence flag is false * immediately resends all local presence members (#RTP5c2, #RTP19a) * when re-entering a client automatically, if the re-enter fails for any reason * should emit an ErrorInfo with error code 91004 (#RTP5c3) * channel state side effects (RTP5) * channel transitions to the ATTACHED state (RTP5b) * all queued presence messages are sent * channel transitions to the FAILED state * clears the PresenceMap and local member map copy and does not emit any presence events (#RTP5a) * channel transitions to the DETACHED state * clears the PresenceMap and local member map copy and does not emit any presence events (#RTP5a) * channel transitions to the SUSPENDED state * maintains the PresenceMap and only publishes presence event changes since the last attached state (#RTP5f)

Ably::Realtime::Push::Admin

(see {spec/acceptance/realtime/push_admin_spec.rb}[./spec/acceptance/realtime/push_admin_spec.rb]) * using JSON protocol * publish * returns a SafeDeferrable that catches exceptions in callbacks and logs them * accepts valid push data and recipient * invalid arguments * raises an exception with a nil recipient * raises an exception with a empty recipient * raises an exception with a nil recipient * raises an exception with a empty recipient * invalid recipient * raises an error after receiving a 40x realtime response * invalid push data * raises an error after receiving a 40x realtime response * recipient variable case * is converted to snakeCase * using test environment channel recipient (RSH1a) * triggers a push notification * device_registrations * without permissions * raises a permissions not authorized exception * list * returns a PaginatedResult object containing DeviceDetails objects * supports paging * raises an exception if params are invalid * get * returns a DeviceDetails object if a device ID string is provided * with a failed request * raises a ResourceMissing exception if device ID does not exist * save * saves the new DeviceDetails Hash object * with a failed request * fails if data is invalid * remove_where * removes all matching device registrations by client_id * remove * removes the provided device id string * channel_subscriptions * list * returns a PaginatedResult object containing DeviceDetails objects * supports paging * raises an exception if none of the required filters are provided * list_channels * returns a PaginatedResult object containing String objects * save * saves the new client_id PushChannelSubscription Hash object * raises an exception for invalid params * failed requests * fails for invalid requests * remove_where * removes matching client_ids * succeeds on no match * failed requests * device_id and client_id filters in the same request are not supported * remove * removes match for Hash object by channel and client_id * succeeds even if there is no match

Ably::Realtime::Client#stats

(see {spec/acceptance/realtime/stats_spec.rb}[./spec/acceptance/realtime/stats_spec.rb]) * using JSON protocol * fetching stats * returns a PaginatedResult * returns a SafeDeferrable that catches exceptions in callbacks and logs them * with options * passes the option arguments to the REST stat method

Ably::Realtime::Client#time

(see {spec/acceptance/realtime/time_spec.rb}[./spec/acceptance/realtime/time_spec.rb]) * using JSON protocol * fetching the service time * should return the service time as a Time object * returns a SafeDeferrable that catches exceptions in callbacks and logs them * with reconfigured HTTP timeout * should raise a timeout exception

Ably::Auth

(see {spec/acceptance/rest/auth_spec.rb}[./spec/acceptance/rest/auth_spec.rb]) * using JSON protocol * has immutable options * request_token * creates a TokenRequest automatically and sends it to Ably to obtain a token * returns a valid TokenDetails object in the expected format with valid issued and expires attributes * with token_param :client_id * overrides default and uses camelCase notation for attributes * with token_param :capability * overrides default and uses camelCase notation for attributes * with token_param :nonce * overrides default and uses camelCase notation for attributes * with token_param :timestamp * overrides default and uses camelCase notation for attributes * with token_param :ttl * overrides default and uses camelCase notation for attributes * with :key option * key_name is used in request and signing uses key_secret * with :key_name & :key_secret options * key_name is used in request and signing uses key_secret * with :query_time option * queries the server for the time (#RSA10k) * without :query_time option * does not query the server for the time * with :auth_url option merging * with existing configured auth options * using unspecified :auth_method * requests a token using a GET request with provided headers, and merges client_id into auth_params * with provided token_params * merges provided token_params with existing auth_params and client_id * with provided auth option auth_params and auth_headers * replaces any preconfigured auth_params * using :get :auth_method and query params in the URL * requests a token using a GET request with provided headers, and merges client_id into auth_params and existing URL querystring into new URL querystring * using :post :auth_method * requests a token using a POST request with provided headers, and merges client_id into auth_params as form-encoded post data * with :auth_url option * when response from :auth_url is a valid token request * requests a token from :auth_url using an HTTP GET request * returns a valid token generated from the token request * with :query_params * requests a token from :auth_url with the :query_params * with :headers * requests a token from :auth_url with the HTTP headers set * with POST * requests a token from :auth_url using an HTTP POST instead of the default GET * when response from :auth_url is a token details object * returns TokenDetails created from the token JSON * when response from :auth_url is text/plain content type and a token string * returns TokenDetails created from the token JSON * when response is invalid * 500 * raises ServerError * XML * raises InvalidResponseBody * with a Proc for the :auth_callback option * that returns a TokenRequest * calls the Proc with token_params when authenticating to obtain the request token * uses the token request returned from the callback when requesting a new token * when authorized * sets Auth#client_id to the new token’s client_id * sets Client#client_id to the new token’s client_id * that returns a TokenDetails JSON object * calls the lambda when authenticating to obtain the request token * uses the token request returned from the callback when requesting a new token * when authorized * sets Auth#client_id to the new token’s client_id * sets Client#client_id to the new token’s client_id * that returns a TokenDetails object * uses the token request returned from the callback when requesting a new token * that returns a Token string * uses the token request returned from the callback when requesting a new token * with auth_option :client_id * returns a token with the client_id * with token_param :client_id * returns a token with the client_id * before authorize has been called * has no current_token_details * authorize (RSA10, RSA10j) * updates the persisted token params that are then used for subsequent authorize requests * updates the persisted auth options that are then used for subsequent authorize requests * when called for the first time since the client has been instantiated * passes all auth_options and token_params to #request_token * returns a valid token * issues a new token every time (#RSA10a) * query_time: true with authorize * only queries the server time once and then works out the offset, query_time option is never persisted (#RSA10k) * query_time: true ClientOption when instanced * only queries the server time once and then works out the offset, query_time option is never persisted (#RSA10k) * TokenParams argument * has no effect on the defaults when null and TokenParam defaults remain the same * updates defaults when present and all previous configured TokenParams are discarded (#RSA10g) * updates Auth#token_params attribute with an immutable hash * uses TokenParams#timestamp for this request but obtains a new timestamp for subsequence requests (#RSA10g) * AuthOptions argument * has no effect on the defaults when null and AuthOptions defaults remain the same * updates defaults when present and all previous configured AuthOptions are discarded (#RSA10g) * updates Auth#options attribute with an immutable hash * uses AuthOptions#query_time for this request and will not query_time for subsequent requests (#RSA10g) * uses AuthOptions#query_time for this request and will query_time again if provided subsequently * with previous authorisation * requests a new token if token is expired * issues a new token every time #authorize is called * with a lambda for the :auth_callback option * calls the lambda * uses the token request returned from the callback when requesting a new token * for every subsequent request_token * without a :auth_callback lambda * calls the originally provided block * with a provided block * does not call the originally provided lambda and calls the new #request_token :auth_callback lambda * with an explicit token string that expires * and a lambda for the :auth_callback option to provide a means to renew the token * calls the lambda once the token has expired and the new token is used * with an explicit ClientOptions client_id * and an incompatible client_id in a TokenDetails object passed to the auth callback * rejects a TokenDetails object with an incompatible client_id and raises an exception * and an incompatible client_id in a TokenRequest object passed to the auth callback and raises an exception * rejects a TokenRequests object with an incompatible client_id and raises an exception * and a token string without any retrievable client_id * rejects a TokenRequests object with an incompatible client_id and raises an exception * create_token_request * returns a TokenRequest object * returns a TokenRequest that can be passed to a client that can use it for authentication without an API key * uses the key name from the client * specifies no TTL (#RSA5) * specifies no capability (#RSA6) * with a :ttl option below the Token expiry buffer that ensures tokens are renewed 15s before they expire as they are considered expired * uses the Token expiry buffer default + 10s to allow for a token request in flight * the nonce * is unique for every request * is at least 16 characters * with token param :ttl * overrides default * with token param :nonce * overrides default * with token param :client_id * overrides default * when specifying capability * overrides the default * uses these capabilities when Ably issues an actual token * with additional invalid attributes * are ignored * when required fields are missing * should raise an exception if key secret is missing * should raise an exception if key name is missing * timestamp attribute * is a Time object in Ruby and is set to the local time * with :query_time auth_option * queries the server for the timestamp * with :timestamp option * uses the provided timestamp in the token request * signing * generates a valid HMAC * lexicographic ordering of channels and operations * HMAC is lexicographic ordered and thus the HMAC is identical * is valid when used for authentication * using token authentication * with :token option * authenticates successfully using the provided :token * disallows publishing on unspecified capability channels * fails if timestamp is invalid * cannot be renewed automatically * and the token expires * should indicate an error and not retry the request (#RSA4a) * when token expires * automatically renews the token (#RSA4b) * fails if the token renewal fails (#RSA4b) * when token does not expire * for the next 2 hours * should not request for the new token (#RSA4b1) * when :client_id is provided in a token * #client_id contains the client_id * client_id_validated? * when using basic auth * is false as basic auth users do not have an identity * when using a token auth string for a token with a client_id * is false as identification is not possible from an opaque token string * when using a token * with a client_id * is true * with no client_id (anonymous) * is true * with a wildcard client_id (anonymous) * is false * when using a token request with a client_id * is not true as identification is not confirmed until authenticated * after authentication * is true as identification is completed during implicit authentication * when using a :key and basic auth * #using_token_auth? is false * #key attribute contains the key string * #using_basic_auth? is true * deprecated authorise * logs a deprecation warning (#RSA10l) * returns a valid token (#RSA10l) * when using JWT * authenticates correctly using the JWT token generated by the echo server * when the JWT embeds an Ably token * authenticates correctly using the embedded token * and the requested token is encrypted * authenticates correctly using the embedded token * when the token requested is returned with application/jwt content type * authenticates correctly and pulls stats

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 * uses MsgPack * when option {:protocol=>:json} is used * uses JSON * when option {:use_binary_protocol=>false} is used * uses JSON * when option {:protocol=>:msgpack} is used * uses MsgPack * when option {:use_binary_protocol=>true} is used * uses MsgPack * using JSON protocol * failed requests * due to invalid Auth * should raise an InvalidRequest exception with a valid error message and code * server error with JSON error response body * should raise a ServerError exception * 500 server error without a valid JSON response body * should raise a ServerError exception * token authentication failures * when auth#token_renewable? * should automatically reissue a token * when NOT auth#token_renewable? * should raise an TokenExpired exception

Ably::Rest::Channel

(see {spec/acceptance/rest/channel_spec.rb}[./spec/acceptance/rest/channel_spec.rb]) * using JSON protocol * publish * with name and data arguments * publishes the message and return true indicating success * and additional attributes * publishes the message with the attributes and return true indicating success * with a client_id configured in the ClientOptions * publishes the message without a client_id * expects a client_id to be added by the realtime service * with an array of Hash objects with :name and :data attributes * publishes an array of messages in one HTTP request * with an array of Message objects * when max_message_size and max_frame_size is not set * and messages size (130 bytes) is smaller than the max_message_size * publishes an array of messages in one HTTP request * and messages size (177784 bytes) is bigger than the max_message_size * should not publish and raise Ably::Exceptions::MaxMessageSizeExceeded * when max_message_size is 655 bytes * and messages size (130 bytes) is smaller than the max_message_size * publishes an array of messages in one HTTP request * and messages size (177784 bytes) is bigger than the max_message_size * should not publish and raise Ably::Exceptions::MaxMessageSizeExceeded * with a Message object * publishes the message * with a Message object and query params * should fail to publish the message (RSL1l1) * with Messages and query params * should fail to publish the message (RSL1l1) * without adequate permissions on the channel * raises a permission error when publishing * null attributes * when name is null * publishes the message without a name attribute in the payload * when data is null * publishes the message without a data attribute in the payload * with neither name or data attributes * publishes the message without any attributes in the payload * identified clients * when authenticated with a wildcard client_id * with a valid client_id in the message * succeeds * with a wildcard client_id in the message * throws an exception * with an empty client_id in the message * succeeds and publishes without a client_id * when authenticated with a Token string with an implicit client_id * without having a confirmed identity * with a valid client_id in the message * succeeds * with an invalid client_id in the message * succeeds in the client library but then fails when published to Ably * with an empty client_id in the message * succeeds and publishes with an implicit client_id * when authenticated with TokenDetails with a valid client_id * with a valid client_id in the message * succeeds * with a wildcard client_id in the message * throws an exception * with an invalid client_id in the message * throws an exception * with an empty client_id in the message * succeeds and publishes with an implicit client_id * when anonymous and no client_id * with a client_id in the message * throws an exception * with a wildcard client_id in the message * throws an exception * with an empty client_id in the message * succeeds and publishes with an implicit client_id * with a non ASCII channel name * stubbed * correctly encodes the channel name * with a frozen message event name * succeeds and publishes with an implicit client_id * with a frozen payload * succeeds and publishes with an implicit client_id * message size is exceeded (TO3l8) * should raise Ably::Exceptions::MaxMessageSizeExceeded exception * history * returns a PaginatedResult model * returns the current message history for the channel * returns paged history using the PaginatedResult model * message timestamps * are after the messages were published * message IDs * is unique * direction * returns paged history backwards by default * returns history forward if specified in the options * limit * defaults to 100 * history option * :start * with milliseconds since epoch value * uses this value in the history request * with a Time object value * converts the value to milliseconds since epoch in the hisotry request * :end * with milliseconds since epoch value * uses this value in the history request * with a Time object value * converts the value to milliseconds since epoch in the hisotry request * when argument start is after end * should raise an exception * presence * returns a REST Presence object * status * should return channel details status (#RSL8, #RSL8a)

Ably::Rest::Channels

(see {spec/acceptance/rest/channels_spec.rb}[./spec/acceptance/rest/channels_spec.rb]) * using JSON protocol * using shortcut method channel on the client object * behaves like a channel * returns a channel object * returns channel object and passes the provided options * using get method on client#channels * behaves like a channel * returns a channel object * returns channel object and passes the provided options * set_options (RTL16) * updates channel’s options * when providing Ably::Models::ChannelOptions object * updates channel’s options * accessing an existing channel object with different options * overrides the existing channel options and returns the channel object (RSN3c) * accessing an existing channel object without specifying any channel options * returns the existing channel without modifying the channel options * using undocumented array accessor [] method on client#channels * behaves like a channel * returns a channel object * returns channel object and passes the provided options * using a frozen channel name * behaves like a channel * returns a channel object * returns channel object and passes the provided options

Ably::Rest::Client

(see {spec/acceptance/rest/client_spec.rb}[./spec/acceptance/rest/client_spec.rb]) * using JSON protocol * initialize * with only an API key * uses basic authentication * with an invalid API key * logs an entry with a help href url matching the code #TI5 * with an explicit string :token * uses token authentication * with :use_token_auth set to true * uses token authentication * with a non string :client_id * raises an ArgumentError * with an invalid wildcard “” :client_id raises an exception * with an :auth_callback lambda * calls the auth lambda to get a new token * uses token authentication * with :default_token_params * overides the default token params (#TO3j11) * with an :auth_callback lambda (clientId provided in library options instead of as a token_request param) * correctly sets the clientId on the token * with an auth URL * uses token authentication * before any REST request * sends an HTTP request to the provided auth URL to get a new token * auth headers * with basic auth * sends the API key in authentication part of the secure URL (the Authorization: Basic header is not used with the Faraday HTTP library by default) * with token auth * without specifying protocol * sends the token string over HTTPS in the Authorization Bearer header with Base64 encoding * when setting constructor ClientOption :tls to false * sends the token string over HTTP in the Authorization Bearer header with Base64 encoding * using tokens * when expired * creates a new token automatically when the old token expires * with a different client_id in the subsequent token * fails to authenticate and raises an exception * when token has not expired * reuses the existing token for every request * connection transport * defaults * for default host * is configured to timeout connection opening in 4 seconds * is configured to timeout connection requests in 10 seconds * for the fallback hosts * is configured to timeout connection opening in 4 seconds * is configured to timeout connection requests in 10 seconds * with custom http_open_timeout and http_request_timeout options * for default host * is configured to use custom open timeout * is configured to use custom request timeout * for the fallback hosts * is configured to timeout connection opening in 4 seconds * is configured to timeout connection requests in 10 seconds * fallback hosts * configured * should make connection attempts to a.ably-realtime.com, b.ably-realtime.com, c.ably-realtime.com, d.ably-realtime.com, e.ably-realtime.com (#RSC15a) * when environment is NOT production (RSC15b) * and custom fallback hosts are empty * does not retry failed requests with fallback hosts when there is a connection error * and no custom fallback hosts are provided * should make connection attempts to sandbox-a-fallback.ably-realtime.com, sandbox-b-fallback.ably-realtime.com, sandbox-c-fallback.ably-realtime.com, sandbox-d-fallback.ably-realtime.com, sandbox-e-fallback.ably-realtime.com (#RSC15a) * when environment is production * and connection times out * tries fallback hosts 3 times (#RSC15b, #RSC15b) * and the total request time exeeds 15 seconds * makes no further attempts to any fallback hosts * and connection fails * tries fallback hosts 3 times * and first request to primary endpoint fails * tries a fallback host, and for the next request tries the primary endpoint again (#RSC15e) * and basic authentication fails * does not attempt the fallback hosts as this is an authentication failure * and server returns a 50x error * attempts the fallback hosts as this is an authentication failure (#RSC15d) * when environment is production and server returns a 50x error * with custom fallback hosts provided * attempts the fallback hosts as this is an authentication failure (#RSC15b, #RSC15a, #TO3k6) * with an empty array of fallback hosts provided (RSC15b, RSC15a, TO3k6) * does not attempt the fallback hosts as this is an authentication failure * using a local web-server * and timing out the primary host * POST with request timeout less than max_retry_duration * tries the primary host, then both fallback hosts (#RSC15d) * GET with request timeout less than max_retry_duration * tries the primary host, then both fallback hosts (#RSC15d) * POST with request timeout more than max_retry_duration * does not try any fallback hosts (#RSC15d) * GET with request timeout more than max_retry_duration * does not try any fallback hosts (#RSC15d) * and failing the primary host * tries one of the fallback hosts * to fail the primary host, allow a fallback to succeed, then later trigger a fallback to the primary host (RSC15f) * succeeds and remembers fallback host preferences across requests * with custom :fallback_retry_timeout * stops using the preferred fallback after this time * when environment is not production and server returns a 50x error * with no fallback hosts provided (TBC, see github.com/ably/wiki/issues/361) * uses the default fallback hosts for that environment as this is not an authentication failure * with custom fallback hosts provided (RSC15b, TO3k6) * attempts the fallback hosts as this is not an authentication failure * with an empty array of fallback hosts provided (RSC15b, TO3k6) * does not attempt the fallback hosts as this is an authentication failure * with fallback_hosts_use_default: true (RSC15b, TO3k7) * attempts the default fallback hosts as this is an authentication failure * with a custom host * that does not exist * fails immediately and raises a Faraday Error * fallback hosts * are never used * that times out * fails immediately and raises a Faraday Error * fallback hosts * are never used * HTTP configuration options * is frozen * defaults * #http_open_timeout is 4s * #http_request_timeout is 10s * #http_max_retry_count is 3 * #http_max_retry_duration is 15s * configured * #http_open_timeout uses provided value * #http_request_timeout uses provided value * #http_max_retry_count uses provided value * #http_max_retry_duration uses provided value * auth * is provides access to the Auth object * configures the Auth object with all ClientOptions passed to client in the initializer * version headers * with default agent * sends a protocol version and lib version header (#G4, #RSC7a, #RSC7b) * with custom ably-ruby/1.1.1 ruby/3.1.1 agent * sends a protocol version and lib version header (#G4, #RSC7a, #RSC7b) * request (RSC19, #TO3l9) get * returns an HttpPaginatedResponse object * 404 request to invalid URL * returns an object with 404 status code and error message * paged results * provides paging * post * supports post * raises an exception once body size in bytes exceeded * delete * supports delete * patch * supports patch * raises an exception once body size in bytes exceeded * put * supports put * raises an exception once body size in bytes exceeded * request_id generation (RSC7c) * Timeout error * with option add_request_ids: true and no fallback hosts * has an error with the same request_id of the request * with option add_request_ids: true and REST operations with a message body * with mocks to inspect the params * with a single publish * succeeds and sends the request_id as a param * with an array publish * succeeds and sends the request_id as a param * without mocks to ensure the requests are accepted * with a single publish * succeeds and sends the request_id as a param * with an array publish * succeeds and sends the request_id as a param * option add_request_ids: true and specified fallback hosts * request_id is the same across retries * without request_id and no fallback hosts * does not include request_id in ConnectionTimeout error * UnauthorizedRequest nonce error * includes request_id in UnauthorizedRequest error due to replayed nonce * failed request logging * is absent when requests do not fail * with the first request failing * is present with success message when requests do not actually fail * with all requests failing * is present when all requests fail

Ably::Models::MessageEncoders

(see {spec/acceptance/rest/encoders_spec.rb}[./spec/acceptance/rest/encoders_spec.rb]) * with binary transport protocol * without encryption * with UTF-8 data * does not apply any encoding * with binary data * does not apply any encoding * with JSON data * stringifies the JSON and sets the encoding attribute to “json” * with encryption * with UTF-8 data * applies utf-8 and cipher encoding and sets the encoding attribute to “utf-8/cipher+aes-128-cbc” * with binary data * applies cipher encoding and sets the encoding attribute to “cipher+aes-128-cbc” * with JSON data * applies json, utf-8 and cipher encoding and sets the encoding attribute to “json/utf-8/cipher+aes-128-cbc” * with text transport protocol * without encryption * with UTF-8 data * does not apply any encoding * with binary data * applies a base64 encoding and sets the encoding attribute to “base64” * with JSON data * stringifies the JSON and sets the encoding attribute to “json” * with encryption * with UTF-8 data * applies utf-8, cipher and base64 encodings and sets the encoding attribute to “utf-8/cipher+aes-128-cbc/base64” * with binary data * applies cipher and base64 encoding and sets the encoding attribute to “cipher+aes-128-cbc/base64” * with JSON data * applies json, utf-8, cipher and base64 encoding and sets the encoding attribute to “json/utf-8/cipher+aes-128-cbc/base64”

Ably::Rest::Channel messages

(see {spec/acceptance/rest/message_spec.rb}[./spec/acceptance/rest/message_spec.rb]) * using JSON protocol * publishing with an ASCII_8BIT message name * is converted into UTF_8 * a single Message object (RSL1a) * publishes the message * an array of Message objects (RSL1a) * publishes three messages * an array of hashes (RSL1a) * publishes three messages * a name with data payload (RSL1a, RSL1b) * publishes the message * with supported data payload content type * JSON Object (Hash) * is encoded and decoded to the same hash * JSON Array * is encoded and decoded to the same Array * String * is encoded and decoded to the same Array * Binary * is encoded and decoded to the same Array * with supported extra payload content type (RSL1h, RSL6a2) * JSON Object (Hash) * is encoded and decoded to the same hash * JSON Array * is encoded and decoded to the same deep multi-type object * nil * is encoded and decoded to the same Array * idempotency (RSL1k) * idempotent publishing is set as per clientOptions * idempotent publishing is enabled by default (#TO3n) * when ID is not included (RSL1k2) * with Message object * publishes the same message three times * with publish arguments only * publishes the same message three times * when ID is included (RSL1k2, RSL1k5) * the ID provided is used for the published messages * for multiple messages in one publish operation (#RSL1k3) * for multiple messages in one publish operation with IDs following the required format described in RSL1k1 (#RSL1k3) * with Message object * three REST publishes result in only one message being published * with publish arguments only * three REST publishes result in only one message being published * when idempotent publishing is enabled in the client library ClientOptions (TO3n) * the ID is populated with a random ID and serial 0 from this lib (#RSL1k1) * when there is a network failure triggering an automatic retry (RSL1k4) * for multiple messages in one publish operation * with Message object * two REST publish retries result in only one message being published * with publish arguments only * two REST publish retries result in only one message being published * with explicitly provided message ID * two REST publish retries result in only one message being published * when publishing a batch of messages * the ID is populated with a single random ID and sequence of serials from this lib (#RSL1k1) * with unsupported data payload content type * Integer * is raises an UnsupportedDataType 40013 exception * Float * is raises an UnsupportedDataType 40013 exception * Boolean * is raises an UnsupportedDataType 40013 exception * False * is raises an UnsupportedDataType 40013 exception * encryption and encoding * with publish and history * with AES-128-CBC using crypto-data-128.json fixtures (RTL7d) * item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 1 with encrypted encoding cipher+aes-128-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 2 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 3 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * with AES-256-CBC using crypto-data-256.json fixtures (RTL7d) * item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 1 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 2 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 3 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 4 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 5 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 6 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 7 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 8 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 9 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 10 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 11 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 12 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 13 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 14 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 15 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 16 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 17 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 18 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 19 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 20 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 21 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 22 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 23 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 24 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 25 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 26 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 27 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 28 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 29 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 30 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 31 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 32 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 33 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 34 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 35 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 36 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 37 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 38 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 39 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 40 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 41 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 42 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 43 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 44 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 45 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 46 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 47 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 48 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 49 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 50 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 51 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 52 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 53 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 54 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 55 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 56 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 57 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 58 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 59 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 60 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 61 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 62 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 63 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 64 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 65 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 66 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 67 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 68 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 69 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 70 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 71 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 72 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * item 73 with encrypted encoding cipher+aes-256-cbc/base64 * behaves like an Ably encrypter and decrypter * encrypts message automatically when published (#RTL7d) * sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d) * when publishing lots of messages * encrypts on #publish and decrypts on #history * when retrieving history with a different protocol * delivers a String ASCII-8BIT payload to the receiver * delivers a String UTF-8 payload to the receiver * delivers a Hash payload to the receiver * when publishing on an unencrypted channel and retrieving with history on an encrypted channel * does not attempt to decrypt the message * when publishing on an encrypted channel and retrieving with history on an unencrypted channel * retrieves the message that remains encrypted with an encrypted encoding attribute (#RTL7e) * logs a Cipher exception (#RTL7e) * publishing on an encrypted channel and retrieving history with a different algorithm on another client (RTL7e) * retrieves the message that remains encrypted with an encrypted encoding attribute (#RTL7e) * logs a Cipher exception (#RTL7e) * publishing on an encrypted channel and subscribing with a different key on another client * retrieves the message that remains encrypted with an encrypted encoding attribute * logs a Cipher exception

Ably::Rest::Presence

(see {spec/acceptance/rest/presence_spec.rb}[./spec/acceptance/rest/presence_spec.rb]) * using JSON protocol * tested against presence fixture data set up in test app * get * returns current members on the channel with their action set to :present * with :limit option * returns a paged response limiting number of members per page * default :limit * defaults to a limit of 100 * with :client_id option * FAILED: <s>returns a list members filtered by the provided client ID</s> * with :connection_id option * returns a list members filtered by the provided connection ID * returns a list members filtered by the provided connection ID * with a non ASCII channel name * stubbed * correctly encodes the channel name * history * returns recent presence activity * default behaviour * uses backwards direction * with options * direction: :forwards * returns recent presence activity forwards with most recent history last * direction: :backwards * returns recent presence activity backwards with most recent history first * history * with options * limit options * default * is set to 100 * set to 1000 * is passes the limit query param value 1000 * with time range options * :start * with milliseconds since epoch value * uses this value in the history request * with Time object value * converts the value to milliseconds since epoch in the hisotry request * :end * with milliseconds since epoch value * uses this value in the history request * with Time object value * converts the value to milliseconds since epoch in the hisotry request * when argument start is after end * should raise an exception * decoding * with encoded fixture data * history * decodes encoded and encryped presence fixture data automatically * get * decodes encoded and encryped presence fixture data automatically * decoding permutations using mocked history * valid decodeable content * get * automaticaly decodes presence messages * history * automaticaly decodes presence messages * invalid data * get * returns the messages still encoded * logs a cipher error * history * returns the messages still encoded * logs a cipher error

Ably::Rest::Push::Admin

(see {spec/acceptance/rest/push_admin_spec.rb}[./spec/acceptance/rest/push_admin_spec.rb]) * using JSON protocol * publish * accepts valid push data and recipient (#RSH1a) * without publish permissions * raises a permissions issue exception * invalid arguments (RHS1a) * raises an exception with a nil recipient * raises an exception with a empty recipient * raises an exception with a nil recipient * raises an exception with a empty recipient * invalid recipient (RSH1a) * raises an error after receiving a 40x realtime response * invalid push data (RSH1a) * raises an error after receiving a 40x realtime response * recipient variable case * is converted to snakeCase * using test environment channel recipient (RSH1a) * triggers a push notification * device_registrations (RSH1b) * without permissions * raises a permissions not authorized exception * list (RSH1b2) * returns a PaginatedResult object containing DeviceDetails objects * returns an empty PaginatedResult if not params match * supports paging * provides filtering * get (RSH1b1) * returns a DeviceDetails object if a device ID string is provided * returns a DeviceDetails object if a DeviceDetails object is provided * raises a ResourceMissing exception if device ID does not exist * save (RSH1b3) * saves the new DeviceDetails Hash object * saves the associated DevicePushDetails * does not allow some fields to be configured * allows device_secret to be configured * saves the new DeviceDetails object * allows arbitrary number of subsequent saves * fails if data is invalid * with FCM target * saves the associated DevicePushDetails * with web target * saves the associated DevicePushDetails * remove_where (RSH1b5) * removes all matching device registrations by client_id * removes device by device_id * succeeds even if there is no match * remove (RSH1b4) * removes the provided device id string * removes the provided DeviceDetails * succeeds if the item does not exist * channel_subscriptions (RSH1c) * list (RSH1c1) * returns a PaginatedResult object containing DeviceDetails objects * returns an empty PaginatedResult if params do not match * supports paging * provides filtering * raises an exception if none of the required filters are provided * list_channels (RSH1c2) * returns a PaginatedResult object containing String objects * supports paging * returns an accurate number of channels after devices are deleted * save (RSH1c3) * saves the new client_id PushChannelSubscription Hash object * saves the new device_id PushChannelSubscription Hash object * saves the client_id PushChannelSubscription object * saves the device_id PushChannelSubscription object * allows arbitrary number of subsequent saves * fails if data is invalid * remove_where (RSH1c5) * PENDING: {removes matching channels}[./spec/acceptance/rest/push_admin_spec.rb#L856] * removes matching client_ids * removes matching device_ids * device_id and client_id filters in the same request are not suppoorted * succeeds on no match * remove (RSH1c4) * removes match for Hash object by channel and client_id * removes match for PushChannelSubscription object by channel and client_id * removes match for Hash object by channel and device_id * removes match for PushChannelSubscription object by channel and client_id * succeeds even if there is no match

Ably::Rest::Client#stats

(see {spec/acceptance/rest/stats_spec.rb}[./spec/acceptance/rest/stats_spec.rb]) * using JSON protocol * fetching application stats * returns a PaginatedResult object * by minute * with no options * uses the minute interval by default * with :from set to last interval and :limit set to 1 * retrieves only one stat * returns zero value for any missing metrics * returns all aggregated message data * returns inbound realtime all data * returns inbound realtime message data * returns outbound realtime all data * returns persisted presence all data * returns connections all data * returns channels all data * returns api_requests data * returns token_requests data * returns stat objects with #interval_granularity equal to :minute * returns stat objects with #interval_id matching :start * returns stat objects with #interval_time matching :start Time * 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 * returns 3 pages of stats * 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 * returns 3 pages of stats * with :end set to last interval and :limit set to 3 to ensure only last years stats are included * the REST API * defaults to direction :backwards * with :end set to previous year interval * the REST API * defaults to 100 items for pagination * by hour * should aggregate the stats for that period * by day * should aggregate the stats for that period * by month * should aggregate the stats for that period * when argument start is after end * should raise an exception

Ably::Rest::Client#time

(see {spec/acceptance/rest/time_spec.rb}[./spec/acceptance/rest/time_spec.rb]) * using JSON protocol * fetching the service time * should return the service time as a Time object * with reconfigured HTTP timeout * should raise a timeout exception

Ably::Models::ChannelOptions

(see {spec/lib/unit/models/channel_options_spec.rb}[./spec/lib/unit/models/channel_options_spec.rb]) * modes_to_flags * converts modes to ProtocolMessage#flags correctly * set_modes_from_flags * converts flags to ChannelOptions#modes correctly * set_params * should be able to overwrite attributes * should be able to make params empty

Ably::Auth

(see {spec/unit/auth_spec.rb}[./spec/unit/auth_spec.rb]) * client_id option * with nil value * is permitted * as UTF_8 string * is permitted * remains as UTF-8 * as SHIFT_JIS string * gets converted to UTF-8 * is compatible with original encoding * as ASCII_8BIT string * gets converted to UTF-8 * is compatible with original encoding * as Integer * raises an argument error * defaults * should have no default TTL * should have no default capability

Ably::Logger

(see {spec/unit/logger_spec.rb}[./spec/unit/logger_spec.rb]) * uses the language provided Logger by default * with a custom Logger * with an invalid interface * raises an exception * with a valid interface * is used * with blocks * does not call the block unless the log level is met * with an exception in the logger block * catches the error and continues

Ably::Models::AuthDetails

(see {spec/unit/models/auth_details_spec.rb}[./spec/unit/models/auth_details_spec.rb]) * behaves like a model * attributes * access_token * retrieves attribute :access_token * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs * is immutable * prevents changes * dups options * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs

Ably::Models::ChannelDetails

(see {spec/unit/models/channel_details_spec.rb}[./spec/unit/models/channel_details_spec.rb]) * channel_id * should return channel id * name * should return name * status * should return status

Ably::Models::ChannelMetrics

(see {spec/unit/models/channel_metrics_spec.rb}[./spec/unit/models/channel_metrics_spec.rb]) * connections * should return integer * presence_connections * should return integer * presence_members * should return integer * presence_subscribers * should return integer * publishers * should return integer * subscribers * should return integer

Ably::Models::ChannelOccupancy

(see {spec/unit/models/channel_occupancy_spec.rb}[./spec/unit/models/channel_occupancy_spec.rb]) * metrics * should return attributes

Ably::Models::ChannelStateChange

(see {spec/unit/models/channel_state_change_spec.rb}[./spec/unit/models/channel_state_change_spec.rb]) * current (TH1) * is required * is an attribute * previous (TH2) * is required * is an attribute * event (TH5) * is not required * is an attribute * reason (TH3) * is not required * is an attribute * resumed (TH4) * is false when ommitted * is true when provided * invalid attributes * raises an argument error

Ably::Models::ChannelStatus

(see {spec/unit/models/channel_status_spec.rb}[./spec/unit/models/channel_status_spec.rb]) * is_active * when occupancy is active * should return true * when occupancy is not active * should return false * occupancy * should return occupancy object

Ably::Models::CipherParams

(see {spec/unit/models/cipher_params_spec.rb}[./spec/unit/models/cipher_params_spec.rb]) * :key missing from constructor * raises an exception * key * with :key in constructor * as nil * raises an exception * as a base64 encoded string * is a binary representation of the base64 encoded string * as a URL safe base64 encoded string * is a binary representation of the URL safe base64 encoded string * as a binary encoded string * contains the binary string * with an incompatible :key_length constructor param * raises an exception * with an unsupported :key_length for aes-cbc encryption * raises an exception * with an invalid type * raises an exception * with specified params in the constructor * cipher_type * contains the complete algorithm string as an upper case string * mode * contains the mode * algorithm * contains the algorithm * key_length * contains the key_length * with combined param in the constructor * cipher_type * contains the complete algorithm string as an upper case string * mode * contains the mode * algorithm * contains the algorithm * key_length * contains the key_length

Ably::Models::ConnectionDetails

(see {spec/unit/models/connection_details_spec.rb}[./spec/unit/models/connection_details_spec.rb]) * behaves like a model * attributes * client_id * retrieves attribute :client_id * connection_key * retrieves attribute :connection_key * max_message_size * retrieves attribute :max_message_size * max_frame_size * retrieves attribute :max_frame_size * max_inbound_rate * retrieves attribute :max_inbound_rate * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs * is immutable * prevents changes * dups options * attributes * connection_state_ttl (CD2f) * retrieves attribute :connection_state_ttl and converts it from ms to s * max_idle_interval (CD2h) * retrieves attribute :max_idle_interval and converts it from ms to s * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs

Ably::Models::ConnectionStateChange

(see {spec/unit/models/connection_state_change_spec.rb}[./spec/unit/models/connection_state_change_spec.rb]) * current (TA2) * is required * is an attribute * previous(TA2) * is required * is an attribute * event(TA5) * is not required * is an attribute * retry_in (TA2) * is not required * is an attribute * reason (TA3) * is not required * is an attribute * invalid attributes * raises an argument error

Ably::Models::DeltaExtras

(see {spec/unit/models/delta_extras_spec.rb}[./spec/unit/models/delta_extras_spec.rb]) * {should have from attribute}[./spec/unit/models/delta_extras_spec.rb#L7] * {should have format attribute}[./spec/unit/models/delta_extras_spec.rb#L11]

Ably::Models::DeviceDetails

(see {spec/unit/models/device_details_spec.rb}[./spec/unit/models/device_details_spec.rb]) * id and id= * setter accepts a string value and getter returns the new value * setter accepts nil * rejects non string or nil values * platform and platform= * setter accepts a string value and getter returns the new value * setter accepts nil * rejects non string or nil values * form_factor and form_factor= * setter accepts a string value and getter returns the new value * setter accepts nil * rejects non string or nil values * client_id and client_id= * setter accepts a string value and getter returns the new value * setter accepts nil * rejects non string or nil values * device_secret and device_secret= * setter accepts a string value and getter returns the new value * setter accepts nil * rejects non string or nil values * camelCase constructor attributes * are rubyfied and exposed as underscore case * are generated when the object is serialised to JSON * metadata and metadata= * setter accepts a Hash value and getter returns the new value * setter accepts nil but always returns an empty hash * rejects non Hash or nil values * push and push= * setter accepts a DevicePushDetails object and getter returns a DevicePushDetails object * setter accepts a Hash value and getter returns a DevicePushDetails object * setter accepts nil but always returns a DevicePushDetails object * rejects non Hash, DevicePushDetails or nil values

Ably::Models::DevicePushDetails

(see {spec/unit/models/device_push_details_spec.rb}[./spec/unit/models/device_push_details_spec.rb]) * state and state= * setter accepts a string value and getter returns the new value * setter accepts nil * rejects non string or nil values * camelCase constructor attributes * are rubyfied and exposed as underscore case * are generated when the object is serialised to JSON * recipient and recipient= * setter accepts a Hash value and getter returns the new value * setter accepts nil but always returns an empty hash * rejects non Hash or nil values * error_reason and error_reason= * setter accepts a ErrorInfo object and getter returns a ErrorInfo object * setter accepts a Hash value and getter returns a ErrorInfo object * setter accepts nil values * rejects non Hash, ErrorInfo or nil values

Ably::Models::ErrorInfo

(see {spec/unit/models/error_info_spec.rb}[./spec/unit/models/error_info_spec.rb]) * TI1, TI4 * behaves like a model * attributes * code * retrieves attribute :code * status_code * retrieves attribute :status_code * href * retrieves attribute :href * message * retrieves attribute :message * request_id * retrieves attribute :request_id * cause * retrieves attribute :cause * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs * is immutable * prevents changes * dups options * status TI1, TI2 * is an alias for #status_code * request_id RSC7c * should return request ID * cause TI1 * should return cause attribute * log entries container help link TI5 * without an error code * does not include the help URL * with a specified error code * includes https://help.ably.io/error/[CODE] in the stringified object * with an error code and an href attribute * includes the specified href in the stringified object * with an error code and a message with the same error URL * includes the specified error URL only once in the stringified object * with an error code and a message with a different error URL * includes the specified error URL from the message and the error code URL in the stringified object

Ably::Models::HttpPaginatedResponse: HP1 -> HP8

(see {spec/unit/models/http_paginated_result_spec.rb}[./spec/unit/models/http_paginated_result_spec.rb]) * items * returns correct length from body * is Enumerable * is iterable * provides [] accessor method * #first gets the first item in page * #last gets the last item in page * each * returns an enumerator * yields each item * with non paged http response * is the last page * does not have next page * does not support pagination * returns nil when accessing next page * returns nil when accessing first page * with paged http response * has next page * is not the last page * supports pagination * accessing next page * returns another HttpPaginatedResponse * retrieves the next page of results * does not have a next page * is the last page * returns nil when trying to access the last page when it is the last page * and then first page * returns a HttpPaginatedResponse * retrieves the first page of results * response metadata * successful response * #success? is true * #status_code reflects status code * #error_code to be empty * #error_message to be empty * #headers to be a hash * failed response * #success? is false * #status_code reflects status code * #error_code to be populated * #error_message to be populated * #headers to be present * items Array conversion and nil handling HP3 * with Json Array * is an array * with Json Object * is an array * with empty response * is an array * with nil response * is an array

Ably::Models::MessageEncoders::Base64

(see {spec/unit/models/message_encoders/base64_spec.rb}[./spec/unit/models/message_encoders/base64_spec.rb]) * decode * message with base64 payload * decodes base64 * strips the encoding * message with base64 payload before other payloads * decodes base64 * strips the encoding * message with another payload * leaves the message data intact * leaves the encoding intact * encode * over binary transport * message with binary payload * leaves the message data intact as Base64 encoding is not necessary * leaves the encoding intact * already encoded message with binary payload * leaves the message data intact as Base64 encoding is not necessary * leaves the encoding intact * message with UTF-8 payload * leaves the data intact * leaves the encoding intact * message with nil payload * leaves the message data intact * leaves the encoding intact * message with empty binary string payload * leaves the message data intact * leaves the encoding intact * over text transport * message with binary payload * encodes binary data as base64 * adds the encoding * already encoded message with binary payload * encodes binary data as base64 * adds the encoding * message with UTF-8 payload * leaves the data intact * leaves the encoding intact * message with nil payload * leaves the message data intact * leaves the encoding intact

Ably::Models::MessageEncoders::Cipher

(see {spec/unit/models/message_encoders/cipher_spec.rb}[./spec/unit/models/message_encoders/cipher_spec.rb]) * decode * with channel set up for AES-128-CBC * valid cipher data * message with cipher payload * decodes cipher * strips the encoding * message with cipher payload before other payloads * decodes cipher * strips the encoding * message with binary payload * decodes cipher * strips the encoding * returns ASCII_8BIT encoded binary data * message with another payload * leaves the message data intact * leaves the encoding intact * 256 bit key * with invalid channel_option cipher params * raise an exception * without any configured encryption * raise an exception * with invalid cipher data * raise an exception * with AES-256-CBC * message with cipher payload * decodes cipher * strips the encoding * encode * with channel set up for AES-128-CBC * with encrypted set to true * message with string payload * encodes cipher * adds the encoding with utf-8 * message with binary payload * encodes cipher * adds the encoding without utf-8 prefixed * returns ASCII_8BIT encoded binary data * message with json payload * encodes cipher * adds the encoding with utf-8 * message with existing cipher encoding before * leaves message intact as it is already encrypted * leaves encoding intact * with encryption set to to false * leaves message intact as encryption is not enable * leaves encoding intact * channel_option cipher params * have invalid key length * raise an exception * have invalid algorithm * raise an exception * have missing key * raise an exception * with AES-256-CBC * message with cipher payload * decodes cipher * strips the encoding

Ably::Models::MessageEncoders::Json

(see {spec/unit/models/message_encoders/json_spec.rb}[./spec/unit/models/message_encoders/json_spec.rb]) * decode * message with json payload * decodes json * strips the encoding * message with json payload in camelCase * decodes json * strips the encoding * message with json payload before other payloads * decodes json * strips the encoding * message with another payload * leaves the message data intact * leaves the encoding intact * encode * message with hash payload * encodes hash payload data as json * adds the encoding * message with hash payload and underscore case keys * encodes hash payload data as json and leaves underscore case in tact * adds the encoding * already encoded message with hash payload * encodes hash payload data as json * adds the encoding * message with Array payload * encodes Array payload data as json * adds the encoding * message with UTF-8 payload * leaves the message data intact * leaves the encoding intact * message with nil payload * leaves the message data intact * leaves the encoding intact * message with no data payload * leaves the message data intact * leaves the encoding intact

Ably::Models::MessageEncoders::Utf8

(see {spec/unit/models/message_encoders/utf8_spec.rb}[./spec/unit/models/message_encoders/utf8_spec.rb]) * decode * message with utf8 payload * sets the encoding * strips the encoding * message with utf8 payload before other payloads * sets the encoding * strips the encoding * message with another payload * leaves the message data intact * leaves the encoding intact

Ably::Models::Message

(see {spec/unit/models/message_spec.rb}[./spec/unit/models/message_spec.rb]) * serialization of the Message object (RSL1j) * behaves like a model * attributes * id * retrieves attribute :id * name * retrieves attribute :name * client_id * retrieves attribute :client_id * data * retrieves attribute :data * encoding * retrieves attribute :encoding * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs * is immutable * prevents changes * dups options * id (RSL1j) * exposes the #id attribute * #as_json exposes the #id attribute * timestamp * retrieves attribute :timestamp as Time object from ProtocolMessage * extras (TM2i) * when missing * is nil * when a string * raises an exception * when a Hash * contains a Hash Json object * when a Json Array * contains a Json Array object * connection_id attribute * when this model has a connectionId attribute * but no protocol message * uses the model value * with a protocol message with a different connectionId * uses the model value * when this model has no connectionId attribute * and no protocol message * uses the model value * with a protocol message with a connectionId * uses the model value * initialized with * :name * as UTF_8 string * is permitted * remains as UTF-8 * as SHIFT_JIS string * gets converted to UTF-8 * is compatible with original encoding * as ASCII_8BIT string * gets converted to UTF-8 * is compatible with original encoding * as Integer * raises an argument error * as Nil * is permitted * :client_id * as UTF_8 string * is permitted * remains as UTF-8 * as SHIFT_JIS string * gets converted to UTF-8 * is compatible with original encoding * as ASCII_8BIT string * gets converted to UTF-8 * is compatible with original encoding * as Integer * raises an argument error * as Nil * is permitted * :encoding * as UTF_8 string * is permitted * remains as UTF-8 * as SHIFT_JIS string * gets converted to UTF-8 * is compatible with original encoding * as ASCII_8BIT string * gets converted to UTF-8 * is compatible with original encoding * as Integer * raises an argument error * as Nil * is permitted * size * String (TO3l8a) * should return 33 bytes * Object (TO3l8b) * should return 38 bytes * Array (TO3l8b) * should return 24 bytes * extras (TO3l8d) * should return 57 bytes * nil (TO3l8e) * should return 19 bytes * protocol_message_index (RTL21) * should return correct protocol_message_index * from_encoded (TM3) * with no encoding * returns a message object * with a block * does not call the block * with an encoding * returns a message object * with a custom encoding * returns a message object with the residual incompatible transforms left in the encoding property * with a Cipher encoding * returns a message object with the residual incompatible transforms left in the encoding property * with invalid Cipher encoding * without a block * raises an exception * with a block * calls the block with the exception * from_encoded_array (TM3) * with no encoding * returns an Array of message objects * delta_extras (TM2i) * when delta * should return vcdiff format * should return 1234-1234-5678-9009 message id * when no delta * should return nil

Ably::Models::PaginatedResult

(see {spec/unit/models/paginated_result_spec.rb}[./spec/unit/models/paginated_result_spec.rb]) * items * returns correct length from body * is Enumerable * is iterable * provides [] accessor method * #first gets the first item in page * #last gets the last item in page * each * returns an enumerator * yields each item * with non paged http response * is the last page * does not have next page * does not support pagination * returns nil when accessing next page * returns nil when accessing first page * with paged http response * has next page * is not the last page * supports pagination * accessing next page * returns another PaginatedResult * retrieves the next page of results * does not have a next page * is the last page * returns nil when trying to access the last page when it is the last page * and then first page * returns a PaginatedResult * retrieves the first page of results

Ably::Models::PresenceMessage

(see {spec/unit/models/presence_message_spec.rb}[./spec/unit/models/presence_message_spec.rb]) * behaves like a model * attributes * id * retrieves attribute :id * client_id * retrieves attribute :client_id * data * retrieves attribute :data * encoding * retrieves attribute :encoding * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs * is immutable * prevents changes * dups options * connection_id attribute * when this model has a connectionId attribute * but no protocol message * uses the model value * with a protocol message with a different connectionId * uses the model value * when this model has no connectionId attribute * and no protocol message * uses the model value * with a protocol message with a connectionId * uses the model value * member_key attribute * is string in format connection_id:client_id * with the same client id across multiple connections * is unique * with a single connection and different client_ids * is unique * timestamp * retrieves attribute :timestamp as a Time object from ProtocolMessage * initialized with * :client_id * as UTF_8 string * is permitted * remains as UTF-8 * as SHIFT_JIS string * gets converted to UTF-8 * is compatible with original encoding * as ASCII_8BIT string * gets converted to UTF-8 * is compatible with original encoding * as Integer * raises an argument error * as Nil * is permitted * :connection_id * as UTF_8 string * is permitted * remains as UTF-8 * as SHIFT_JIS string * gets converted to UTF-8 * is compatible with original encoding * as ASCII_8BIT string * gets converted to UTF-8 * is compatible with original encoding * as Integer * raises an argument error * as Nil * is permitted * :encoding * as UTF_8 string * is permitted * remains as UTF-8 * as SHIFT_JIS string * gets converted to UTF-8 * is compatible with original encoding * as ASCII_8BIT string * gets converted to UTF-8 * is compatible with original encoding * as Integer * raises an argument error * as Nil * is permitted * size * String (TO3l8a) * should return 20 bytes * Object (TO3l8b) * should return 32 bytes * Array (TO3l8b) * should return 18 bytes * extras (TO3l8d) * should return 51 bytes * nil (TO3l8e) * should return 1 bytes * from_encoded (TP4) * with no encoding * returns a presence message object * with a block * does not call the block * with an encoding * returns a presence message object * with a custom encoding * returns a presence message object with the residual incompatible transforms left in the encoding property * with a Cipher encoding * returns a presence message object with the residual incompatible transforms left in the encoding property * with invalid Cipher encoding * without a block * raises an exception * with a block * calls the block with the exception * from_encoded_array (TP4) * with no encoding * returns an Array of presence message objects * shallow_clone * with inherited attributes from ProtocolMessage * creates a duplicate of the message without any ProtocolMessage dependency * with embedded attributes for all fields * creates a duplicate of the message without any ProtocolMessage dependency * with new attributes passed in to the method * creates a duplicate of the message without any ProtocolMessage dependency * with an invalid ProtocolMessage (missing an ID) * allows an ID to be passed in to the shallow clone that takes precedence * with mixing of cases * resolves case issues and can use camelCase or snake_case

Ably::Models::ProtocolMessage

(see {spec/unit/models/protocol_message_spec.rb}[./spec/unit/models/protocol_message_spec.rb]) * behaves like a model * attributes * id * retrieves attribute :id * channel * retrieves attribute :channel * channel_serial * retrieves attribute :channel_serial * connection_id * retrieves attribute :connection_id * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs * is immutable * prevents changes * dups options * attributes * timestamp * retrieves attribute :timestamp as Time object * count * when missing * is 1 * when non numeric * is 1 * when greater than 1 * is the value of count * message_serial * converts :msg_serial to an Integer * has_message_serial? * without msg_serial * returns false * with msg_serial * returns true * flags (TR4i) * when nil * is zero * when numeric * is an Integer * when presence flag present * #has_presence_flag? is true * #has_channel_resumed_flag? is false * when channel resumed flag present * #has_channel_resumed_flag? is true * #has_presence_flag? is false * when attach resumed flag * flags is 34 * #has_attach_resume_flag? is true * #has_attach_presence_flag? is false * flags is 0 * should raise an exception if flags is a float number * when channel resumed and presence flags present * #has_channel_resumed_flag? is true * #has_presence_flag? is true * when has another future flag * #has_presence_flag? is false * #has_backlog_flag? is true * params (RTL4k1) * when present * {is expected to eq {:foo=>:bar}}[./spec/unit/models/protocol_message_spec.rb#L224] * when empty * {is expected to eq {}}[./spec/unit/models/protocol_message_spec.rb#L230] * error * with no error attribute * returns nil * with nil error * returns nil * with error * returns a valid ErrorInfo object * messages (TR4k) * contains Message objects * messages (RTL21) * contains Message objects in ascending order * presence (TR4l) * contains PresenceMessage objects * message_size (TO3l8) * on presence * should return 13 bytes (sum in bytes: data and client_id) * on message * should return 76 bytes (sum in bytes: data, client_id, name, extras) * connection_details (TR4o) * with a JSON value * contains a ConnectionDetails object * contains the attributes from the JSON connectionDetails * without a JSON value * contains an empty ConnectionDetails object * auth (TR4p) * with a JSON value * contains a AuthDetails object * contains the attributes from the JSON auth details * without a JSON value * contains an empty AuthDetails object

Ably::Models::PushChannelSubscription

(see {spec/unit/models/push_channel_subscription_spec.rb}[./spec/unit/models/push_channel_subscription_spec.rb]) * channel and channel= * setter accepts a string value and getter returns the new value * setter accepts nil * rejects non string or nil values * client_id and client_id= * setter accepts a string value and getter returns the new value * setter accepts nil * rejects non string or nil values * device_id and device_id= * setter accepts a string value and getter returns the new value * setter accepts nil * rejects non string or nil values * camelCase constructor attributes * are rubyfied and exposed as underscore case * are generated when the object is serialised to JSON * conversion method PushChannelSubscription * accepts a PushChannelSubscription object * for_client_id constructor * with a valid object * accepts a Hash object * with an invalid valid object * accepts a Hash object

Ably::Models::Stats

(see {spec/unit/models/stats_spec.rb}[./spec/unit/models/stats_spec.rb]) * all stats * returns a MessageTypes object * returns value for message counts * returns value for all data transferred * returns zero for empty values * raises an exception for unknown attributes * all * is a MessageCount object * presence * is a MessageCount object * messages * is a MessageCount object * persisted stats * returns a MessageTypes object * returns value for message counts * returns value for all data transferred * returns zero for empty values * raises an exception for unknown attributes * all * is a MessageCount object * presence * is a MessageCount object * messages * is a MessageCount object * inbound stats * returns a MessageTraffic object * returns value for realtime message counts * returns value for all presence data * raises an exception for unknown attributes * realtime * is a MessageTypes object * rest * is a MessageTypes object * webhook * is a MessageTypes object * all * is a MessageTypes object * outbound stats * returns a MessageTraffic object * returns value for realtime message counts * returns value for all presence data * raises an exception for unknown attributes * realtime * is a MessageTypes object * rest * is a MessageTypes object * webhook * is a MessageTypes object * all * is a MessageTypes object * connections stats * returns a ConnectionTypes object * returns value for tls opened counts * returns value for all peak connections * returns zero for empty values * raises an exception for unknown attributes * tls * is a ResourceCount object * plain * is a ResourceCount object * all * is a ResourceCount object * channels stats * returns a ResourceCount object * returns value for opened counts * returns value for peak channels * returns zero for empty values * raises an exception for unknown attributes * opened * is a Integer object * peak * is a Integer object * mean * is a Integer object * min * is a Integer object * refused * is a Integer object * api_requests stats * returns a RequestCount object * returns value for succeeded * returns value for failed * raises an exception for unknown attributes * succeeded * is a Integer object * failed * is a Integer object * refused * is a Integer object * token_requests stats * returns a RequestCount object * returns value for succeeded * returns value for failed * raises an exception for unknown attributes * succeeded * is a Integer object * failed * is a Integer object * refused * is a Integer object * interval_granularity * returns the granularity of the interval_id * interval_time * returns a Time object representing the start of the interval * class methods * to_interval_id * when time zone of time argument is UTC * converts time 2014-02-03:05:06 with granularity :month into 2014-02 * converts time 2014-02-03:05:06 with granularity :day into 2014-02-03 * converts time 2014-02-03:05:06 with granularity :hour into 2014-02-03:05 * converts time 2014-02-03:05:06 with granularity :minute into 2014-02-03:05:06 * fails with invalid granularity * fails with invalid time * when time zone of time argument is +02:00 * converts time 2014-02-03:06 with granularity :hour into 2014-02-03:04 at UTC +00:00 * from_interval_id * converts a month interval_id 2014-02 into a Time object in UTC 0 * converts a day interval_id 2014-02-03 into a Time object in UTC 0 * converts an hour interval_id 2014-02-03:05 into a Time object in UTC 0 * converts a minute interval_id 2014-02-03:05:06 into a Time object in UTC 0 * fails with an invalid interval_id 14-20 * granularity_from_interval_id * returns a :month interval_id for 2014-02 * returns a :day interval_id for 2014-02-03 * returns a :hour interval_id for 2014-02-03:05 * returns a :minute interval_id for 2014-02-03:05:06 * fails with an invalid interval_id 14-20

Ably::Models::TokenDetails

(see {spec/unit/models/token_details_spec.rb}[./spec/unit/models/token_details_spec.rb]) * behaves like a model * attributes * token * retrieves attribute :token * key_name * retrieves attribute :key_name * client_id * retrieves attribute :client_id * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs * is immutable * prevents changes * dups options * attributes * capability * retrieves attribute :capability as parsed JSON * * issued with :issued option as milliseconds in constructor * retrieves attribute :issued as Time * issued with :issued option as a Time in constructor * retrieves attribute :issued as Time * issued when converted to JSON * is in milliseconds * expires with :expires option as milliseconds in constructor * retrieves attribute :expires as Time * expires with :expires option as a Time in constructor * retrieves attribute :expires as Time * expires when converted to JSON * is in milliseconds * expired? * once grace period buffer has passed * is true * within grace period buffer * is false * when expires is not available (i.e. string tokens) * is always false * with :from attribute * is false * is true * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs * to_json * with all attributes and values * returns all attributes * with only a token string * returns populated attributes * from_json (TD7) * with Ruby idiomatic Hash object * returns a valid TokenDetails object * with JSON-like object * returns a valid TokenDetails object * with JSON string * returns a valid TokenDetails object

Ably::Models::TokenRequest

(see {spec/unit/models/token_request_spec.rb}[./spec/unit/models/token_request_spec.rb]) * behaves like a model * attributes * key_name * retrieves attribute :key_name * client_id * retrieves attribute :client_id * nonce * retrieves attribute :nonce * mac * retrieves attribute :mac * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs * is immutable * prevents changes * dups options * attributes * capability * retrieves attribute :capability as parsed JSON * timestamp * with :timestamp option as milliseconds in constructor * retrieves attribute :timestamp as Time * with :timestamp option as Time in constructor * retrieves attribute :timestamp as Time * when converted to JSON * is in milliseconds since epoch * ttl * with :ttl option as milliseconds in constructor * retrieves attribute :ttl as seconds * when converted to JSON * is in milliseconds since epoch * == * is true when attributes are the same * is false when attributes are not the same * is false when class type differs * from_json (TE6) * with Ruby idiomatic Hash object * returns a valid TokenRequest object * with JSON-like object * returns a valid TokenRequest object * with JSON string * returns a valid TokenRequest object

Ably::Modules::EventEmitter

(see {spec/unit/modules/event_emitter_spec.rb}[./spec/unit/modules/event_emitter_spec.rb]) * emit event fan out * should emit an event for any number of subscribers * sends only messages to matching event names * on subscribe to multiple events * with the same block * event callback changes within the callback block * when new event callbacks are added * is unaffected and processes the prior event callbacks once (#RTE6b) * adds them for the next emitted event (#RTE6b) * when callbacks are removed * is unaffected and processes the prior event callbacks once (#RTE6b) * removes them for the next emitted event (#RTE6b) * on (RTE3) * with event specified * calls the block every time an event is emitted only * catches exceptions in the provided block, logs the error and continues * with no event specified * calls the block every time an event is emitted only * catches exceptions in the provided block, logs the error and continues * once (RTE4) * with event specified * calls the block the first time an event is emitted only * does not remove other blocks after it is called * catches exceptions in the provided block, logs the error and continues * with no event specified * calls the block the first time an event is emitted only * does not remove other blocks after it is called * catches exceptions in the provided block, logs the error and continues * unsafe_once * calls the block the first time an event is emitted only * does not catch exceptions in provided blocks * off * with event specified in on handler * with event names as arguments * deletes matching callbacks when a block is provided * deletes all matching callbacks when a block is not provided * continues if the block does not exist * without any event names * deletes all matching callbacks * deletes all callbacks if not block given * when on callback is configured for all events * with event names as arguments * does not remove the all events callback when a block is provided * does not remove the all events callback when a block is not provided * does not remove the all events callback when the block does not match * without any event names * deletes all matching callbacks * deletes all callbacks if not block given * with unsafe_on subscribers * does not deregister them * with unsafe_once subscribers * does not deregister them * unsafe_off * with unsafe_on subscribers * deregisters them * with unsafe_once subscribers * deregister them * with on subscribers * does not deregister them * with once subscribers * does not deregister them

Ably::Modules::StateEmitter

(see {spec/unit/modules/state_emitter_spec.rb}[./spec/unit/modules/state_emitter_spec.rb]) * #state returns current state * #state= sets current state * #change_state sets current state * change_state with arguments * passes the arguments through to the executed callback * state? * returns true if state matches * returns false if state does not match * and convenience predicates for states * returns true for #initializing? if state matches * returns false for #connecting? if state does not match

Ably::Realtime::Channel

(see {spec/unit/realtime/channel_spec.rb}[./spec/unit/realtime/channel_spec.rb]) * initializer * as UTF_8 string * is permitted * remains as UTF-8 * as SHIFT_JIS string * gets converted to UTF-8 * is compatible with original encoding * as ASCII_8BIT string * gets converted to UTF-8 * is compatible with original encoding * as Integer * raises an argument error * as Nil * raises an argument error * publish name argument * as UTF_8 string * is permitted * as SHIFT_JIS string * is permitted * as ASCII_8BIT string * is permitted * as Integer * raises an argument error * as Nil * is permitted * callbacks * are supported for valid STATE events * fail with unacceptable STATE event names * subscriptions * subscribe * without a block raises an invalid ArgumentError * with no event name specified subscribes the provided block to all events * with a single event name subscribes that block to matching events * with a multiple event name arguments subscribes that block to all of those event names * with a multiple duplicate event name arguments subscribes that block to all of those unique event names once * unsubscribe * with no event name specified unsubscribes that block from all events * with a single event name argument unsubscribes the provided block with the matching event name * with multiple event name arguments unsubscribes each of those matching event names with the provided block * with a non-matching event name argument has no effect * with no block argument unsubscribes all blocks for the event name argument

Ably::Realtime::Channels

(see {spec/unit/realtime/channels_spec.rb}[./spec/unit/realtime/channels_spec.rb]) * creating channels * [] creates a channel * get * when channel doesn’t exist * hash * is expected to be a kind of Hash * creates a channel (RTS3a) * ChannelOptions object * is expected to be a kind of Ably::Models::ChannelOptions * creates a channel (RTS3a) * when an existing channel exists * will update the options on the channel if provided (RSN3c) * will leave the options intact on the channel if not provided * hash * is expected to be a kind of Hash * will reuse a channel object if it exists (RTS3a) * ChannelOptions object * is expected to be a kind of Ably::Models::ChannelOptions * will reuse a channel object if it exists (RTS3a) * fetch * retrieves a channel if it exists * calls the block if channel is missing * destroying channels * #release detaches and then releases the channel resources * is Enumerable * allows enumeration * provides #length * each * returns an enumerator * yields each channel

Ably::Realtime::Client

(see {spec/unit/realtime/client_spec.rb}[./spec/unit/realtime/client_spec.rb]) * behaves like a client initializer * with invalid arguments * empty hash * raises an exception * nil * raises an exception * key: “invalid” * raises an exception * key: “invalid:asdad” * raises an exception * key and key_name * raises an exception * key and key_secret * raises an exception * with valid arguments * key only * connects to the Ably service * uses basic auth * with a string key instead of options hash * sets the key * sets the key_name * sets the key_secret * uses basic auth * with a string token key instead of options hash * sets the token * with token * sets the token * with token_details * sets the token * with token_params * configures default_token_params * endpoint * defaults to production * with environment option * uses an alternate endpoint * with rest_host option * PENDING: {uses an alternate endpoint for REST clients}[./spec/shared/client_initializer_behaviour.rb#L177] * with realtime_host option * uses an alternate endpoint for Realtime clients * with port option and non-TLS connections * uses the custom port for non-TLS requests * with tls_port option and a TLS connection * uses the custom port for TLS requests * tls * defaults to TLS * set to false * uses plain text * uses HTTP * logger * default * uses Ruby Logger * specifies Logger::WARN log level * with log_level :none * silences all logging with a NilLogger * with custom logger and log_level * uses the custom logger * sets the custom log level * environment * when set without custom fallback hosts configured * sets the environment attribute * uses the default fallback hosts (#TBC, see https://github.com/ably/wiki/issues/361) * when set with custom fallback hosts configured * sets the environment attribute * uses the custom provided fallback hosts (#RSC15a) * when set with fallback_hosts_use_default * sets the environment attribute * uses the production default fallback hosts (#RTN17b) * rest_host * when set without custom fallback hosts configured * sets the custom_host attribute * has no default fallback hosts * when set with environment and without custom fallback hosts configured * sets the environment attribute * sets the custom_host attribute * has no default fallback hosts * when set with custom fallback hosts configured * sets the custom_host attribute * has no default fallback hosts * realtime_host * when set without custom fallback hosts configured * sets the realtime_host option * has no default fallback hosts * custom port * when set without custom fallback hosts configured * has no default fallback hosts * custom TLS port * when set without custom fallback hosts configured * has no default fallback hosts * delegators * delegates :client_id to .auth * delegates :auth_options to .auth * delegation to the REST Client * passes on the options to the initializer * for attribute * #environment * #use_tls? * #log_level * #custom_host * when :transport_params option is passed * converts options to strings * push * #device is not supported and raises an exception * #push returns a Push object

Ably::Realtime::Connection

(see {spec/unit/realtime/connection_spec.rb}[./spec/unit/realtime/connection_spec.rb]) * callbacks * are supported for valid STATE events * fail with unacceptable STATE event names

Ably::Realtime::Presence

(see {spec/unit/realtime/presence_spec.rb}[./spec/unit/realtime/presence_spec.rb]) * callbacks * are supported for valid STATE events * fail with unacceptable STATE event names * subscriptions * subscribe * without a block raises an invalid ArgumentError * with no action specified subscribes the provided block to all action * with a single action argument subscribes that block to matching actions * with a multiple action arguments subscribes that block to all of those actions * with a multiple duplicate action arguments subscribes that block to all of those unique actions once * unsubscribe * with no action specified unsubscribes that block from all events * with a single action argument unsubscribes the provided block with the matching action * with multiple action arguments unsubscribes each of those matching actions with the provided block * with a non-matching action argument has no effect * with no block argument unsubscribes all blocks for the action argument

Ably::Realtime::Channel::PushChannel

(see {spec/unit/realtime/push_channel_spec.rb}[./spec/unit/realtime/push_channel_spec.rb]) * is constructed with a channel * raises an exception if constructed with an invalid type * exposes the channel as attribute #channel * is available in the #push attribute of the channel * methods not implemented as push notifications * #subscribe_device raises an unsupported exception * #subscribe_client_id raises an unsupported exception * #unsubscribe_device raises an unsupported exception * #unsubscribe_client_id raises an unsupported exception * #get_subscriptions raises an unsupported exception

Ably::Realtime

(see {spec/unit/realtime/realtime_spec.rb}[./spec/unit/realtime/realtime_spec.rb]) * constructor returns an Ably::Realtime::Client

Ably::Realtime::RecoveryKeyContext

(see {spec/unit/realtime/recovery_key_context_spec.rb}[./spec/unit/realtime/recovery_key_context_spec.rb]) * connection recovery key * should encode recovery key - RTN16i, RTN16f, RTN16j * should decode recovery key - RTN16i, RTN16f, RTN16j * should return nil for invalid recovery key - RTN16i, RTN16f, RTN16j

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 * catches exceptions in the callback and logs the error to the logger * fail * calls the callbacks defined with #errback, but not the ones added for success #callback * callback * adds a callback that is called when #succed is called * catches exceptions in the callback and logs the error to the logger * succeed * calls the callbacks defined with #callback, but not the ones added for #errback

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 * catches exceptions in the callback and logs the error to the logger * fail * calls the callbacks defined with #errback, but not the ones added for success #callback * callback * adds a callback that is called when #succed is called * catches exceptions in the callback and logs the error to the logger * succeed * calls the callbacks defined with #callback, but not the ones added for #errback

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 * catches exceptions in the callback and logs the error to the logger * fail * calls the callbacks defined with #errback, but not the ones added for success #callback * callback * adds a callback that is called when #succed is called * catches exceptions in the callback and logs the error to the logger * succeed * calls the callbacks defined with #callback, but not the ones added for #errback

Ably::Rest::Channel

(see {spec/unit/rest/channel_spec.rb}[./spec/unit/rest/channel_spec.rb]) * initializer * as UTF_8 string * is permitted * remains as UTF-8 * as frozen UTF_8 string * is permitted * remains as UTF-8 * as SHIFT_JIS string * gets converted to UTF-8 * is compatible with original encoding * as ASCII_8BIT string * gets converted to UTF-8 * is compatible with original encoding * as Integer * raises an argument error * as Nil * raises an argument error * publish name argument * as UTF_8 string * is permitted * as frozen UTF_8 string * is permitted * as SHIFT_JIS string * is permitted * as ASCII_8BIT string * is permitted * as Integer * raises an argument error * max message size exceeded * when max_message_size is nil * and a message size is 65537 bytes * should raise Ably::Exceptions::MaxMessageSizeExceeded * when max_message_size is 65536 bytes * and a message size is 65537 bytes * should raise Ably::Exceptions::MaxMessageSizeExceeded * and a message size is 10 bytes * should send a message * when max_message_size is 10 bytes * and a message size is 11 bytes * should raise Ably::Exceptions::MaxMessageSizeExceeded * and a message size is 2 bytes * should send a message

Ably::Rest::Channels

(see {spec/unit/rest/channels_spec.rb}[./spec/unit/rest/channels_spec.rb]) * [] creates a channel * get * when channel doesn’t exist * hash * is expected to be a kind of Hash * creates a channel (RSN3a) * ChannelOptions object * is expected to be a kind of Ably::Models::ChannelOptions * creates a channel (RSN3a) * when an existing channel exists * hash * is expected to be a kind of Hash * will reuse a channel object if it exists (RSN3a) * ChannelOptions object * is expected to be a kind of Ably::Models::ChannelOptions * will reuse a channel object if it exists (RSN3a) * with new channel_options modes * hash * is expected to be a kind of Hash * will update channel with provided options modes (RSN3c) * ChannelOptions object * is expected to be a kind of Ably::Models::ChannelOptions * will update channel with provided options modes (RSN3c) * fetch * retrieves a channel if it exists * calls the block if channel is missing * destroying channels * #release releases the channel resoures * is Enumerable * allows enumeration * provides #length * each * returns an enumerator * yields each channel

Ably::Rest::Client

(see {spec/unit/rest/client_spec.rb}[./spec/unit/rest/client_spec.rb]) * behaves like a client initializer * with invalid arguments * empty hash * raises an exception * nil * raises an exception * key: “invalid” * raises an exception * key: “invalid:asdad” * raises an exception * key and key_name * raises an exception * key and key_secret * raises an exception * with valid arguments * key only * connects to the Ably service * uses basic auth * with a string key instead of options hash * sets the key * sets the key_name * sets the key_secret * uses basic auth * with a string token key instead of options hash * sets the token * with token * sets the token * with token_details * sets the token * with token_params * configures default_token_params * endpoint * defaults to production * with environment option * uses an alternate endpoint * with rest_host option * uses an alternate endpoint for REST clients * with realtime_host option * PENDING: {uses an alternate endpoint for Realtime clients}[./spec/shared/client_initializer_behaviour.rb#L186] * with port option and non-TLS connections * uses the custom port for non-TLS requests * with tls_port option and a TLS connection * uses the custom port for TLS requests * tls * defaults to TLS * set to false * uses plain text * uses HTTP * logger * default * uses Ruby Logger * specifies Logger::WARN log level * with log_level :none * silences all logging with a NilLogger * with custom logger and log_level * uses the custom logger * sets the custom log level * environment * when set without custom fallback hosts configured * sets the environment attribute * uses the default fallback hosts (#TBC, see https://github.com/ably/wiki/issues/361) * when set with custom fallback hosts configured * sets the environment attribute * uses the custom provided fallback hosts (#RSC15a) * when set with fallback_hosts_use_default * sets the environment attribute * uses the production default fallback hosts (#RTN17b) * rest_host * when set without custom fallback hosts configured * sets the custom_host attribute * has no default fallback hosts * when set with environment and without custom fallback hosts configured * sets the environment attribute * sets the custom_host attribute * has no default fallback hosts * when set with custom fallback hosts configured * sets the custom_host attribute * has no default fallback hosts * realtime_host * when set without custom fallback hosts configured * sets the realtime_host option * has no default fallback hosts * custom port * when set without custom fallback hosts configured * has no default fallback hosts * custom TLS port * when set without custom fallback hosts configured * has no default fallback hosts * delegators * delegates :client_id to .auth * delegates :auth_options to .auth * initializer options * TLS * disabled * fails for any operation with basic auth and attempting to send an API key over a non-secure connection (#RSA1) * fallback_retry_timeout (RSC15f) * default * is set to 10 minutes * when provided * configures a new timeout * use agent * set agent to non-default value * default agent * should return default ably agent * custom agent * should overwrite client.agent * :use_token_auth * set to false * with a key and :tls => false * fails for any operation with basic auth and attempting to send an API key over a non-secure connection * without a key * fails as a key is required if not using token auth * set to true * without a key or token * fails as a key is required to issue tokens * max_message_size * is not present * should return default 65536 (#TO3l8) * is nil * should return default 65536 (#TO3l8) * is customized 131072 bytes * should return 131072 * request_id generation * includes request_id in URL * push * #device is not supported and raises an exception * #push returns a Push object

Ably::Rest::Channel::PushChannel

(see {spec/unit/rest/push_channel_spec.rb}[./spec/unit/rest/push_channel_spec.rb]) * is constructed with a channel * raises an exception if constructed with an invalid type * exposes the channel as attribute #channel * is available in the #push attribute of the channel * methods not implemented as push notifications * #subscribe_device raises an unsupported exception * #subscribe_client_id raises an unsupported exception * #unsubscribe_device raises an unsupported exception * #unsubscribe_client_id raises an unsupported exception * #get_subscriptions raises an unsupported exception

Ably::Rest

(see {spec/unit/rest/rest_spec.rb}[./spec/unit/rest/rest_spec.rb]) * constructor returns an Ably::Rest::Client

Ably::Util::Crypto

(see {spec/unit/util/crypto_spec.rb}[./spec/unit/util/crypto_spec.rb]) * defaults * match other client libraries * get_default_params * with just a :key param * uses the defaults * contains the provided key * returns a CipherParams object * without a :key param * raises an exception * with a base64-encoded :key param * converts the key to binary * with provided params * overrides the defaults * encrypt & decrypt * encrypts and decrypts a non-empty string * encrypts and decrypts an empty string * using shared client lib fixture data * with AES-128-CBC * behaves like an Ably encrypter and decrypter (RTL7d) * text payload * encrypts exactly the same binary data as other client libraries * decrypts exactly the same binary data as other client libraries * with AES-256-CBC * behaves like an Ably encrypter and decrypter (RTL7d) * text payload * encrypts exactly the same binary data as other client libraries * decrypts exactly the same binary data as other client libraries

Ably::Util::PubSub

(see {spec/unit/util/pub_sub_spec.rb}[./spec/unit/util/pub_sub_spec.rb]) * event fan out * #publish allows publishing to more than on subscriber * #publish sends only messages to #subscribe callbacks matching event names * unsubscribe * deletes matching callbacks * deletes all callbacks if not block given * continues if the block does not exist


## Test summary