ably 0.8.15 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -4
  3. data/CHANGELOG.md +6 -2
  4. data/README.md +5 -1
  5. data/SPEC.md +1473 -852
  6. data/ably.gemspec +11 -8
  7. data/lib/ably/auth.rb +90 -53
  8. data/lib/ably/exceptions.rb +37 -8
  9. data/lib/ably/logger.rb +10 -1
  10. data/lib/ably/models/auth_details.rb +42 -0
  11. data/lib/ably/models/channel_state_change.rb +18 -4
  12. data/lib/ably/models/connection_details.rb +6 -3
  13. data/lib/ably/models/connection_state_change.rb +4 -3
  14. data/lib/ably/models/error_info.rb +1 -1
  15. data/lib/ably/models/message.rb +17 -1
  16. data/lib/ably/models/message_encoders/base.rb +103 -82
  17. data/lib/ably/models/message_encoders/base64.rb +1 -1
  18. data/lib/ably/models/presence_message.rb +16 -1
  19. data/lib/ably/models/protocol_message.rb +20 -3
  20. data/lib/ably/models/token_details.rb +11 -1
  21. data/lib/ably/models/token_request.rb +16 -6
  22. data/lib/ably/modules/async_wrapper.rb +7 -3
  23. data/lib/ably/modules/encodeable.rb +51 -12
  24. data/lib/ably/modules/enum.rb +17 -7
  25. data/lib/ably/modules/event_emitter.rb +29 -14
  26. data/lib/ably/modules/model_common.rb +13 -21
  27. data/lib/ably/modules/state_emitter.rb +7 -4
  28. data/lib/ably/modules/state_machine.rb +2 -4
  29. data/lib/ably/modules/uses_state_machine.rb +7 -3
  30. data/lib/ably/realtime.rb +2 -0
  31. data/lib/ably/realtime/auth.rb +102 -42
  32. data/lib/ably/realtime/channel.rb +68 -26
  33. data/lib/ably/realtime/channel/channel_manager.rb +154 -65
  34. data/lib/ably/realtime/channel/channel_state_machine.rb +14 -15
  35. data/lib/ably/realtime/client.rb +18 -3
  36. data/lib/ably/realtime/client/incoming_message_dispatcher.rb +38 -29
  37. data/lib/ably/realtime/client/outgoing_message_dispatcher.rb +6 -1
  38. data/lib/ably/realtime/connection.rb +108 -49
  39. data/lib/ably/realtime/connection/connection_manager.rb +167 -61
  40. data/lib/ably/realtime/connection/connection_state_machine.rb +22 -3
  41. data/lib/ably/realtime/connection/websocket_transport.rb +19 -10
  42. data/lib/ably/realtime/presence.rb +70 -45
  43. data/lib/ably/realtime/presence/members_map.rb +201 -36
  44. data/lib/ably/realtime/presence/presence_manager.rb +30 -6
  45. data/lib/ably/realtime/presence/presence_state_machine.rb +5 -12
  46. data/lib/ably/rest.rb +2 -2
  47. data/lib/ably/rest/channel.rb +5 -5
  48. data/lib/ably/rest/client.rb +31 -27
  49. data/lib/ably/rest/middleware/exceptions.rb +1 -3
  50. data/lib/ably/rest/middleware/logger.rb +2 -2
  51. data/lib/ably/rest/presence.rb +2 -2
  52. data/lib/ably/util/pub_sub.rb +1 -1
  53. data/lib/ably/util/safe_deferrable.rb +26 -0
  54. data/lib/ably/version.rb +2 -2
  55. data/spec/acceptance/realtime/auth_spec.rb +470 -111
  56. data/spec/acceptance/realtime/channel_history_spec.rb +5 -3
  57. data/spec/acceptance/realtime/channel_spec.rb +1017 -168
  58. data/spec/acceptance/realtime/client_spec.rb +6 -6
  59. data/spec/acceptance/realtime/connection_failures_spec.rb +458 -27
  60. data/spec/acceptance/realtime/connection_spec.rb +424 -105
  61. data/spec/acceptance/realtime/message_spec.rb +52 -23
  62. data/spec/acceptance/realtime/presence_history_spec.rb +5 -3
  63. data/spec/acceptance/realtime/presence_spec.rb +1110 -96
  64. data/spec/acceptance/rest/auth_spec.rb +222 -59
  65. data/spec/acceptance/rest/base_spec.rb +1 -1
  66. data/spec/acceptance/rest/channel_spec.rb +1 -2
  67. data/spec/acceptance/rest/client_spec.rb +104 -48
  68. data/spec/acceptance/rest/message_spec.rb +42 -15
  69. data/spec/acceptance/rest/presence_spec.rb +4 -11
  70. data/spec/rspec_config.rb +2 -1
  71. data/spec/shared/client_initializer_behaviour.rb +2 -2
  72. data/spec/shared/safe_deferrable_behaviour.rb +6 -2
  73. data/spec/spec_helper.rb +4 -2
  74. data/spec/support/debug_failure_helper.rb +20 -4
  75. data/spec/support/event_machine_helper.rb +32 -1
  76. data/spec/unit/auth_spec.rb +4 -11
  77. data/spec/unit/logger_spec.rb +28 -2
  78. data/spec/unit/models/auth_details_spec.rb +49 -0
  79. data/spec/unit/models/channel_state_change_spec.rb +23 -3
  80. data/spec/unit/models/connection_details_spec.rb +12 -1
  81. data/spec/unit/models/connection_state_change_spec.rb +15 -4
  82. data/spec/unit/models/message_encoders/base64_spec.rb +2 -1
  83. data/spec/unit/models/message_spec.rb +153 -0
  84. data/spec/unit/models/presence_message_spec.rb +192 -0
  85. data/spec/unit/models/protocol_message_spec.rb +64 -6
  86. data/spec/unit/models/token_details_spec.rb +75 -0
  87. data/spec/unit/models/token_request_spec.rb +74 -0
  88. data/spec/unit/modules/async_wrapper_spec.rb +2 -1
  89. data/spec/unit/modules/enum_spec.rb +69 -0
  90. data/spec/unit/modules/event_emitter_spec.rb +149 -22
  91. data/spec/unit/modules/state_emitter_spec.rb +9 -3
  92. data/spec/unit/realtime/client_spec.rb +1 -1
  93. data/spec/unit/realtime/connection_spec.rb +8 -5
  94. data/spec/unit/realtime/incoming_message_dispatcher_spec.rb +1 -1
  95. data/spec/unit/realtime/presence_spec.rb +4 -3
  96. data/spec/unit/rest/client_spec.rb +1 -1
  97. data/spec/unit/util/crypto_spec.rb +3 -3
  98. metadata +22 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9214384ab04b11d18a4cbcd0cfa430854bf04e52
4
- data.tar.gz: 945b41698a5cf1cccfd98b3dfa9e7f9894fcd1a5
3
+ metadata.gz: 6ef659416f63ce4d28201ec7fdcfdabc9d844bf5
4
+ data.tar.gz: dab7fd81e1e304e76e375a7ddd5cf5c8fb551746
5
5
  SHA512:
6
- metadata.gz: 371d2f0d7a4200d6bb7946e2fba94b9bed19176d76140fd05335206c7ee3af20fd54ac2c7c3d0477bd004131fb835ee54b74779060de1fff2c1b3e0251b82ee4
7
- data.tar.gz: 6c6722c07d086c2ecfc6825c4d406a3b66f22df079b50690dc2912875669e0d5beba5e2ec566ec9e9bfdb2e7ab32bfd1abec552c3c3b65568fd170d7b0cc02d6
6
+ metadata.gz: 1a79248640d75e91cf1c6ac02f396643926df8f32722747103ed45e979e7afa68485d3a47ef7f02d36a09e50fd409d4f073ab92080278156d63a681f81c21082
7
+ data.tar.gz: 287cb8f210c1e21a26ec14164ef2d88b072333d431a6ef3f9b9c354661b5185e55deb85fd8b4df97ca7b175264551de9f6b2a02c8f5c58712ea4da6cdf0a5528
data/.travis.yml CHANGED
@@ -1,10 +1,12 @@
1
1
  sudo: false
2
- env: RSPEC_RETRY=false
2
+ env:
3
+ - RSPEC_RETRY=true PROTOCOL=json
4
+ - RSPEC_RETRY=true PROTOCOL=msgpack
3
5
  language: ruby
4
6
  rvm:
5
- - 1.9.3
6
- - 2.0.0
7
- - 2.2.0
7
+ - 1.9.3
8
+ - 2.0.0
9
+ - 2.2.0
8
10
  script: bundle exec rspec
9
11
  notifications:
10
12
  slack:
data/CHANGELOG.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # Change Log
2
2
 
3
- ## [v0.8.15](https://github.com/ably/ably-ruby/tree/v0.8.15)
3
+ ## [v1.0.0](https://github.com/ably/ably-ruby/tree/v1.0.0) (2017-03-07)
4
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.14...v1.0.0)
4
5
 
5
- [Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.14...v0.8.15)
6
+ ### v1.0 release and upgrade notes from v0.8
7
+
8
+ - See https://github.com/ably/docs/issues/235
6
9
 
7
10
  **Implemented enhancements:**
8
11
 
@@ -44,6 +47,7 @@
44
47
 
45
48
  **Merged pull requests:**
46
49
 
50
+ - 1.0 release [\#111](https://github.com/ably/ably-ruby/pull/111) ([mattheworiordan](https://github.com/mattheworiordan))
47
51
  - From encoded [\#101](https://github.com/ably/ably-ruby/pull/101) ([mattheworiordan](https://github.com/mattheworiordan))
48
52
 
49
53
  ## [v0.8.14](https://github.com/ably/ably-ruby/tree/v0.8.14) (2016-09-30)
data/README.md CHANGED
@@ -24,7 +24,7 @@ And then install this Bundler dependency:
24
24
  Or install it yourself as:
25
25
 
26
26
  $ gem install ably
27
-
27
+
28
28
  ### Using with Rails or Sinatra
29
29
 
30
30
  This `ably` gem provides both a [Realtime](http://www.ably.io/documentation/realtime/usage) and [REST](http://www.ably.io/documentation/rest/usage) version of the Ably library. Realtime depends on EventMachine to provide an asynchronous evented framework to run the library in, whereas the REST library depends only on synchronous libraries such as Faraday.
@@ -281,6 +281,10 @@ client.time #=> 2013-12-12 14:23:34 +0000
281
281
 
282
282
  If you only need to use the REST features of this library and do not want EventMachine as a dependency, then you should consider using the [Ably Ruby REST gem](https://rubygems.org/gems/ably-rest).
283
283
 
284
+ ## Upgrading from an older version
285
+
286
+ - [Release and upgrade notes for v0.8 -> v1.0](https://github.com/ably/docs/issues/235)
287
+
284
288
  ## Support, feedback and troubleshooting
285
289
 
286
290
  Please visit http://support.ably.io/ for access to our knowledgebase and to ask for any assistance.
data/SPEC.md CHANGED
@@ -1,107 +1,148 @@
1
- # Ably Realtime & REST Client Library 0.8.9 Specification
1
+ # Ably Realtime & REST Client Library 0.9.0-pre.1 Specification
2
2
 
3
3
  ### Ably::Realtime::Auth
4
4
  _(see [spec/acceptance/realtime/auth_spec.rb](./spec/acceptance/realtime/auth_spec.rb))_
5
5
  * using JSON protocol
6
6
  * with basic auth
7
7
  * #authentication_security_requirements_met?
8
- * [returns true](./spec/acceptance/realtime/auth_spec.rb#L20)
8
+ * [returns true](./spec/acceptance/realtime/auth_spec.rb#L28)
9
9
  * #key
10
- * [contains the API key](./spec/acceptance/realtime/auth_spec.rb#L27)
10
+ * [contains the API key](./spec/acceptance/realtime/auth_spec.rb#L35)
11
11
  * #key_name
12
- * [contains the API key name](./spec/acceptance/realtime/auth_spec.rb#L34)
12
+ * [contains the API key name](./spec/acceptance/realtime/auth_spec.rb#L42)
13
13
  * #key_secret
14
- * [contains the API key secret](./spec/acceptance/realtime/auth_spec.rb#L41)
14
+ * [contains the API key secret](./spec/acceptance/realtime/auth_spec.rb#L49)
15
15
  * #using_basic_auth?
16
- * [is true when using Basic Auth](./spec/acceptance/realtime/auth_spec.rb#L48)
16
+ * [is true when using Basic Auth](./spec/acceptance/realtime/auth_spec.rb#L56)
17
17
  * #using_token_auth?
18
- * [is false when using Basic Auth](./spec/acceptance/realtime/auth_spec.rb#L55)
18
+ * [is false when using Basic Auth](./spec/acceptance/realtime/auth_spec.rb#L63)
19
19
  * with token auth
20
20
  * #client_id
21
- * [contains the ClientOptions client ID](./spec/acceptance/realtime/auth_spec.rb#L67)
21
+ * [contains the ClientOptions client ID](./spec/acceptance/realtime/auth_spec.rb#L75)
22
22
  * #current_token_details
23
- * [contains the current token after auth](./spec/acceptance/realtime/auth_spec.rb#L74)
23
+ * [contains the current token after auth](./spec/acceptance/realtime/auth_spec.rb#L82)
24
24
  * #token_renewable?
25
- * [is true when an API key exists](./spec/acceptance/realtime/auth_spec.rb#L84)
25
+ * [is true when an API key exists](./spec/acceptance/realtime/auth_spec.rb#L92)
26
26
  * #options (auth_options)
27
- * [contains the configured auth options](./spec/acceptance/realtime/auth_spec.rb#L95)
27
+ * [contains the configured auth options](./spec/acceptance/realtime/auth_spec.rb#L104)
28
28
  * #token_params
29
- * [contains the configured auth options](./spec/acceptance/realtime/auth_spec.rb#L106)
29
+ * [contains the configured auth options](./spec/acceptance/realtime/auth_spec.rb#L115)
30
30
  * #using_basic_auth?
31
- * [is false when using Token Auth](./spec/acceptance/realtime/auth_spec.rb#L115)
31
+ * [is false when using Token Auth](./spec/acceptance/realtime/auth_spec.rb#L124)
32
32
  * #using_token_auth?
33
- * [is true when using Token Auth](./spec/acceptance/realtime/auth_spec.rb#L124)
34
- *
33
+ * [is true when using Token Auth](./spec/acceptance/realtime/auth_spec.rb#L133)
34
+ * methods
35
35
  * #create_token_request
36
- * [returns a token request asynchronously](./spec/acceptance/realtime/auth_spec.rb#L138)
36
+ * [returns a token request asynchronously](./spec/acceptance/realtime/auth_spec.rb#L147)
37
37
  * #create_token_request_async
38
- * [returns a token request synchronously](./spec/acceptance/realtime/auth_spec.rb#L148)
38
+ * [returns a token request synchronously](./spec/acceptance/realtime/auth_spec.rb#L157)
39
39
  * #request_token
40
- * [returns a token asynchronously](./spec/acceptance/realtime/auth_spec.rb#L158)
40
+ * [returns a token asynchronously](./spec/acceptance/realtime/auth_spec.rb#L167)
41
41
  * #request_token_async
42
- * [returns a token synchronously](./spec/acceptance/realtime/auth_spec.rb#L169)
43
- * #authorise
44
- * [returns a token asynchronously](./spec/acceptance/realtime/auth_spec.rb#L180)
42
+ * [returns a token synchronously](./spec/acceptance/realtime/auth_spec.rb#L178)
43
+ * #authorize
44
+ * with token auth
45
+ * [returns a token asynchronously](./spec/acceptance/realtime/auth_spec.rb#L192)
46
+ * with auth_callback blocking
47
+ * with a slow auth callback response
48
+ * [asynchronously authenticates](./spec/acceptance/realtime/auth_spec.rb#L215)
45
49
  * when implicitly called, with an explicit ClientOptions client_id
46
50
  * and an incompatible client_id in a TokenDetails object passed to the auth callback
47
- * [rejects a TokenDetails object with an incompatible client_id and raises an exception](./spec/acceptance/realtime/auth_spec.rb#L197)
48
- * and an incompatible client_id in a TokenRequest object passed to the auth callback and raises an exception
49
- * [rejects a TokenRequests object with an incompatible client_id and raises an exception](./spec/acceptance/realtime/auth_spec.rb#L212)
51
+ * [rejects a TokenDetails object with an incompatible client_id and fails with an exception](./spec/acceptance/realtime/auth_spec.rb#L239)
52
+ * and an incompatible client_id in a TokenRequest object passed to the auth callback and fails with an exception
53
+ * [rejects a TokenRequests object with an incompatible client_id and fails with an exception](./spec/acceptance/realtime/auth_spec.rb#L255)
50
54
  * when explicitly called, with an explicit ClientOptions client_id
51
55
  * and an incompatible client_id in a TokenDetails object passed to the auth callback
52
- * [rejects a TokenDetails object with an incompatible client_id and raises an exception](./spec/acceptance/realtime/auth_spec.rb#L243)
53
- * #authorise_async
54
- * [returns a token synchronously](./spec/acceptance/realtime/auth_spec.rb#L260)
56
+ * [rejects a TokenDetails object with an incompatible client_id and fails with an exception](./spec/acceptance/realtime/auth_spec.rb#L287)
57
+ * when already authenticated with a valid token
58
+ * [ensures message delivery continuity whilst upgrading (#RTC8a1)](./spec/acceptance/realtime/auth_spec.rb#L700)
59
+ * when INITIALIZED
60
+ * [obtains a token and connects to Ably (#RTC8c, #RTC8b1)](./spec/acceptance/realtime/auth_spec.rb#L328)
61
+ * when CONNECTING
62
+ * [aborts the current connection process, obtains a token, and connects to Ably again (#RTC8b)](./spec/acceptance/realtime/auth_spec.rb#L350)
63
+ * when FAILED
64
+ * [obtains a token and connects to Ably (#RTC8c, #RTC8b1)](./spec/acceptance/realtime/auth_spec.rb#L369)
65
+ * when CLOSED
66
+ * [obtains a token and connects to Ably (#RTC8c, #RTC8b1, #RTC8a3)](./spec/acceptance/realtime/auth_spec.rb#L386)
67
+ * when in the CONNECTED state
68
+ * with a valid token in the AUTH ProtocolMessage sent
69
+ * 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)*
70
+ * [obtains a new token (as anonymous user before & after) and upgrades the connection after receiving an updated CONNECTED ProtocolMessage (#RTC8a, #RTC8a3)](./spec/acceptance/realtime/auth_spec.rb#L445)
71
+ * when DISCONNECTED
72
+ * PENDING: *[obtains a token, upgrades from anonymous to identified, and connects to Ably immediately (#RTC8c, #RTC8b1)](./spec/acceptance/realtime/auth_spec.rb#L481)*
73
+ * [obtains a similar anonymous token and connects to Ably immediately (#RTC8c, #RTC8b1)](./spec/acceptance/realtime/auth_spec.rb#L517)
74
+ * when SUSPENDED
75
+ * [obtains a token and connects to Ably immediately (#RTC8c, #RTC8b1)](./spec/acceptance/realtime/auth_spec.rb#L561)
76
+ * when client is identified
77
+ * [transitions the connection state to FAILED if the client_id changes (#RSA15c, #RTC8a2)](./spec/acceptance/realtime/auth_spec.rb#L596)
78
+ * when auth fails
79
+ * [transitions the connection state to the FAILED state (#RSA15c, #RTC8a2, #RTC8a3)](./spec/acceptance/realtime/auth_spec.rb#L611)
80
+ * when the authCallback fails
81
+ * [calls the error callback of authorize and leaves the connection intact (#RSA4c3)](./spec/acceptance/realtime/auth_spec.rb#L639)
82
+ * when upgrading capabilities
83
+ * [is allowed (#RTC8a1)](./spec/acceptance/realtime/auth_spec.rb#L658)
84
+ * when downgrading capabilities (#RTC8a1)
85
+ * [is allowed and channels are detached](./spec/acceptance/realtime/auth_spec.rb#L683)
86
+ * #authorize_async
87
+ * [returns a token synchronously](./spec/acceptance/realtime/auth_spec.rb#L734)
88
+ * server initiated AUTH ProtocolMessage
89
+ * when received
90
+ * [should immediately start a new authentication process (#RTN22)](./spec/acceptance/realtime/auth_spec.rb#L758)
91
+ * when not received
92
+ * [should expect the connection to be disconnected by the server but should resume automatically (#RTN22a)](./spec/acceptance/realtime/auth_spec.rb#L781)
55
93
  * #auth_params
56
- * [returns the auth params asynchronously](./spec/acceptance/realtime/auth_spec.rb#L272)
94
+ * [returns the auth params asynchronously](./spec/acceptance/realtime/auth_spec.rb#L807)
57
95
  * #auth_params_sync
58
- * [returns the auth params synchronously](./spec/acceptance/realtime/auth_spec.rb#L281)
96
+ * [returns the auth params synchronously](./spec/acceptance/realtime/auth_spec.rb#L816)
59
97
  * #auth_header
60
- * [returns an auth header asynchronously](./spec/acceptance/realtime/auth_spec.rb#L288)
98
+ * [returns an auth header asynchronously](./spec/acceptance/realtime/auth_spec.rb#L823)
61
99
  * #auth_header_sync
62
- * [returns an auth header synchronously](./spec/acceptance/realtime/auth_spec.rb#L297)
100
+ * [returns an auth header synchronously](./spec/acceptance/realtime/auth_spec.rb#L832)
63
101
  * #client_id_validated?
64
102
  * when using basic auth
65
103
  * before connected
66
- * [is false as basic auth users do not have an identity](./spec/acceptance/realtime/auth_spec.rb#L310)
104
+ * [is false as basic auth users do not have an identity](./spec/acceptance/realtime/auth_spec.rb#L845)
67
105
  * once connected
68
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L317)
69
- * [contains a validated wildcard client_id](./spec/acceptance/realtime/auth_spec.rb#L324)
106
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L852)
107
+ * [contains a validated wildcard client_id](./spec/acceptance/realtime/auth_spec.rb#L859)
70
108
  * when using a token string
71
109
  * with a valid client_id
72
110
  * before connected
73
- * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L338)
74
- * [#client_id is nil](./spec/acceptance/realtime/auth_spec.rb#L343)
111
+ * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L873)
112
+ * [#client_id is nil](./spec/acceptance/realtime/auth_spec.rb#L878)
75
113
  * once connected
76
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L350)
77
- * [#client_id is populated](./spec/acceptance/realtime/auth_spec.rb#L357)
114
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L885)
115
+ * [#client_id is populated](./spec/acceptance/realtime/auth_spec.rb#L892)
78
116
  * with no client_id (anonymous)
79
117
  * before connected
80
- * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L370)
118
+ * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L905)
81
119
  * once connected
82
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L377)
120
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L912)
83
121
  * with a wildcard client_id (anonymous)
84
122
  * before connected
85
- * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L390)
123
+ * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L925)
86
124
  * once connected
87
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L397)
125
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L932)
88
126
  * when using a token
89
127
  * with a client_id
90
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L411)
128
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L946)
91
129
  * once connected
92
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L417)
130
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L952)
93
131
  * with no client_id (anonymous)
94
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L429)
132
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L964)
95
133
  * once connected
96
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L435)
134
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L970)
97
135
  * with a wildcard client_id (anonymous)
98
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L447)
136
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L982)
99
137
  * once connected
100
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L453)
138
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L988)
101
139
  * when using a token request with a client_id
102
- * [is not true as identification is not confirmed until authenticated](./spec/acceptance/realtime/auth_spec.rb#L466)
140
+ * [is not true as identification is not confirmed until authenticated](./spec/acceptance/realtime/auth_spec.rb#L1001)
103
141
  * once connected
104
- * [is true as identification is completed following CONNECTED ProtocolMessage](./spec/acceptance/realtime/auth_spec.rb#L472)
142
+ * [is true as identification is completed following CONNECTED ProtocolMessage](./spec/acceptance/realtime/auth_spec.rb#L1007)
143
+ * deprecated #authorise
144
+ * [logs a deprecation warning (#RSA10l)](./spec/acceptance/realtime/auth_spec.rb#L1045)
145
+ * [returns a valid token (#RSA10l)](./spec/acceptance/realtime/auth_spec.rb#L1051)
105
146
 
106
147
  ### Ably::Realtime::Channel#history
107
148
  _(see [spec/acceptance/realtime/channel_history_spec.rb](./spec/acceptance/realtime/channel_history_spec.rb))_
@@ -122,7 +163,7 @@ _(see [spec/acceptance/realtime/channel_history_spec.rb](./spec/acceptance/realt
122
163
  * [return the same results with unique matching message IDs](./spec/acceptance/realtime/channel_history_spec.rb#L135)
123
164
  * with option until_attach: true
124
165
  * [retrieves all messages before channel was attached](./spec/acceptance/realtime/channel_history_spec.rb#L160)
125
- * [raises an exception unless state is attached](./spec/acceptance/realtime/channel_history_spec.rb#L209)
166
+ * [fails the deferrable unless the state is attached](./spec/acceptance/realtime/channel_history_spec.rb#L209)
126
167
  * and two pages of messages
127
168
  * [retrieves two pages of messages before channel was attached](./spec/acceptance/realtime/channel_history_spec.rb#L175)
128
169
 
@@ -131,185 +172,277 @@ _(see [spec/acceptance/realtime/channel_spec.rb](./spec/acceptance/realtime/chan
131
172
  * using JSON protocol
132
173
  * initialization
133
174
  * with :auto_connect option set to false on connection
134
- * [remains initialized when accessing a channel](./spec/acceptance/realtime/channel_spec.rb#L21)
135
- * [opens a connection implicitly on #attach](./spec/acceptance/realtime/channel_spec.rb#L29)
175
+ * [remains initialized when accessing a channel](./spec/acceptance/realtime/channel_spec.rb#L26)
176
+ * [opens a connection implicitly on #attach](./spec/acceptance/realtime/channel_spec.rb#L34)
136
177
  * #attach
137
- * [emits attaching then attached events](./spec/acceptance/realtime/channel_spec.rb#L39)
138
- * [ignores subsequent #attach calls but calls the success callback if provided](./spec/acceptance/realtime/channel_spec.rb#L49)
139
- * [attaches to a channel](./spec/acceptance/realtime/channel_spec.rb#L62)
140
- * [attaches to a channel and calls the provided block](./spec/acceptance/realtime/channel_spec.rb#L70)
141
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_spec.rb#L77)
142
- * [calls the SafeDeferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L82)
178
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_spec.rb#L139)
179
+ * [calls the SafeDeferrable callback on success (#RTL4d)](./spec/acceptance/realtime/channel_spec.rb#L144)
180
+ * when initialized
181
+ * [emits attaching then attached events](./spec/acceptance/realtime/channel_spec.rb#L45)
182
+ * [ignores subsequent #attach calls but calls the success callback if provided](./spec/acceptance/realtime/channel_spec.rb#L55)
183
+ * [attaches to a channel](./spec/acceptance/realtime/channel_spec.rb#L68)
184
+ * [attaches to a channel and calls the provided block (#RTL4d)](./spec/acceptance/realtime/channel_spec.rb#L76)
185
+ * [sends an ATTACH and waits for an ATTACHED (#RTL4c)](./spec/acceptance/realtime/channel_spec.rb#L83)
186
+ * [implicitly attaches the channel (#RTL7c)](./spec/acceptance/realtime/channel_spec.rb#L107)
187
+ * when the implicit channel attach fails
188
+ * [registers the listener anyway (#RTL7c)](./spec/acceptance/realtime/channel_spec.rb#L124)
189
+ * when an ATTACHED acknowledge is not received on the current connection
190
+ * [sends another ATTACH each time the connection becomes connected](./spec/acceptance/realtime/channel_spec.rb#L155)
191
+ * when state is :attached
192
+ * [does nothing (#RTL4a)](./spec/acceptance/realtime/channel_spec.rb#L193)
143
193
  * when state is :failed
144
- * [reattaches](./spec/acceptance/realtime/channel_spec.rb#L93)
194
+ * [reattaches and sets the errorReason to nil (#RTL4g)](./spec/acceptance/realtime/channel_spec.rb#L213)
145
195
  * when state is :detaching
146
- * [moves straight to attaching and skips detached](./spec/acceptance/realtime/channel_spec.rb#L106)
196
+ * [does the attach operation after the completion of the pending request (#RTL4h)](./spec/acceptance/realtime/channel_spec.rb#L228)
147
197
  * with many connections and many channels on each simultaneously
148
- * [attaches all channels](./spec/acceptance/realtime/channel_spec.rb#L132)
198
+ * [attaches all channels](./spec/acceptance/realtime/channel_spec.rb#L256)
149
199
  * failure as a result of insufficient key permissions
150
- * [emits failed event](./spec/acceptance/realtime/channel_spec.rb#L155)
151
- * [calls the errback of the returned Deferrable](./spec/acceptance/realtime/channel_spec.rb#L164)
152
- * [emits an error event](./spec/acceptance/realtime/channel_spec.rb#L172)
153
- * [updates the error_reason](./spec/acceptance/realtime/channel_spec.rb#L181)
200
+ * [emits failed event (#RTL4e)](./spec/acceptance/realtime/channel_spec.rb#L288)
201
+ * [calls the errback of the returned Deferrable (#RTL4d)](./spec/acceptance/realtime/channel_spec.rb#L297)
202
+ * [updates the error_reason](./spec/acceptance/realtime/channel_spec.rb#L305)
154
203
  * and subsequent authorisation with suitable permissions
155
- * [attaches to the channel successfully and resets the channel error_reason](./spec/acceptance/realtime/channel_spec.rb#L190)
204
+ * [attaches to the channel successfully and resets the channel error_reason](./spec/acceptance/realtime/channel_spec.rb#L314)
205
+ * with connection state
206
+ * [is initialized (#RTL4i)](./spec/acceptance/realtime/channel_spec.rb#L333)
207
+ * [is connecting (#RTL4i)](./spec/acceptance/realtime/channel_spec.rb#L340)
208
+ * [is disconnected (#RTL4i)](./spec/acceptance/realtime/channel_spec.rb#L348)
156
209
  * #detach
157
- * [detaches from a channel](./spec/acceptance/realtime/channel_spec.rb#L212)
158
- * [detaches from a channel and calls the provided block](./spec/acceptance/realtime/channel_spec.rb#L222)
159
- * [emits :detaching then :detached events](./spec/acceptance/realtime/channel_spec.rb#L232)
160
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_spec.rb#L244)
161
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L251)
210
+ * when state is :attached
211
+ * [it detaches from a channel (#RTL5d)](./spec/acceptance/realtime/channel_spec.rb#L363)
212
+ * [detaches from a channel and calls the provided block (#RTL5d, #RTL5e)](./spec/acceptance/realtime/channel_spec.rb#L373)
213
+ * [emits :detaching then :detached events](./spec/acceptance/realtime/channel_spec.rb#L383)
214
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_spec.rb#L395)
215
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L402)
216
+ * and DETACHED message is not received within realtime request timeout
217
+ * [fails the deferrable and returns to the previous state (#RTL5f, #RTL5e)](./spec/acceptance/realtime/channel_spec.rb#L416)
162
218
  * when state is :failed
163
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L264)
219
+ * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L436)
164
220
  * when state is :attaching
165
- * [moves straight to :detaching state and skips :attached](./spec/acceptance/realtime/channel_spec.rb#L275)
221
+ * [waits for the attach to complete and then moves to detached](./spec/acceptance/realtime/channel_spec.rb#L449)
166
222
  * when state is :detaching
167
- * [ignores subsequent #detach calls but calls the callback if provided](./spec/acceptance/realtime/channel_spec.rb#L293)
223
+ * [ignores subsequent #detach calls but calls the callback if provided (#RTL5i)](./spec/acceptance/realtime/channel_spec.rb#L466)
224
+ * when state is :suspended
225
+ * [moves the channel state immediately to DETACHED state (#RTL5j)](./spec/acceptance/realtime/channel_spec.rb#L483)
168
226
  * when state is :initialized
169
- * [does nothing as there is no channel to detach](./spec/acceptance/realtime/channel_spec.rb#L310)
170
- * [returns a valid deferrable](./spec/acceptance/realtime/channel_spec.rb#L318)
171
- * channel recovery in :attaching state
172
- * the transport is disconnected before the ATTACHED protocol message is received
173
- * PENDING: *[attach times out and fails if not ATTACHED protocol message received](./spec/acceptance/realtime/channel_spec.rb#L330)*
174
- * PENDING: *[channel is ATTACHED if ATTACHED protocol message is later received](./spec/acceptance/realtime/channel_spec.rb#L331)*
175
- * PENDING: *[sends an ATTACH protocol message in response to a channel message being received on the attaching channel](./spec/acceptance/realtime/channel_spec.rb#L332)*
227
+ * [does nothing as there is no channel to detach (#RTL5a)](./spec/acceptance/realtime/channel_spec.rb#L503)
228
+ * [returns a valid deferrable](./spec/acceptance/realtime/channel_spec.rb#L511)
229
+ * when state is :detached
230
+ * [does nothing as the channel is detached (#RTL5a)](./spec/acceptance/realtime/channel_spec.rb#L521)
231
+ * when connection state is
232
+ * closing
233
+ * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L538)
234
+ * failed and channel is failed
235
+ * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L558)
236
+ * failed and channel is detached
237
+ * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L580)
238
+ * initialized
239
+ * [does the detach operation once the connection state is connected (#RTL5h)](./spec/acceptance/realtime/channel_spec.rb#L600)
240
+ * connecting
241
+ * [does the detach operation once the connection state is connected (#RTL5h)](./spec/acceptance/realtime/channel_spec.rb#L615)
242
+ * disconnected
243
+ * [does the detach operation once the connection state is connected (#RTL5h)](./spec/acceptance/realtime/channel_spec.rb#L634)
244
+ * automatic channel recovery
245
+ * when an ATTACH request times out
246
+ * [moves to the SUSPENDED state (#RTL4f)](./spec/acceptance/realtime/channel_spec.rb#L661)
247
+ * if a subsequent ATTACHED is received on an ATTACHED channel
248
+ * [ignores the additional ATTACHED if resumed is true (#RTL12)](./spec/acceptance/realtime/channel_spec.rb#L675)
249
+ * [emits an UPDATE only when resumed is true (#RTL12)](./spec/acceptance/realtime/channel_spec.rb#L689)
250
+ * [emits an UPDATE when resumed is true and includes the reason error from the ProtocolMessage (#RTL12)](./spec/acceptance/realtime/channel_spec.rb#L705)
176
251
  * #publish
177
252
  * when attached
178
- * [publishes messages](./spec/acceptance/realtime/channel_spec.rb#L341)
253
+ * [publishes messages](./spec/acceptance/realtime/channel_spec.rb#L730)
179
254
  * when not yet attached
180
- * [publishes queued messages once attached](./spec/acceptance/realtime/channel_spec.rb#L353)
181
- * [publishes queued messages within a single protocol message](./spec/acceptance/realtime/channel_spec.rb#L361)
255
+ * [publishes queued messages once attached](./spec/acceptance/realtime/channel_spec.rb#L742)
256
+ * [publishes queued messages within a single protocol message](./spec/acceptance/realtime/channel_spec.rb#L750)
182
257
  * with :queue_messages client option set to false
183
258
  * and connection state initialized
184
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L384)
259
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L773)
185
260
  * and connection state connecting
186
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L392)
261
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L783)
187
262
  * and connection state disconnected
188
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L404)
263
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L797)
189
264
  * and connection state connected
190
- * [publishes the message](./spec/acceptance/realtime/channel_spec.rb#L417)
265
+ * [publishes the message](./spec/acceptance/realtime/channel_spec.rb#L812)
191
266
  * with name and data arguments
192
- * [publishes the message and return true indicating success](./spec/acceptance/realtime/channel_spec.rb#L428)
267
+ * [publishes the message and return true indicating success](./spec/acceptance/realtime/channel_spec.rb#L823)
193
268
  * and additional attributes
194
- * [publishes the message with the attributes and return true indicating success](./spec/acceptance/realtime/channel_spec.rb#L441)
269
+ * [publishes the message with the attributes and return true indicating success](./spec/acceptance/realtime/channel_spec.rb#L836)
270
+ * and additional invalid attributes
271
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L849)
195
272
  * with an array of Hash objects with :name and :data attributes
196
- * [publishes an array of messages in one ProtocolMessage](./spec/acceptance/realtime/channel_spec.rb#L459)
273
+ * [publishes an array of messages in one ProtocolMessage](./spec/acceptance/realtime/channel_spec.rb#L863)
197
274
  * with an array of Message objects
198
- * [publishes an array of messages in one ProtocolMessage](./spec/acceptance/realtime/channel_spec.rb#L487)
275
+ * [publishes an array of messages in one ProtocolMessage](./spec/acceptance/realtime/channel_spec.rb#L891)
199
276
  * nil attributes
200
277
  * when name is nil
201
- * [publishes the message without a name attribute in the payload](./spec/acceptance/realtime/channel_spec.rb#L511)
278
+ * [publishes the message without a name attribute in the payload](./spec/acceptance/realtime/channel_spec.rb#L915)
202
279
  * when data is nil
203
- * [publishes the message without a data attribute in the payload](./spec/acceptance/realtime/channel_spec.rb#L534)
280
+ * [publishes the message without a data attribute in the payload](./spec/acceptance/realtime/channel_spec.rb#L938)
204
281
  * with neither name or data attributes
205
- * [publishes the message without any attributes in the payload](./spec/acceptance/realtime/channel_spec.rb#L557)
282
+ * [publishes the message without any attributes in the payload](./spec/acceptance/realtime/channel_spec.rb#L961)
206
283
  * with two invalid message out of 12
207
284
  * before client_id is known (validated)
208
- * [calls the errback once](./spec/acceptance/realtime/channel_spec.rb#L581)
285
+ * [calls the errback once](./spec/acceptance/realtime/channel_spec.rb#L985)
209
286
  * when client_id is known (validated)
210
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L601)
287
+ * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L1005)
211
288
  * only invalid messages
212
289
  * before client_id is known (validated)
213
- * [calls the errback once](./spec/acceptance/realtime/channel_spec.rb#L620)
290
+ * [calls the errback once](./spec/acceptance/realtime/channel_spec.rb#L1024)
214
291
  * when client_id is known (validated)
215
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L639)
292
+ * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L1043)
216
293
  * with many many messages and many connections simultaneously
217
- * [publishes all messages, all success callbacks are called, and a history request confirms all messages were published](./spec/acceptance/realtime/channel_spec.rb#L653)
294
+ * [publishes all messages, all success callbacks are called, and a history request confirms all messages were published](./spec/acceptance/realtime/channel_spec.rb#L1057)
218
295
  * identified clients
219
296
  * when authenticated with a wildcard client_id
220
297
  * with a valid client_id in the message
221
- * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L681)
298
+ * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1085)
222
299
  * with a wildcard client_id in the message
223
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L693)
300
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1097)
301
+ * with a non-String client_id in the message
302
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1104)
224
303
  * with an empty client_id in the message
225
- * [succeeds and publishes without a client_id](./spec/acceptance/realtime/channel_spec.rb#L700)
304
+ * [succeeds and publishes without a client_id](./spec/acceptance/realtime/channel_spec.rb#L1111)
226
305
  * when authenticated with a Token string with an implicit client_id
227
306
  * before the client is CONNECTED and the client's identity has been obtained
228
307
  * with a valid client_id in the message
229
- * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L720)
308
+ * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1131)
230
309
  * with an invalid client_id in the message
231
- * [succeeds in the client library but then fails when delivered to Ably](./spec/acceptance/realtime/channel_spec.rb#L733)
310
+ * [succeeds in the client library but then fails when delivered to Ably](./spec/acceptance/realtime/channel_spec.rb#L1144)
232
311
  * with an empty client_id in the message
233
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L744)
312
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1155)
234
313
  * after the client is CONNECTED and the client's identity is known
235
314
  * with a valid client_id in the message
236
- * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L758)
315
+ * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1169)
237
316
  * with an invalid client_id in the message
238
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L772)
317
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1183)
239
318
  * with an empty client_id in the message
240
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L781)
319
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1192)
241
320
  * when authenticated with a valid client_id
242
321
  * with a valid client_id
243
- * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L803)
322
+ * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1214)
244
323
  * with a wildcard client_id in the message
245
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L815)
324
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1226)
246
325
  * with an invalid client_id in the message
247
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L822)
326
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1233)
248
327
  * with an empty client_id in the message
249
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L829)
328
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1240)
250
329
  * when anonymous and no client_id
251
330
  * with a client_id in the message
252
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L848)
331
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1259)
253
332
  * with a wildcard client_id in the message
254
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L855)
333
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1266)
255
334
  * with an empty client_id in the message
256
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L862)
335
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1273)
257
336
  * #subscribe
258
337
  * with an event argument
259
- * [subscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L878)
338
+ * [subscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L1289)
260
339
  * before attach
261
- * [receives messages as soon as attached](./spec/acceptance/realtime/channel_spec.rb#L888)
340
+ * [receives messages as soon as attached](./spec/acceptance/realtime/channel_spec.rb#L1299)
262
341
  * with no event argument
263
- * [subscribes for all events](./spec/acceptance/realtime/channel_spec.rb#L902)
342
+ * [subscribes for all events](./spec/acceptance/realtime/channel_spec.rb#L1313)
343
+ * with a callback that raises an exception
344
+ * [logs the error and continues](./spec/acceptance/realtime/channel_spec.rb#L1325)
264
345
  * many times with different event names
265
- * [filters events accordingly to each callback](./spec/acceptance/realtime/channel_spec.rb#L912)
346
+ * [filters events accordingly to each callback](./spec/acceptance/realtime/channel_spec.rb#L1344)
266
347
  * #unsubscribe
267
348
  * with an event argument
268
- * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L935)
349
+ * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L1367)
269
350
  * with no event argument
270
- * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L948)
351
+ * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L1380)
271
352
  * when connection state changes to
272
353
  * :failed
354
+ * an :attaching channel
355
+ * [transitions state to :failed (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1403)
273
356
  * an :attached channel
274
- * [transitions state to :failed](./spec/acceptance/realtime/channel_spec.rb#L971)
275
- * [emits an error event on the channel](./spec/acceptance/realtime/channel_spec.rb#L983)
276
- * [updates the channel error_reason](./spec/acceptance/realtime/channel_spec.rb#L994)
357
+ * [transitions state to :failed (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1420)
358
+ * [updates the channel error_reason (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1432)
277
359
  * a :detached channel
278
- * [remains in the :detached state](./spec/acceptance/realtime/channel_spec.rb#L1008)
360
+ * [remains in the :detached state (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1446)
279
361
  * a :failed channel
280
- * [remains in the :failed state and ignores the failure error](./spec/acceptance/realtime/channel_spec.rb#L1028)
362
+ * [remains in the :failed state and ignores the failure error (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1465)
281
363
  * a channel ATTACH request
282
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L1049)
364
+ * [fails the deferrable (#RTL4b)](./spec/acceptance/realtime/channel_spec.rb#L1485)
283
365
  * :closed
284
366
  * an :attached channel
285
- * [transitions state to :detached](./spec/acceptance/realtime/channel_spec.rb#L1063)
367
+ * [transitions state to :detached (#RTL3b)](./spec/acceptance/realtime/channel_spec.rb#L1501)
368
+ * an :attaching channel (#RTL3b)
369
+ * [transitions state to :detached](./spec/acceptance/realtime/channel_spec.rb#L1512)
286
370
  * a :detached channel
287
- * [remains in the :detached state](./spec/acceptance/realtime/channel_spec.rb#L1074)
371
+ * [remains in the :detached state (#RTL3b)](./spec/acceptance/realtime/channel_spec.rb#L1527)
288
372
  * a :failed channel
289
- * [remains in the :failed state and retains the error_reason](./spec/acceptance/realtime/channel_spec.rb#L1095)
373
+ * [remains in the :failed state and retains the error_reason (#RTL3b)](./spec/acceptance/realtime/channel_spec.rb#L1547)
290
374
  * a channel ATTACH request when connection CLOSED
291
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L1116)
375
+ * [fails the deferrable (#RTL4b)](./spec/acceptance/realtime/channel_spec.rb#L1567)
292
376
  * a channel ATTACH request when connection CLOSING
293
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L1128)
377
+ * [fails the deferrable (#RTL4b)](./spec/acceptance/realtime/channel_spec.rb#L1581)
294
378
  * :suspended
379
+ * an :attaching channel
380
+ * [transitions state to :suspended (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1597)
295
381
  * an :attached channel
296
- * [transitions state to :detached](./spec/acceptance/realtime/channel_spec.rb#L1144)
382
+ * [transitions state to :suspended (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1611)
383
+ * [transitions state automatically to :attaching once the connection is re-established (#RTN15c3)](./spec/acceptance/realtime/channel_spec.rb#L1620)
297
384
  * a :detached channel
298
- * [remains in the :detached state](./spec/acceptance/realtime/channel_spec.rb#L1155)
385
+ * [remains in the :detached state (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1634)
299
386
  * a :failed channel
300
- * [remains in the :failed state and retains the error_reason](./spec/acceptance/realtime/channel_spec.rb#L1176)
301
- * a channel ATTACH request when connection SUSPENDED
302
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L1199)
387
+ * [remains in the :failed state and retains the error_reason (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1654)
388
+ * a channel ATTACH request when connection SUSPENDED (#RTL4b)
389
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L1676)
390
+ * :connected
391
+ * a :suspended channel
392
+ * [is automatically reattached (#RTL3d)](./spec/acceptance/realtime/channel_spec.rb#L1692)
393
+ * when re-attach attempt fails
394
+ * [returns to a suspended state (#RTL3d)](./spec/acceptance/realtime/channel_spec.rb#L1709)
395
+ * :disconnected
396
+ * with an initialized channel
397
+ * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1735)
398
+ * with an attaching channel
399
+ * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1748)
400
+ * with an attached channel
401
+ * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1763)
402
+ * with a detached channel
403
+ * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1775)
404
+ * with a failed channel
405
+ * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1797)
303
406
  * #presence
304
- * [returns a Ably::Realtime::Presence object](./spec/acceptance/realtime/channel_spec.rb#L1213)
407
+ * [returns a Ably::Realtime::Presence object](./spec/acceptance/realtime/channel_spec.rb#L1812)
305
408
  * channel state change
306
- * [emits a ChannelStateChange object](./spec/acceptance/realtime/channel_spec.rb#L1220)
409
+ * [emits a ChannelStateChange object](./spec/acceptance/realtime/channel_spec.rb#L1819)
307
410
  * ChannelStateChange object
308
- * [has current state](./spec/acceptance/realtime/channel_spec.rb#L1229)
309
- * [has a previous state](./spec/acceptance/realtime/channel_spec.rb#L1237)
310
- * [has an empty reason when there is no error](./spec/acceptance/realtime/channel_spec.rb#L1254)
411
+ * [has current state](./spec/acceptance/realtime/channel_spec.rb#L1828)
412
+ * [has a previous state](./spec/acceptance/realtime/channel_spec.rb#L1837)
413
+ * [has the event that generated the state change (#TA5)](./spec/acceptance/realtime/channel_spec.rb#L1846)
414
+ * [has an empty reason when there is no error](./spec/acceptance/realtime/channel_spec.rb#L1864)
311
415
  * on failure
312
- * [has a reason Error object when there is an error on the channel](./spec/acceptance/realtime/channel_spec.rb#L1267)
416
+ * [has a reason Error object when there is an error on the channel](./spec/acceptance/realtime/channel_spec.rb#L1877)
417
+ * #resume (#RTL2f)
418
+ * [is false when a channel first attaches](./spec/acceptance/realtime/channel_spec.rb#L1890)
419
+ * PENDING: *[is true when a connection is recovered and the channel is attached](./spec/acceptance/realtime/channel_spec.rb#L1898)*
420
+ * [is false when a connection fails to recover and the channel is attached](./spec/acceptance/realtime/channel_spec.rb#L1919)
421
+ * when a resume fails
422
+ * [is false when a resume fails to recover and the channel is automatically re-attached](./spec/acceptance/realtime/channel_spec.rb#L1941)
423
+ * moves to
424
+ * suspended
425
+ * [all queued messages fail with NACK (#RTL11)](./spec/acceptance/realtime/channel_spec.rb#L1960)
426
+ * [all published messages awaiting an ACK do nothing (#RTL11a)](./spec/acceptance/realtime/channel_spec.rb#L1983)
427
+ * detached
428
+ * [all queued messages fail with NACK (#RTL11)](./spec/acceptance/realtime/channel_spec.rb#L1960)
429
+ * [all published messages awaiting an ACK do nothing (#RTL11a)](./spec/acceptance/realtime/channel_spec.rb#L1983)
430
+ * failed
431
+ * [all queued messages fail with NACK (#RTL11)](./spec/acceptance/realtime/channel_spec.rb#L1960)
432
+ * [all published messages awaiting an ACK do nothing (#RTL11a)](./spec/acceptance/realtime/channel_spec.rb#L1983)
433
+ * when it receives a server-initiated DETACHED (#RTL13)
434
+ * and channel is initialized (#RTL13)
435
+ * [does nothing](./spec/acceptance/realtime/channel_spec.rb#L2017)
436
+ * and channel is failed
437
+ * [does nothing (#RTL13)](./spec/acceptance/realtime/channel_spec.rb#L2038)
438
+ * and channel is attached
439
+ * [reattaches immediately (#RTL13a)](./spec/acceptance/realtime/channel_spec.rb#L2054)
440
+ * and channel is suspended
441
+ * [reattaches immediately (#RTL13a)](./spec/acceptance/realtime/channel_spec.rb#L2070)
442
+ * and channel is attaching
443
+ * [will move to the SUSPENDED state and then attempt to ATTACH with the ATTACHING state (#RTL13b)](./spec/acceptance/realtime/channel_spec.rb#L2092)
444
+ * when it receives an ERROR ProtocolMessage
445
+ * [should transition to the failed state and the error_reason should be set (#RTL14)](./spec/acceptance/realtime/channel_spec.rb#L2140)
313
446
 
314
447
  ### Ably::Realtime::Channels
315
448
  _(see [spec/acceptance/realtime/channels_spec.rb](./spec/acceptance/realtime/channels_spec.rb))_
@@ -345,14 +478,14 @@ _(see [spec/acceptance/realtime/client_spec.rb](./spec/acceptance/realtime/clien
345
478
  * and a pre-generated Token provided with the :token option
346
479
  * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L52)
347
480
  * with valid :key and :use_token_auth option set to true
348
- * [automatically authorises on connect and generates a token](./spec/acceptance/realtime/client_spec.rb#L65)
481
+ * [automatically authorizes on connect and generates a token](./spec/acceptance/realtime/client_spec.rb#L65)
349
482
  * with client_id
350
483
  * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L78)
351
484
  * with TLS disabled
352
485
  * and a pre-generated Token provided with the :token option
353
486
  * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L52)
354
487
  * with valid :key and :use_token_auth option set to true
355
- * [automatically authorises on connect and generates a token](./spec/acceptance/realtime/client_spec.rb#L65)
488
+ * [automatically authorizes on connect and generates a token](./spec/acceptance/realtime/client_spec.rb#L65)
356
489
  * with client_id
357
490
  * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L78)
358
491
  * with a Proc for the :auth_callback option
@@ -381,6 +514,13 @@ _(see [spec/acceptance/realtime/client_spec.rb](./spec/acceptance/realtime/clien
381
514
  * [provides access to the Channels collection object](./spec/acceptance/realtime/client_spec.rb#L220)
382
515
  * #auth
383
516
  * [provides access to the Realtime::Auth object](./spec/acceptance/realtime/client_spec.rb#L227)
517
+ * #request (#RSC19*)
518
+ * get
519
+ * [returns an HttpPaginatedResponse object](./spec/acceptance/realtime/client_spec.rb#L237)
520
+ * 404 request to invalid URL
521
+ * [returns an object with 404 status code and error message](./spec/acceptance/realtime/client_spec.rb#L246)
522
+ * paged results
523
+ * [provides paging](./spec/acceptance/realtime/client_spec.rb#L260)
384
524
 
385
525
  ### Ably::Realtime::Connection failures
386
526
  _(see [spec/acceptance/realtime/connection_failures_spec.rb](./spec/acceptance/realtime/connection_failures_spec.rb))_
@@ -388,68 +528,121 @@ _(see [spec/acceptance/realtime/connection_failures_spec.rb](./spec/acceptance/r
388
528
  * authentication failure
389
529
  * when API key is invalid
390
530
  * with invalid app part of the key
391
- * [enters the failed state and returns a not found error](./spec/acceptance/realtime/connection_failures_spec.rb#L26)
531
+ * [enters the failed state and returns a not found error](./spec/acceptance/realtime/connection_failures_spec.rb#L29)
392
532
  * with invalid key name part of the key
393
- * [enters the failed state and returns an authorization error](./spec/acceptance/realtime/connection_failures_spec.rb#L41)
533
+ * [enters the failed state and returns an authorization error](./spec/acceptance/realtime/connection_failures_spec.rb#L44)
534
+ * with auth_url
535
+ * opening a new connection
536
+ * request fails due to network failure
537
+ * [the connection moves to the disconnected state and tries again, returning again to the disconnected state (#RSA4c, #RSA4c1, #RSA4c2)](./spec/acceptance/realtime/connection_failures_spec.rb#L62)
538
+ * request fails due to invalid content
539
+ * [the connection moves to the disconnected state and tries again, returning again to the disconnected state (#RSA4c, #RSA4c1, #RSA4c2)](./spec/acceptance/realtime/connection_failures_spec.rb#L92)
540
+ * existing CONNECTED connection
541
+ * authorize request failure leaves connection in existing condition
542
+ * [the connection remains in the CONNECTED state and authorize fails (#RSA4c, #RSA4c1, #RSA4c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L120)
543
+ * with auth_callback
544
+ * opening a new connection
545
+ * when callback fails due to an exception
546
+ * [the connection moves to the disconnected state and tries again, returning again to the disconnected state (#RSA4c, #RSA4c1, #RSA4c2)](./spec/acceptance/realtime/connection_failures_spec.rb#L148)
547
+ * existing CONNECTED connection
548
+ * when callback fails due to the request taking longer than realtime_request_timeout
549
+ * [the authorization request fails as configured in the realtime_request_timeout (#RSA4c, #RSA4c1, #RSA4c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L179)
394
550
  * automatic connection retry
395
551
  * with invalid WebSocket host
396
552
  * when disconnected
397
- * [enters the suspended state after multiple attempts to connect](./spec/acceptance/realtime/connection_failures_spec.rb#L95)
553
+ * [enters the suspended state after multiple attempts to connect](./spec/acceptance/realtime/connection_failures_spec.rb#L244)
398
554
  * for the first time
399
- * [reattempts connection immediately and then waits disconnected_retry_timeout for a subsequent attempt](./spec/acceptance/realtime/connection_failures_spec.rb#L116)
555
+ * [reattempts connection immediately and then waits disconnected_retry_timeout for a subsequent attempt](./spec/acceptance/realtime/connection_failures_spec.rb#L265)
400
556
  * #close
401
- * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L133)
557
+ * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L282)
402
558
  * when connection state is :suspended
403
- * [stays in the suspended state after any number of reconnection attempts](./spec/acceptance/realtime/connection_failures_spec.rb#L152)
559
+ * [stays in the suspended state after any number of reconnection attempts](./spec/acceptance/realtime/connection_failures_spec.rb#L301)
404
560
  * for the first time
405
- * [waits suspended_retry_timeout before attempting to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L175)
561
+ * [waits suspended_retry_timeout before attempting to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L324)
406
562
  * #close
407
- * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L197)
563
+ * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L346)
408
564
  * when connection state is :failed
409
565
  * #close
410
- * [will not transition state to :close and raises a InvalidStateChange exception](./spec/acceptance/realtime/connection_failures_spec.rb#L216)
566
+ * [will not transition state to :close and fails with an InvalidStateChange exception](./spec/acceptance/realtime/connection_failures_spec.rb#L365)
411
567
  * #error_reason
412
- * [contains the error when state is disconnected](./spec/acceptance/realtime/connection_failures_spec.rb#L234)
413
- * [contains the error when state is suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L234)
414
- * [contains the error when state is failed](./spec/acceptance/realtime/connection_failures_spec.rb#L234)
415
- * [is reset to nil when :connected](./spec/acceptance/realtime/connection_failures_spec.rb#L248)
416
- * [is reset to nil when :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L259)
568
+ * [contains the error when state is disconnected](./spec/acceptance/realtime/connection_failures_spec.rb#L386)
569
+ * [contains the error when state is suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L386)
570
+ * [contains the error when state is failed](./spec/acceptance/realtime/connection_failures_spec.rb#L386)
571
+ * [is reset to nil when :connected](./spec/acceptance/realtime/connection_failures_spec.rb#L400)
572
+ * [is reset to nil when :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L411)
417
573
  * #connect
418
574
  * connection opening times out
419
- * [attempts to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L290)
575
+ * [attempts to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L442)
420
576
  * when retry intervals are stubbed to attempt reconnection quickly
421
- * [never calls the provided success block](./spec/acceptance/realtime/connection_failures_spec.rb#L314)
577
+ * [never calls the provided success block](./spec/acceptance/realtime/connection_failures_spec.rb#L466)
422
578
  * connection resume
423
579
  * when DISCONNECTED ProtocolMessage received from the server
424
- * [reconnects automatically and immediately](./spec/acceptance/realtime/connection_failures_spec.rb#L345)
580
+ * [reconnects automatically and immediately](./spec/acceptance/realtime/connection_failures_spec.rb#L497)
425
581
  * and subsequently fails to reconnect
426
- * [retries every 15 seconds](./spec/acceptance/realtime/connection_failures_spec.rb#L377)
427
- * when websocket transport is closed
428
- * [reconnects automatically](./spec/acceptance/realtime/connection_failures_spec.rb#L420)
582
+ * [retries every 15 seconds](./spec/acceptance/realtime/connection_failures_spec.rb#L529)
583
+ * when websocket transport is abruptly disconnected
584
+ * [reconnects automatically](./spec/acceptance/realtime/connection_failures_spec.rb#L572)
585
+ * hosts used
586
+ * [reconnects with the default host](./spec/acceptance/realtime/connection_failures_spec.rb#L588)
429
587
  * after successfully reconnecting and resuming
430
- * [retains connection_id and updates the connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L437)
431
- * [emits any error received from Ably but leaves the channels attached](./spec/acceptance/realtime/connection_failures_spec.rb#L452)
432
- * [retains channel subscription state](./spec/acceptance/realtime/connection_failures_spec.rb#L483)
588
+ * [retains connection_id and updates the connection_key (#RTN15e, #RTN16d)](./spec/acceptance/realtime/connection_failures_spec.rb#L612)
589
+ * [includes the error received in the connection state change from Ably but leaves the channels attached](./spec/acceptance/realtime/connection_failures_spec.rb#L627)
590
+ * [retains channel subscription state](./spec/acceptance/realtime/connection_failures_spec.rb#L653)
591
+ * [retains the client_serial (#RTN15c2, #RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L714)
433
592
  * when messages were published whilst the client was disconnected
434
- * [receives the messages published whilst offline](./spec/acceptance/realtime/connection_failures_spec.rb#L511)
593
+ * [receives the messages published whilst offline](./spec/acceptance/realtime/connection_failures_spec.rb#L681)
435
594
  * when failing to resume
436
595
  * because the connection_key is not or no longer valid
437
- * [updates the connection_id and connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L554)
438
- * [detaches all channels](./spec/acceptance/realtime/connection_failures_spec.rb#L569)
439
- * [emits an error on the channel and sets the error reason](./spec/acceptance/realtime/connection_failures_spec.rb#L589)
596
+ * [updates the connection_id and connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L754)
597
+ * [issue a reattach for all attached channels and fail all message awaiting an ACK (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L769)
598
+ * [issue a reattach for all attaching channels and fail all queued messages (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L807)
599
+ * [issue a attach for all suspended channels (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L843)
600
+ * [sets the error reason on each channel](./spec/acceptance/realtime/connection_failures_spec.rb#L881)
601
+ * [resets the client_serial (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L896)
602
+ * as the DISCONNECTED window to resume has passed
603
+ * [starts a new connection automatically and does not try and resume](./spec/acceptance/realtime/connection_failures_spec.rb#L933)
604
+ * when an ERROR protocol message is received
605
+ * whilst connecting
606
+ * with a token error code in the range 40140 <= code < 40150 (#RTN14b)
607
+ * [triggers a re-authentication](./spec/acceptance/realtime/connection_failures_spec.rb#L960)
608
+ * with an error code indicating an error other than a token failure (#RTN14g, #RTN15i)
609
+ * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L976)
610
+ * with no error code indicating an error other than a token failure (#RTN14g, #RTN15i)
611
+ * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L989)
612
+ * whilst connected
613
+ * with a token error code in the range 40140 <= code < 40150 (#RTN14b)
614
+ * [triggers a re-authentication](./spec/acceptance/realtime/connection_failures_spec.rb#L960)
615
+ * with an error code indicating an error other than a token failure (#RTN14g, #RTN15i)
616
+ * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L976)
617
+ * with no error code indicating an error other than a token failure (#RTN14g, #RTN15i)
618
+ * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L989)
619
+ * whilst resuming
620
+ * with a token error code in the region 40140 <= code < 40150 (RTN15c5)
621
+ * [triggers a re-authentication and then resumes the connection](./spec/acceptance/realtime/connection_failures_spec.rb#L1033)
622
+ * with any other error (#RTN15c4)
623
+ * [moves the connection to the failed state](./spec/acceptance/realtime/connection_failures_spec.rb#L1065)
440
624
  * fallback host feature
441
625
  * with custom realtime websocket host option
442
- * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L629)
626
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L1109)
443
627
  * with custom realtime websocket port option
444
- * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L647)
628
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L1127)
445
629
  * with non-production environment
446
- * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L666)
630
+ * [does not use a fallback host by default](./spec/acceptance/realtime/connection_failures_spec.rb#L1146)
631
+ * :fallback_hosts_use_default is true
632
+ * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k7)](./spec/acceptance/realtime/connection_failures_spec.rb#L1164)
633
+ * :fallback_hosts array is provided
634
+ * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6)](./spec/acceptance/realtime/connection_failures_spec.rb#L1189)
447
635
  * with production environment
448
636
  * when the Internet is down
449
- * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L696)
637
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L1225)
450
638
  * when the Internet is up
451
- * [uses a fallback host on every subsequent disconnected attempt until suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L716)
452
- * [uses the primary host when suspended, and a fallback host on every subsequent suspended attempt](./spec/acceptance/realtime/connection_failures_spec.rb#L735)
639
+ * and default options
640
+ * [uses a fallback host + the original host once on every subsequent disconnected attempt until suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L1248)
641
+ * [uses the primary host when suspended, and then every fallback host and the primary host again on every subsequent suspended attempt](./spec/acceptance/realtime/connection_failures_spec.rb#L1267)
642
+ * :fallback_hosts array is provided by an empty array
643
+ * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6)](./spec/acceptance/realtime/connection_failures_spec.rb#L1297)
644
+ * :fallback_hosts array is provided
645
+ * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6)](./spec/acceptance/realtime/connection_failures_spec.rb#L1317)
453
646
 
454
647
  ### Ably::Realtime::Connection
455
648
  _(see [spec/acceptance/realtime/connection_spec.rb](./spec/acceptance/realtime/connection_spec.rb))_
@@ -462,165 +655,203 @@ _(see [spec/acceptance/realtime/connection_spec.rb](./spec/acceptance/realtime/c
462
655
  * with token auth
463
656
  * for renewable tokens
464
657
  * that are valid for the duration of the test
465
- * with valid pre authorised token expiring in the future
466
- * [uses the existing token created by Auth](./spec/acceptance/realtime/connection_spec.rb#L64)
658
+ * with valid pre authorized token expiring in the future
659
+ * [uses the existing token created by Auth](./spec/acceptance/realtime/connection_spec.rb#L65)
467
660
  * with implicit authorisation
468
- * [uses the token created by the implicit authorisation](./spec/acceptance/realtime/connection_spec.rb#L76)
661
+ * [uses the token created by the implicit authorisation](./spec/acceptance/realtime/connection_spec.rb#L77)
469
662
  * that expire
470
663
  * opening a new connection
471
664
  * with almost expired tokens
472
- * [renews token every time after it expires](./spec/acceptance/realtime/connection_spec.rb#L110)
665
+ * [renews token every time after it expires](./spec/acceptance/realtime/connection_spec.rb#L111)
473
666
  * with immediately expired token
474
- * [renews the token on connect, and makes one immediate subsequent attempt to obtain a new token](./spec/acceptance/realtime/connection_spec.rb#L140)
667
+ * [renews the token on connect, and makes one immediate subsequent attempt to obtain a new token (#RSA4b)](./spec/acceptance/realtime/connection_spec.rb#L141)
475
668
  * when disconnected_retry_timeout is 0.5 seconds
476
- * [renews the token on connect, and continues to attempt renew based on the retry schedule](./spec/acceptance/realtime/connection_spec.rb#L155)
669
+ * [renews the token on connect, and continues to attempt renew based on the retry schedule](./spec/acceptance/realtime/connection_spec.rb#L156)
477
670
  * using implicit token auth
478
- * [uses the primary host for subsequent connection and auth requests](./spec/acceptance/realtime/connection_spec.rb#L177)
671
+ * [uses the primary host for subsequent connection and auth requests](./spec/acceptance/realtime/connection_spec.rb#L186)
479
672
  * when connected with a valid non-expired token
480
673
  * that then expires following the connection being opened
481
674
  * the server
482
- * [disconnects the client, and the client automatically renews the token and then reconnects](./spec/acceptance/realtime/connection_spec.rb#L204)
675
+ * [disconnects the client, and the client automatically renews the token and then reconnects](./spec/acceptance/realtime/connection_spec.rb#L213)
483
676
  * connection state
484
- * [retains messages published when disconnected twice during authentication](./spec/acceptance/realtime/connection_spec.rb#L273)
677
+ * PENDING: *[retains messages published when disconnected three times during authentication](./spec/acceptance/realtime/connection_spec.rb#L273)*
485
678
  * and subsequent token is invalid
486
- * [transitions the connection to the failed state](./spec/acceptance/realtime/connection_spec.rb#L302)
679
+ * [transitions the connection to the failed state](./spec/acceptance/realtime/connection_spec.rb#L309)
487
680
  * for non-renewable tokens
488
681
  * that are expired
489
682
  * opening a new connection
490
- * [transitions state to failed](./spec/acceptance/realtime/connection_spec.rb#L331)
683
+ * [transitions state to failed (#RSA4a)](./spec/acceptance/realtime/connection_spec.rb#L339)
491
684
  * when connected
492
- * PENDING: *[transitions state to failed](./spec/acceptance/realtime/connection_spec.rb#L344)*
685
+ * [transitions state to failed (#RSA4a)](./spec/acceptance/realtime/connection_spec.rb#L355)
493
686
  * with opaque token string that contain an implicit client_id
494
687
  * string
495
- * [sets the Client#client_id and Auth#client_id once CONNECTED](./spec/acceptance/realtime/connection_spec.rb#L357)
688
+ * [sets the Client#client_id and Auth#client_id once CONNECTED](./spec/acceptance/realtime/connection_spec.rb#L375)
496
689
  * that is incompatible with the current client client_id
497
- * [fails the connection](./spec/acceptance/realtime/connection_spec.rb#L369)
690
+ * [fails the connection](./spec/acceptance/realtime/connection_spec.rb#L387)
498
691
  * wildcard
499
- * [configures the Client#client_id and Auth#client_id with a wildcard once CONNECTED](./spec/acceptance/realtime/connection_spec.rb#L383)
692
+ * [configures the Client#client_id and Auth#client_id with a wildcard once CONNECTED](./spec/acceptance/realtime/connection_spec.rb#L401)
500
693
  * initialization state changes
501
694
  * with implicit #connect
502
- * [are emitted in order](./spec/acceptance/realtime/connection_spec.rb#L415)
695
+ * [are emitted in order](./spec/acceptance/realtime/connection_spec.rb#L433)
503
696
  * with explicit #connect
504
- * [are emitted in order](./spec/acceptance/realtime/connection_spec.rb#L421)
697
+ * [are emitted in order](./spec/acceptance/realtime/connection_spec.rb#L439)
505
698
  * #connect
506
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/connection_spec.rb#L429)
507
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L434)
508
- * [calls the provided block on success even if state changes to disconnected first](./spec/acceptance/realtime/connection_spec.rb#L441)
699
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/connection_spec.rb#L447)
700
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L452)
701
+ * [calls the provided block on success even if state changes to disconnected first](./spec/acceptance/realtime/connection_spec.rb#L459)
509
702
  * with invalid auth details
510
- * [calls the Deferrable errback only once on connection failure](./spec/acceptance/realtime/connection_spec.rb#L470)
703
+ * [calls the Deferrable errback only once on connection failure](./spec/acceptance/realtime/connection_spec.rb#L488)
511
704
  * when already connected
512
- * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L486)
705
+ * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L504)
513
706
  * connection#id
514
- * [is null before connecting](./spec/acceptance/realtime/connection_spec.rb#L500)
707
+ * [is null before connecting](./spec/acceptance/realtime/connection_spec.rb#L518)
515
708
  * connection#key
516
- * [is null before connecting](./spec/acceptance/realtime/connection_spec.rb#L507)
709
+ * [is null before connecting](./spec/acceptance/realtime/connection_spec.rb#L525)
517
710
  * once connected
518
711
  * connection#id
519
- * [is a string](./spec/acceptance/realtime/connection_spec.rb#L518)
520
- * [is unique from the connection#key](./spec/acceptance/realtime/connection_spec.rb#L525)
521
- * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L532)
712
+ * [is a string](./spec/acceptance/realtime/connection_spec.rb#L536)
713
+ * [is unique from the connection#key](./spec/acceptance/realtime/connection_spec.rb#L543)
714
+ * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L550)
522
715
  * connection#key
523
- * [is a string](./spec/acceptance/realtime/connection_spec.rb#L541)
524
- * [is unique from the connection#id](./spec/acceptance/realtime/connection_spec.rb#L548)
525
- * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L555)
716
+ * [is a string](./spec/acceptance/realtime/connection_spec.rb#L559)
717
+ * [is unique from the connection#id](./spec/acceptance/realtime/connection_spec.rb#L566)
718
+ * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L573)
526
719
  * following a previous connection being opened and closed
527
- * [reconnects and is provided with a new connection ID and connection key from the server](./spec/acceptance/realtime/connection_spec.rb#L565)
720
+ * [reconnects and is provided with a new connection ID and connection key from the server](./spec/acceptance/realtime/connection_spec.rb#L583)
528
721
  * when closing
529
- * [raises an exception before the connection is closed](./spec/acceptance/realtime/connection_spec.rb#L582)
722
+ * [fails the deferrable before the connection is closed](./spec/acceptance/realtime/connection_spec.rb#L600)
530
723
  * #serial connection serial
531
- * [is set to -1 when a new connection is opened](./spec/acceptance/realtime/connection_spec.rb#L597)
532
- * [is set to 0 when a message sent ACK is received](./spec/acceptance/realtime/connection_spec.rb#L618)
533
- * [is set to 1 when the second message sent ACK is received](./spec/acceptance/realtime/connection_spec.rb#L625)
724
+ * [is set to -1 when a new connection is opened](./spec/acceptance/realtime/connection_spec.rb#L617)
725
+ * [is set to 0 when a message sent ACK is received](./spec/acceptance/realtime/connection_spec.rb#L640)
726
+ * [is set to 1 when the second message sent ACK is received](./spec/acceptance/realtime/connection_spec.rb#L647)
534
727
  * when a message is sent but the ACK has not yet been received
535
- * [the sent message msgSerial is 0 but the connection serial remains at -1](./spec/acceptance/realtime/connection_spec.rb#L605)
728
+ * [the sent message msgSerial is 0 but the connection serial remains at -1](./spec/acceptance/realtime/connection_spec.rb#L625)
536
729
  * #close
537
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/connection_spec.rb#L636)
538
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L643)
730
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/connection_spec.rb#L658)
731
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L665)
539
732
  * when already closed
540
- * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L654)
733
+ * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L676)
541
734
  * when connection state is
542
735
  * :initialized
543
- * [changes the connection state to :closing and then immediately :closed without sending a ProtocolMessage CLOSE](./spec/acceptance/realtime/connection_spec.rb#L682)
736
+ * [changes the connection state to :closing and then immediately :closed without sending a ProtocolMessage CLOSE](./spec/acceptance/realtime/connection_spec.rb#L703)
544
737
  * :connected
545
- * [changes the connection state to :closing and waits for the server to confirm connection is :closed with a ProtocolMessage](./spec/acceptance/realtime/connection_spec.rb#L700)
738
+ * [changes the connection state to :closing and waits for the server to confirm connection is :closed with a ProtocolMessage](./spec/acceptance/realtime/connection_spec.rb#L720)
546
739
  * with an unresponsive connection
547
- * [force closes the connection when a :closed ProtocolMessage response is not received](./spec/acceptance/realtime/connection_spec.rb#L728)
740
+ * [force closes the connection when a :closed ProtocolMessage response is not received](./spec/acceptance/realtime/connection_spec.rb#L747)
548
741
  * #ping
549
- * [echoes a heart beat](./spec/acceptance/realtime/connection_spec.rb#L751)
550
- * when not connected
551
- * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L761)
742
+ * [echoes a heart beat (#RTN13a)](./spec/acceptance/realtime/connection_spec.rb#L769)
743
+ * [sends a unique ID in each protocol message (#RTN13e)](./spec/acceptance/realtime/connection_spec.rb#L779)
744
+ * [waits until the connection becomes CONNECTED when in the CONNETING state](./spec/acceptance/realtime/connection_spec.rb#L803)
745
+ * with incompatible states
746
+ * when not connected
747
+ * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L816)
748
+ * when suspended
749
+ * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L825)
750
+ * when failed
751
+ * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L837)
752
+ * when closed
753
+ * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L849)
754
+ * when it becomes closed
755
+ * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L863)
552
756
  * with a success block that raises an exception
553
- * [catches the exception and logs the error](./spec/acceptance/realtime/connection_spec.rb#L768)
757
+ * [catches the exception and logs the error](./spec/acceptance/realtime/connection_spec.rb#L876)
554
758
  * when ping times out
555
- * [logs a warning](./spec/acceptance/realtime/connection_spec.rb#L781)
556
- * [yields to the block with a nil value](./spec/acceptance/realtime/connection_spec.rb#L791)
759
+ * [fails the deferrable logs a warning (#RTN13a, #RTN13c)](./spec/acceptance/realtime/connection_spec.rb#L890)
760
+ * [yields to the block with a nil value](./spec/acceptance/realtime/connection_spec.rb#L909)
761
+ * Heartbeats (#RTN23)
762
+ * heartbeat interval
763
+ * when reduced artificially
764
+ * [is the sum of the max_idle_interval and realtime_request_timeout (#RTN23a)](./spec/acceptance/realtime/connection_spec.rb#L936)
765
+ * [disconnects the transport if no heartbeat received since connected (#RTN23a)](./spec/acceptance/realtime/connection_spec.rb#L946)
766
+ * [disconnects the transport if no heartbeat received since last event received (#RTN23a)](./spec/acceptance/realtime/connection_spec.rb#L957)
767
+ * transport-level heartbeats are supported in the websocket transport
768
+ * [provides the heartbeats argument in the websocket connection params (#RTN23b)](./spec/acceptance/realtime/connection_spec.rb#L972)
769
+ * PENDING: *[receives websocket heartbeat messages (#RTN23b) [slow test as need to wait for heartbeat]](./spec/acceptance/realtime/connection_spec.rb#L981)*
770
+ * with websocket heartbeats disabled (undocumented)
771
+ * [does not provide the heartbeats argument in the websocket connection params (#RTN23b)](./spec/acceptance/realtime/connection_spec.rb#L1000)
772
+ * [receives websocket protocol messages (#RTN23b) [slow test as need to wait for heartbeat]](./spec/acceptance/realtime/connection_spec.rb#L1009)
557
773
  * #details
558
- * [is nil before connected](./spec/acceptance/realtime/connection_spec.rb#L806)
559
- * [contains the ConnectionDetails object once connected](./spec/acceptance/realtime/connection_spec.rb#L813)
560
- * [contains the new ConnectionDetails object once a subsequent connection is created](./spec/acceptance/realtime/connection_spec.rb#L822)
774
+ * [is nil before connected](./spec/acceptance/realtime/connection_spec.rb#L1026)
775
+ * [contains the ConnectionDetails object once connected (#RTN21)](./spec/acceptance/realtime/connection_spec.rb#L1033)
776
+ * [contains the new ConnectionDetails object once a subsequent connection is created (#RTN21)](./spec/acceptance/realtime/connection_spec.rb#L1042)
777
+ * with a different default connection_state_ttl
778
+ * [updates the private Connection#connection_state_ttl when received from Ably in ConnectionDetails](./spec/acceptance/realtime/connection_spec.rb#L1063)
561
779
  * recovery
562
780
  * #recovery_key
563
- * [is composed of connection key and serial that is kept up to date with each message ACK received](./spec/acceptance/realtime/connection_spec.rb#L864)
564
- * [is available when connection is in one of the states: connecting, connected, disconnected, suspended, failed](./spec/acceptance/realtime/connection_spec.rb#L887)
565
- * [is nil when connection is explicitly CLOSED](./spec/acceptance/realtime/connection_spec.rb#L916)
781
+ * [is composed of connection key and serial that is kept up to date with each message ACK received](./spec/acceptance/realtime/connection_spec.rb#L1100)
782
+ * [is available when connection is in one of the states: connecting, connected, disconnected](./spec/acceptance/realtime/connection_spec.rb#L1123)
783
+ * [is nil when connection is explicitly CLOSED](./spec/acceptance/realtime/connection_spec.rb#L1152)
566
784
  * opening a new connection using a recently disconnected connection's #recovery_key
567
785
  * connection#id and connection#key after recovery
568
- * [remains the same for id and party for key](./spec/acceptance/realtime/connection_spec.rb#L928)
786
+ * [remains the same for id and party for key](./spec/acceptance/realtime/connection_spec.rb#L1164)
569
787
  * when messages have been sent whilst the old connection is disconnected
570
788
  * the new connection
571
- * [recovers server-side queued messages](./spec/acceptance/realtime/connection_spec.rb#L970)
789
+ * [recovers server-side queued messages](./spec/acceptance/realtime/connection_spec.rb#L1206)
572
790
  * with :recover option
573
791
  * with invalid syntax
574
- * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L996)
792
+ * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L1238)
575
793
  * with invalid formatted value sent to server
576
- * [emits a fatal error on the connection object, sets the #error_reason and disconnects](./spec/acceptance/realtime/connection_spec.rb#L1005)
794
+ * [sets the #error_reason and moves the connection to FAILED](./spec/acceptance/realtime/connection_spec.rb#L1247)
577
795
  * with expired (missing) value sent to server
578
- * [emits an error on the connection object, sets the #error_reason, yet will connect anyway](./spec/acceptance/realtime/connection_spec.rb#L1020)
796
+ * [connects but sets the error reason and includes the reason in the state change](./spec/acceptance/realtime/connection_spec.rb#L1262)
579
797
  * with many connections simultaneously
580
- * [opens each with a unique connection#id and connection#key](./spec/acceptance/realtime/connection_spec.rb#L1039)
798
+ * [opens each with a unique connection#id and connection#key](./spec/acceptance/realtime/connection_spec.rb#L1281)
581
799
  * when a state transition is unsupported
582
- * [emits a InvalidStateChange](./spec/acceptance/realtime/connection_spec.rb#L1059)
800
+ * [logs the invalid state change as fatal](./spec/acceptance/realtime/connection_spec.rb#L1301)
583
801
  * protocol failure
584
802
  * receiving an invalid ProtocolMessage
585
- * [emits an error on the connection and logs a fatal error message](./spec/acceptance/realtime/connection_spec.rb#L1075)
803
+ * [emits an error on the connection and logs a fatal error message](./spec/acceptance/realtime/connection_spec.rb#L1317)
586
804
  * undocumented method
587
805
  * #internet_up?
588
- * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1091)
806
+ * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1335)
589
807
  * internet up URL protocol
590
808
  * when using TLS for the connection
591
- * [uses TLS for the Internet check to https://internet-up.ably-realtime.com/is-the-internet-up.txt](./spec/acceptance/realtime/connection_spec.rb#L1102)
809
+ * [uses TLS for the Internet check to https://internet-up.ably-realtime.com/is-the-internet-up.txt](./spec/acceptance/realtime/connection_spec.rb#L1346)
592
810
  * when using a non-secured connection
593
- * [uses TLS for the Internet check to http://internet-up.ably-realtime.com/is-the-internet-up.txt](./spec/acceptance/realtime/connection_spec.rb#L1112)
811
+ * [uses TLS for the Internet check to http://internet-up.ably-realtime.com/is-the-internet-up.txt](./spec/acceptance/realtime/connection_spec.rb#L1356)
594
812
  * when the Internet is up
595
- * [calls the block with true](./spec/acceptance/realtime/connection_spec.rb#L1143)
596
- * [calls the success callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1150)
813
+ * [calls the block with true](./spec/acceptance/realtime/connection_spec.rb#L1387)
814
+ * [calls the success callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1394)
597
815
  * with a TLS connection
598
- * [checks the Internet up URL over TLS](./spec/acceptance/realtime/connection_spec.rb#L1126)
816
+ * [checks the Internet up URL over TLS](./spec/acceptance/realtime/connection_spec.rb#L1370)
599
817
  * with a non-TLS connection
600
- * [checks the Internet up URL over TLS](./spec/acceptance/realtime/connection_spec.rb#L1136)
818
+ * [checks the Internet up URL over TLS](./spec/acceptance/realtime/connection_spec.rb#L1380)
601
819
  * when the Internet is down
602
- * [calls the block with false](./spec/acceptance/realtime/connection_spec.rb#L1165)
603
- * [calls the failure callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1172)
820
+ * [calls the block with false](./spec/acceptance/realtime/connection_spec.rb#L1409)
821
+ * [calls the failure callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1416)
604
822
  * state change side effects
605
823
  * when connection enters the :disconnected state
606
- * [queues messages to be sent and all channels remain attached](./spec/acceptance/realtime/connection_spec.rb#L1186)
824
+ * [queues messages to be sent and all channels remain attached](./spec/acceptance/realtime/connection_spec.rb#L1430)
607
825
  * when connection enters the :suspended state
608
- * [detaches the channels and prevents publishing of messages on those channels](./spec/acceptance/realtime/connection_spec.rb#L1219)
826
+ * [moves the channels into the suspended state and prevents publishing of messages on those channels](./spec/acceptance/realtime/connection_spec.rb#L1463)
609
827
  * when connection enters the :failed state
610
- * [sets all channels to failed and prevents publishing of messages on those channels](./spec/acceptance/realtime/connection_spec.rb#L1248)
828
+ * [sets all channels to failed and prevents publishing of messages on those channels](./spec/acceptance/realtime/connection_spec.rb#L1494)
611
829
  * connection state change
612
- * [emits a ConnectionStateChange object](./spec/acceptance/realtime/connection_spec.rb#L1259)
830
+ * [emits event to all and single subscribers](./spec/acceptance/realtime/connection_spec.rb#L1508)
831
+ * [emits a ConnectionStateChange object](./spec/acceptance/realtime/connection_spec.rb#L1523)
613
832
  * ConnectionStateChange object
614
- * [has current state](./spec/acceptance/realtime/connection_spec.rb#L1267)
615
- * [has a previous state](./spec/acceptance/realtime/connection_spec.rb#L1274)
616
- * [has an empty reason when there is no error](./spec/acceptance/realtime/connection_spec.rb#L1289)
833
+ * [has current state](./spec/acceptance/realtime/connection_spec.rb#L1531)
834
+ * [has a previous state](./spec/acceptance/realtime/connection_spec.rb#L1539)
835
+ * [has the event that generated the state change (#TH5)](./spec/acceptance/realtime/connection_spec.rb#L1547)
836
+ * [has an empty reason when there is no error](./spec/acceptance/realtime/connection_spec.rb#L1563)
617
837
  * on failure
618
- * [has a reason Error object when there is an error on the connection](./spec/acceptance/realtime/connection_spec.rb#L1302)
838
+ * [has a reason Error object when there is an error on the connection](./spec/acceptance/realtime/connection_spec.rb#L1576)
619
839
  * retry_in
620
- * [is nil when a retry is not required](./spec/acceptance/realtime/connection_spec.rb#L1317)
621
- * [is 0 when first attempt to connect fails](./spec/acceptance/realtime/connection_spec.rb#L1324)
622
- * [is 0 when an immediate reconnect will occur](./spec/acceptance/realtime/connection_spec.rb#L1334)
623
- * [contains the next retry period when an immediate reconnect will not occur](./spec/acceptance/realtime/connection_spec.rb#L1344)
840
+ * [is nil when a retry is not required](./spec/acceptance/realtime/connection_spec.rb#L1591)
841
+ * [is 0 when first attempt to connect fails](./spec/acceptance/realtime/connection_spec.rb#L1598)
842
+ * [is 0 when an immediate reconnect will occur](./spec/acceptance/realtime/connection_spec.rb#L1608)
843
+ * [contains the next retry period when an immediate reconnect will not occur](./spec/acceptance/realtime/connection_spec.rb#L1618)
844
+ * whilst CONNECTED
845
+ * when a CONNECTED message is received (#RTN24)
846
+ * [emits an UPDATE event](./spec/acceptance/realtime/connection_spec.rb#L1653)
847
+ * [updates the ConnectionDetail and Connection attributes (#RTC8a1)](./spec/acceptance/realtime/connection_spec.rb#L1668)
848
+ * when a CONNECTED message with an error is received
849
+ * [emits an UPDATE event](./spec/acceptance/realtime/connection_spec.rb#L1703)
850
+ * version params
851
+ * [sends the protocol version param v (#G4, #RTN2f)](./spec/acceptance/realtime/connection_spec.rb#L1724)
852
+ * [sends the lib version param lib (#RTN2g)](./spec/acceptance/realtime/connection_spec.rb#L1733)
853
+ * with variant
854
+ * [sends the lib version param lib with the variant (#RTN2g + #RSC7b)](./spec/acceptance/realtime/connection_spec.rb#L1753)
624
855
 
625
856
  ### Ably::Realtime::Channel Message
626
857
  _(see [spec/acceptance/realtime/message_spec.rb](./spec/acceptance/realtime/message_spec.rb))_
@@ -635,106 +866,156 @@ _(see [spec/acceptance/realtime/message_spec.rb](./spec/acceptance/realtime/mess
635
866
  * [is encoded and decoded to the same Array](./spec/acceptance/realtime/message_spec.rb#L64)
636
867
  * Binary
637
868
  * [is encoded and decoded to the same Array](./spec/acceptance/realtime/message_spec.rb#L72)
869
+ * with supported extra payload content type (#RTL6h, #RSL6a2)
870
+ * JSON Object (Hash)
871
+ * PENDING: *[is encoded and decoded to the same hash](./spec/acceptance/realtime/message_spec.rb#L91)*
872
+ * JSON Array
873
+ * PENDING: *[is encoded and decoded to the same Array](./spec/acceptance/realtime/message_spec.rb#L100)*
874
+ * nil
875
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/message_spec.rb#L107)
638
876
  * with unsupported data payload content type
639
877
  * Integer
640
- * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/message_spec.rb#L82)
878
+ * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/message_spec.rb#L118)
641
879
  * Float
642
- * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/message_spec.rb#L91)
880
+ * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/message_spec.rb#L127)
643
881
  * Boolean
644
- * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/message_spec.rb#L100)
882
+ * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/message_spec.rb#L136)
645
883
  * False
646
- * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/message_spec.rb#L109)
884
+ * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/message_spec.rb#L145)
647
885
  * with ASCII_8BIT message name
648
- * [is converted into UTF_8](./spec/acceptance/realtime/message_spec.rb#L118)
886
+ * [is converted into UTF_8](./spec/acceptance/realtime/message_spec.rb#L154)
649
887
  * when the message publisher has a client_id
650
- * [contains a #client_id attribute](./spec/acceptance/realtime/message_spec.rb#L134)
888
+ * [contains a #client_id attribute](./spec/acceptance/realtime/message_spec.rb#L170)
651
889
  * #connection_id attribute
652
890
  * over realtime
653
- * [matches the sender connection#id](./spec/acceptance/realtime/message_spec.rb#L147)
891
+ * [matches the sender connection#id](./spec/acceptance/realtime/message_spec.rb#L183)
654
892
  * when retrieved over REST
655
- * [matches the sender connection#id](./spec/acceptance/realtime/message_spec.rb#L159)
893
+ * [matches the sender connection#id](./spec/acceptance/realtime/message_spec.rb#L195)
656
894
  * local echo when published
657
- * [is enabled by default](./spec/acceptance/realtime/message_spec.rb#L171)
895
+ * [is enabled by default](./spec/acceptance/realtime/message_spec.rb#L207)
658
896
  * with :echo_messages option set to false
659
- * [will not echo messages to the client but will still broadcast messages to other connected clients](./spec/acceptance/realtime/message_spec.rb#L191)
660
- * [will not echo messages to the client from other REST clients publishing using that connection_key](./spec/acceptance/realtime/message_spec.rb#L210)
661
- * [will echo messages with a valid connection_id to the client from other REST clients publishing using that connection_key](./spec/acceptance/realtime/message_spec.rb#L223)
897
+ * [will not echo messages to the client but will still broadcast messages to other connected clients](./spec/acceptance/realtime/message_spec.rb#L227)
898
+ * [will not echo messages to the client from other REST clients publishing using that connection_key](./spec/acceptance/realtime/message_spec.rb#L246)
899
+ * [will echo messages with a valid connection_id to the client from other REST clients publishing using that connection_key](./spec/acceptance/realtime/message_spec.rb#L259)
662
900
  * publishing lots of messages across two connections
663
- * [sends and receives the messages on both opened connections and calls the success callbacks for each message published](./spec/acceptance/realtime/message_spec.rb#L249)
901
+ * [sends and receives the messages on both opened connections and calls the success callbacks for each message published](./spec/acceptance/realtime/message_spec.rb#L285)
664
902
  * without suitable publishing permissions
665
- * [calls the error callback](./spec/acceptance/realtime/message_spec.rb#L294)
903
+ * [calls the error callback](./spec/acceptance/realtime/message_spec.rb#L330)
666
904
  * server incorrectly resends a message that was already received by the client library
667
- * [discards the message and logs it as an error to the channel](./spec/acceptance/realtime/message_spec.rb#L313)
905
+ * [discards the message and logs it as an error to the channel](./spec/acceptance/realtime/message_spec.rb#L349)
668
906
  * encoding and decoding encrypted messages
669
- * with AES-128-CBC using crypto-data-128.json fixtures
907
+ * with AES-128-CBC using crypto-data-128.json fixtures (#RTL7d)
670
908
  * item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
671
909
  * behaves like an Ably encrypter and decrypter
672
910
  * with #publish and #subscribe
673
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L377)
674
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L395)
911
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L414)
912
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L432)
675
913
  * item 1 with encrypted encoding cipher+aes-128-cbc/base64
676
914
  * behaves like an Ably encrypter and decrypter
677
915
  * with #publish and #subscribe
678
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L377)
679
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L395)
916
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L414)
917
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L432)
680
918
  * item 2 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
681
919
  * behaves like an Ably encrypter and decrypter
682
920
  * with #publish and #subscribe
683
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L377)
684
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L395)
921
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L414)
922
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L432)
685
923
  * item 3 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
686
924
  * behaves like an Ably encrypter and decrypter
687
925
  * with #publish and #subscribe
688
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L377)
689
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L395)
690
- * with AES-256-CBC using crypto-data-256.json fixtures
926
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L414)
927
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L432)
928
+ * with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d)
691
929
  * item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
692
930
  * behaves like an Ably encrypter and decrypter
693
931
  * with #publish and #subscribe
694
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L377)
695
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L395)
932
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L414)
933
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L432)
696
934
  * item 1 with encrypted encoding cipher+aes-256-cbc/base64
697
935
  * behaves like an Ably encrypter and decrypter
698
936
  * with #publish and #subscribe
699
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L377)
700
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L395)
937
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L414)
938
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L432)
701
939
  * item 2 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
702
940
  * behaves like an Ably encrypter and decrypter
703
941
  * with #publish and #subscribe
704
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L377)
705
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L395)
942
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L414)
943
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L432)
706
944
  * item 3 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
707
945
  * behaves like an Ably encrypter and decrypter
708
946
  * with #publish and #subscribe
709
- * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L377)
710
- * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L395)
947
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L414)
948
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L432)
711
949
  * with multiple sends from one client to another
712
- * [encrypts and decrypts all messages](./spec/acceptance/realtime/message_spec.rb#L434)
713
- * [receives raw messages with the correct encoding](./spec/acceptance/realtime/message_spec.rb#L451)
950
+ * [encrypts and decrypts all messages](./spec/acceptance/realtime/message_spec.rb#L471)
951
+ * [receives raw messages with the correct encoding](./spec/acceptance/realtime/message_spec.rb#L488)
714
952
  * subscribing with a different transport protocol
715
- * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L485)
716
- * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L485)
717
- * [delivers a Hash payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L485)
953
+ * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L522)
954
+ * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L522)
955
+ * [delivers a Hash payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L522)
718
956
  * publishing on an unencrypted channel and subscribing on an encrypted channel with another client
719
- * [does not attempt to decrypt the message](./spec/acceptance/realtime/message_spec.rb#L504)
957
+ * [does not attempt to decrypt the message](./spec/acceptance/realtime/message_spec.rb#L543)
720
958
  * publishing on an encrypted channel and subscribing on an unencrypted channel with another client
721
- * [delivers the message but still encrypted with a value in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L522)
722
- * [emits a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L531)
959
+ * [delivers the message but still encrypted with a value in the #encoding attribute (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L561)
960
+ * [logs a Cipher error (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L572)
723
961
  * publishing on an encrypted channel and subscribing with a different algorithm on another client
724
- * [delivers the message but still encrypted with the cipher detials in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L553)
725
- * [emits a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L562)
962
+ * [delivers the message but still encrypted with the cipher detials in the #encoding attribute (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L592)
963
+ * [emits a Cipher error on the channel (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L601)
726
964
  * publishing on an encrypted channel and subscribing with a different key on another client
727
- * [delivers the message but still encrypted with the cipher details in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L584)
728
- * [emits a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L595)
965
+ * [delivers the message but still encrypted with the cipher details in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L621)
966
+ * [emits a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L632)
729
967
  * when message is published, the connection disconnects before the ACK is received, and the connection is resumed
730
- * [publishes the message again, later receives the ACK and only one message is ever received from Ably](./spec/acceptance/realtime/message_spec.rb#L616)
968
+ * [publishes the message again, later receives the ACK and only one message is ever received from Ably](./spec/acceptance/realtime/message_spec.rb#L651)
731
969
  * when message is published, the connection disconnects before the ACK is received
732
970
  * the connection is not resumed
733
- * [calls the errback for all messages](./spec/acceptance/realtime/message_spec.rb#L659)
971
+ * [calls the errback for all messages](./spec/acceptance/realtime/message_spec.rb#L694)
734
972
  * the connection becomes suspended
735
- * [calls the errback for all messages](./spec/acceptance/realtime/message_spec.rb#L685)
973
+ * [calls the errback for all messages](./spec/acceptance/realtime/message_spec.rb#L720)
736
974
  * the connection becomes failed
737
- * [calls the errback for all messages](./spec/acceptance/realtime/message_spec.rb#L712)
975
+ * [calls the errback for all messages](./spec/acceptance/realtime/message_spec.rb#L747)
976
+ * message encoding interoperability
977
+ * over a JSON transport
978
+ * when decoding string
979
+ * [ensures that client libraries have compatible encoding and decoding using common fixtures](./spec/acceptance/realtime/message_spec.rb#L788)
980
+ * when encoding string
981
+ * [ensures that client libraries have compatible encoding and decoding using common fixtures](./spec/acceptance/realtime/message_spec.rb#L806)
982
+ * when decoding string
983
+ * [ensures that client libraries have compatible encoding and decoding using common fixtures](./spec/acceptance/realtime/message_spec.rb#L788)
984
+ * when encoding string
985
+ * [ensures that client libraries have compatible encoding and decoding using common fixtures](./spec/acceptance/realtime/message_spec.rb#L806)
986
+ * when decoding jsonObject
987
+ * [ensures that client libraries have compatible encoding and decoding using common fixtures](./spec/acceptance/realtime/message_spec.rb#L788)
988
+ * when encoding jsonObject
989
+ * [ensures that client libraries have compatible encoding and decoding using common fixtures](./spec/acceptance/realtime/message_spec.rb#L806)
990
+ * when decoding jsonArray
991
+ * [ensures that client libraries have compatible encoding and decoding using common fixtures](./spec/acceptance/realtime/message_spec.rb#L788)
992
+ * when encoding jsonArray
993
+ * [ensures that client libraries have compatible encoding and decoding using common fixtures](./spec/acceptance/realtime/message_spec.rb#L806)
994
+ * when decoding binary
995
+ * [ensures that client libraries have compatible encoding and decoding using common fixtures](./spec/acceptance/realtime/message_spec.rb#L788)
996
+ * when encoding binary
997
+ * [ensures that client libraries have compatible encoding and decoding using common fixtures](./spec/acceptance/realtime/message_spec.rb#L806)
998
+ * over a MsgPack transport
999
+ * when publishing a string using JSON protocol
1000
+ * [receives the message over MsgPack and the data matches](./spec/acceptance/realtime/message_spec.rb#L840)
1001
+ * when retrieving a string using JSON protocol
1002
+ * [is compatible with a publishes using MsgPack](./spec/acceptance/realtime/message_spec.rb#L868)
1003
+ * when publishing a string using JSON protocol
1004
+ * [receives the message over MsgPack and the data matches](./spec/acceptance/realtime/message_spec.rb#L840)
1005
+ * when retrieving a string using JSON protocol
1006
+ * [is compatible with a publishes using MsgPack](./spec/acceptance/realtime/message_spec.rb#L868)
1007
+ * when publishing a jsonObject using JSON protocol
1008
+ * [receives the message over MsgPack and the data matches](./spec/acceptance/realtime/message_spec.rb#L840)
1009
+ * when retrieving a jsonObject using JSON protocol
1010
+ * [is compatible with a publishes using MsgPack](./spec/acceptance/realtime/message_spec.rb#L868)
1011
+ * when publishing a jsonArray using JSON protocol
1012
+ * [receives the message over MsgPack and the data matches](./spec/acceptance/realtime/message_spec.rb#L840)
1013
+ * when retrieving a jsonArray using JSON protocol
1014
+ * [is compatible with a publishes using MsgPack](./spec/acceptance/realtime/message_spec.rb#L868)
1015
+ * when publishing a binary using JSON protocol
1016
+ * [receives the message over MsgPack and the data matches](./spec/acceptance/realtime/message_spec.rb#L840)
1017
+ * when retrieving a binary using JSON protocol
1018
+ * [is compatible with a publishes using MsgPack](./spec/acceptance/realtime/message_spec.rb#L868)
738
1019
 
739
1020
  ### Ably::Realtime::Presence history
740
1021
  _(see [spec/acceptance/realtime/presence_history_spec.rb](./spec/acceptance/realtime/presence_history_spec.rb))_
@@ -743,7 +1024,7 @@ _(see [spec/acceptance/realtime/presence_history_spec.rb](./spec/acceptance/real
743
1024
  * [ensures REST presence history message IDs match ProtocolMessage wrapped message and connection IDs via Realtime](./spec/acceptance/realtime/presence_history_spec.rb#L42)
744
1025
  * with option until_attach: true
745
1026
  * [retrieves all presence messages before channel was attached](./spec/acceptance/realtime/presence_history_spec.rb#L61)
746
- * [raises an exception unless state is attached](./spec/acceptance/realtime/presence_history_spec.rb#L97)
1027
+ * [fails with an exception unless state is attached](./spec/acceptance/realtime/presence_history_spec.rb#L97)
747
1028
  * and two pages of messages
748
1029
  * [retrieves two pages of messages before channel was attached](./spec/acceptance/realtime/presence_history_spec.rb#L78)
749
1030
 
@@ -751,430 +1032,491 @@ _(see [spec/acceptance/realtime/presence_history_spec.rb](./spec/acceptance/real
751
1032
  _(see [spec/acceptance/realtime/presence_spec.rb](./spec/acceptance/realtime/presence_spec.rb))_
752
1033
  * using JSON protocol
753
1034
  * when attached (but not present) on a presence channel with an anonymous client (no client ID)
754
- * [maintains state as other clients enter and leave the channel](./spec/acceptance/realtime/presence_spec.rb#L412)
755
- * #sync_complete?
1035
+ * [maintains state as other clients enter and leave the channel (#RTP2e)](./spec/acceptance/realtime/presence_spec.rb#L479)
1036
+ * #sync_complete? and SYNC flags (#RTP1)
756
1037
  * when attaching to a channel without any members present
757
- * [is true and the presence channel is considered synced immediately](./spec/acceptance/realtime/presence_spec.rb#L488)
1038
+ * [sync_complete? is true, there is no presence flag, and the presence channel is considered synced immediately (#RTP1)](./spec/acceptance/realtime/presence_spec.rb#L701)
758
1039
  * when attaching to a channel with members present
759
- * [is false and the presence channel will subsequently be synced](./spec/acceptance/realtime/presence_spec.rb#L497)
760
- * 250 existing (present) members on a channel (3 SYNC pages)
761
- * requires at least 3 SYNC ProtocolMessages
1040
+ * [sync_complete? is false, there is a presence flag, and the presence channel is subsequently synced (#RTP1)](./spec/acceptance/realtime/presence_spec.rb#L722)
1041
+ * 101 existing (present) members on a channel (2 SYNC pages)
1042
+ * requiring at least 2 SYNC ProtocolMessages
762
1043
  * when a client attaches to the presence channel
763
- * [emits :present for each member](./spec/acceptance/realtime/presence_spec.rb#L533)
1044
+ * [emits :present for each member](./spec/acceptance/realtime/presence_spec.rb#L771)
1045
+ * and a member enters before the SYNC operation is complete
1046
+ * [emits a :enter immediately and the member is :present once the sync is complete (#RTP2g)](./spec/acceptance/realtime/presence_spec.rb#L787)
764
1047
  * and a member leaves before the SYNC operation is complete
765
- * [emits :leave immediately as the member leaves](./spec/acceptance/realtime/presence_spec.rb#L547)
766
- * [ignores presence events with timestamps prior to the current :present event in the MembersMap](./spec/acceptance/realtime/presence_spec.rb#L588)
767
- * [does not emit :present after the :leave event has been emitted, and that member is not included in the list of members via #get with :wait_for_sync](./spec/acceptance/realtime/presence_spec.rb#L630)
1048
+ * [emits :leave immediately as the member leaves and cleans up the ABSENT member after (#RTP2f, #RTP2g)](./spec/acceptance/realtime/presence_spec.rb#L824)
1049
+ * [ignores presence events with timestamps / identifiers prior to the current :present event in the MembersMap (#RTP2c)](./spec/acceptance/realtime/presence_spec.rb#L872)
1050
+ * [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)](./spec/acceptance/realtime/presence_spec.rb#L917)
768
1051
  * #get
769
- * with :wait_for_sync option set to true
770
- * [waits until sync is complete](./spec/acceptance/realtime/presence_spec.rb#L680)
771
1052
  * by default
772
- * [it does not wait for sync](./spec/acceptance/realtime/presence_spec.rb#L699)
1053
+ * [waits until sync is complete (#RTP11c1)](./spec/acceptance/realtime/presence_spec.rb#L967)
1054
+ * with :wait_for_sync option set to false (#RTP11c1)
1055
+ * [it does not wait for sync](./spec/acceptance/realtime/presence_spec.rb#L986)
773
1056
  * state
774
1057
  * once opened
775
- * [once opened, enters the :left state if the channel detaches](./spec/acceptance/realtime/presence_spec.rb#L725)
1058
+ * [once opened, enters the :left state if the channel detaches](./spec/acceptance/realtime/presence_spec.rb#L1012)
776
1059
  * #enter
777
1060
  * data attribute
778
1061
  * when provided as argument option to #enter
779
- * [changes to value provided in #leave](./spec/acceptance/realtime/presence_spec.rb#L750)
1062
+ * [changes to value provided in #leave](./spec/acceptance/realtime/presence_spec.rb#L1037)
780
1063
  * message #connection_id
781
- * [matches the current client connection_id](./spec/acceptance/realtime/presence_spec.rb#L774)
1064
+ * [matches the current client connection_id](./spec/acceptance/realtime/presence_spec.rb#L1061)
782
1065
  * without necessary capabilities to join presence
783
- * [calls the Deferrable errback on capabilities failure](./spec/acceptance/realtime/presence_spec.rb#L793)
1066
+ * [calls the Deferrable errback on capabilities failure](./spec/acceptance/realtime/presence_spec.rb#L1080)
784
1067
  * it should behave like a public presence method
785
- * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L54)
786
- * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L66)
787
- * [implicitly attaches the channel](./spec/acceptance/realtime/presence_spec.rb#L77)
788
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L234)
789
- * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L241)
790
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L249)
791
- * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L259)
1068
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L63)
1069
+ * [raise an exception if the channel becomes detached](./spec/acceptance/realtime/presence_spec.rb#L81)
1070
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L97)
1071
+ * [raise an exception if the channel becomes failed](./spec/acceptance/realtime/presence_spec.rb#L114)
1072
+ * [implicitly attaches the channel](./spec/acceptance/realtime/presence_spec.rb#L130)
1073
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L293)
1074
+ * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L300)
1075
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L308)
1076
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L318)
792
1077
  * when :queue_messages client option is false
793
1078
  * and connection state initialized
794
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L89)
1079
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L142)
795
1080
  * and connection state connecting
796
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L97)
1081
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L152)
797
1082
  * and connection state disconnected
798
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L110)
1083
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L167)
799
1084
  * and connection state connected
800
- * [publishes the message](./spec/acceptance/realtime/presence_spec.rb#L123)
1085
+ * [publishes the message](./spec/acceptance/realtime/presence_spec.rb#L182)
801
1086
  * with supported data payload content type
802
1087
  * JSON Object (Hash)
803
- * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L150)
1088
+ * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L209)
804
1089
  * JSON Array
805
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L160)
1090
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L219)
806
1091
  * String
807
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L170)
1092
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L229)
808
1093
  * Binary
809
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L180)
1094
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L239)
810
1095
  * with unsupported data payload content type
811
1096
  * Integer
812
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L200)
1097
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L259)
813
1098
  * Float
814
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L209)
1099
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L268)
815
1100
  * Boolean
816
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L218)
1101
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L277)
817
1102
  * False
818
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L227)
1103
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L286)
819
1104
  * if connection fails before success
820
- * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L271)
1105
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L331)
821
1106
  * #update
822
- * [without previous #enter automatically enters](./spec/acceptance/realtime/presence_spec.rb#L805)
823
- * [updates the data if :data argument provided](./spec/acceptance/realtime/presence_spec.rb#L830)
824
- * [updates the data to nil if :data argument is not provided (assumes nil value)](./spec/acceptance/realtime/presence_spec.rb#L840)
1107
+ * [without previous #enter automatically enters](./spec/acceptance/realtime/presence_spec.rb#L1092)
1108
+ * [updates the data if :data argument provided](./spec/acceptance/realtime/presence_spec.rb#L1117)
1109
+ * [updates the data to nil if :data argument is not provided (assumes nil value)](./spec/acceptance/realtime/presence_spec.rb#L1127)
825
1110
  * when ENTERED
826
- * [has no effect on the state](./spec/acceptance/realtime/presence_spec.rb#L815)
1111
+ * [has no effect on the state](./spec/acceptance/realtime/presence_spec.rb#L1102)
827
1112
  * it should behave like a public presence method
828
- * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L54)
829
- * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L66)
830
- * [implicitly attaches the channel](./spec/acceptance/realtime/presence_spec.rb#L77)
831
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L234)
832
- * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L241)
833
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L249)
834
- * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L259)
1113
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L63)
1114
+ * [raise an exception if the channel becomes detached](./spec/acceptance/realtime/presence_spec.rb#L81)
1115
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L97)
1116
+ * [raise an exception if the channel becomes failed](./spec/acceptance/realtime/presence_spec.rb#L114)
1117
+ * [implicitly attaches the channel](./spec/acceptance/realtime/presence_spec.rb#L130)
1118
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L293)
1119
+ * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L300)
1120
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L308)
1121
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L318)
835
1122
  * when :queue_messages client option is false
836
1123
  * and connection state initialized
837
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L89)
1124
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L142)
838
1125
  * and connection state connecting
839
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L97)
1126
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L152)
840
1127
  * and connection state disconnected
841
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L110)
1128
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L167)
842
1129
  * and connection state connected
843
- * [publishes the message](./spec/acceptance/realtime/presence_spec.rb#L123)
1130
+ * [publishes the message](./spec/acceptance/realtime/presence_spec.rb#L182)
844
1131
  * with supported data payload content type
845
1132
  * JSON Object (Hash)
846
- * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L150)
1133
+ * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L209)
847
1134
  * JSON Array
848
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L160)
1135
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L219)
849
1136
  * String
850
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L170)
1137
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L229)
851
1138
  * Binary
852
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L180)
1139
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L239)
853
1140
  * with unsupported data payload content type
854
1141
  * Integer
855
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L200)
1142
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L259)
856
1143
  * Float
857
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L209)
1144
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L268)
858
1145
  * Boolean
859
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L218)
1146
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L277)
860
1147
  * False
861
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L227)
1148
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L286)
862
1149
  * if connection fails before success
863
- * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L271)
1150
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L331)
864
1151
  * #leave
865
- * [raises an exception if not entered](./spec/acceptance/realtime/presence_spec.rb#L914)
1152
+ * [raises an exception if not entered](./spec/acceptance/realtime/presence_spec.rb#L1201)
866
1153
  * :data option
867
1154
  * when set to a string
868
- * [emits the new data for the leave event](./spec/acceptance/realtime/presence_spec.rb#L859)
1155
+ * [emits the new data for the leave event](./spec/acceptance/realtime/presence_spec.rb#L1146)
869
1156
  * when set to nil
870
- * [emits the last value for the data attribute when leaving](./spec/acceptance/realtime/presence_spec.rb#L872)
1157
+ * [emits the last value for the data attribute when leaving](./spec/acceptance/realtime/presence_spec.rb#L1159)
871
1158
  * when not passed as an argument (i.e. nil)
872
- * [emits the previous value for the data attribute when leaving](./spec/acceptance/realtime/presence_spec.rb#L885)
1159
+ * [emits the previous value for the data attribute when leaving](./spec/acceptance/realtime/presence_spec.rb#L1172)
873
1160
  * and sync is complete
874
- * [does not cache members that have left](./spec/acceptance/realtime/presence_spec.rb#L898)
1161
+ * [does not cache members that have left](./spec/acceptance/realtime/presence_spec.rb#L1185)
875
1162
  * it should behave like a public presence method
876
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L234)
877
- * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L241)
878
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L249)
879
- * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L259)
1163
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L293)
1164
+ * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L300)
1165
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L308)
1166
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L318)
880
1167
  * with supported data payload content type
881
1168
  * JSON Object (Hash)
882
- * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L150)
1169
+ * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L209)
883
1170
  * JSON Array
884
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L160)
1171
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L219)
885
1172
  * String
886
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L170)
1173
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L229)
887
1174
  * Binary
888
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L180)
1175
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L239)
889
1176
  * with unsupported data payload content type
890
1177
  * Integer
891
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L200)
1178
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L259)
892
1179
  * Float
893
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L209)
1180
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L268)
894
1181
  * Boolean
895
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L218)
1182
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L277)
896
1183
  * False
897
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L227)
1184
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L286)
898
1185
  * if connection fails before success
899
- * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L271)
1186
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L331)
900
1187
  * :left event
901
- * [emits the data defined in enter](./spec/acceptance/realtime/presence_spec.rb#L923)
902
- * [emits the data defined in update](./spec/acceptance/realtime/presence_spec.rb#L934)
1188
+ * [emits the data defined in enter](./spec/acceptance/realtime/presence_spec.rb#L1210)
1189
+ * [emits the data defined in update](./spec/acceptance/realtime/presence_spec.rb#L1221)
903
1190
  * entering/updating/leaving presence state on behalf of another client_id
904
1191
  * #enter_client
905
1192
  * multiple times on the same channel with different client_ids
906
- * [has no affect on the client's presence state and only enters on behalf of the provided client_id](./spec/acceptance/realtime/presence_spec.rb#L957)
907
- * [enters a channel and sets the data based on the provided :data option](./spec/acceptance/realtime/presence_spec.rb#L971)
1193
+ * [has no affect on the client's presence state and only enters on behalf of the provided client_id](./spec/acceptance/realtime/presence_spec.rb#L1244)
1194
+ * [enters a channel and sets the data based on the provided :data option](./spec/acceptance/realtime/presence_spec.rb#L1258)
908
1195
  * message #connection_id
909
- * [matches the current client connection_id](./spec/acceptance/realtime/presence_spec.rb#L990)
1196
+ * [matches the current client connection_id](./spec/acceptance/realtime/presence_spec.rb#L1277)
910
1197
  * without necessary capabilities to enter on behalf of another client
911
- * [calls the Deferrable errback on capabilities failure](./spec/acceptance/realtime/presence_spec.rb#L1010)
1198
+ * [calls the Deferrable errback on capabilities failure](./spec/acceptance/realtime/presence_spec.rb#L1297)
912
1199
  * it should behave like a public presence method
913
- * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L54)
914
- * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L66)
915
- * [implicitly attaches the channel](./spec/acceptance/realtime/presence_spec.rb#L77)
916
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L234)
917
- * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L241)
918
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L249)
919
- * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L259)
1200
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L63)
1201
+ * [raise an exception if the channel becomes detached](./spec/acceptance/realtime/presence_spec.rb#L81)
1202
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L97)
1203
+ * [raise an exception if the channel becomes failed](./spec/acceptance/realtime/presence_spec.rb#L114)
1204
+ * [implicitly attaches the channel](./spec/acceptance/realtime/presence_spec.rb#L130)
1205
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L293)
1206
+ * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L300)
1207
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L308)
1208
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L318)
920
1209
  * when :queue_messages client option is false
921
1210
  * and connection state initialized
922
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L89)
1211
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L142)
923
1212
  * and connection state connecting
924
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L97)
1213
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L152)
925
1214
  * and connection state disconnected
926
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L110)
1215
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L167)
927
1216
  * and connection state connected
928
- * [publishes the message](./spec/acceptance/realtime/presence_spec.rb#L123)
1217
+ * [publishes the message](./spec/acceptance/realtime/presence_spec.rb#L182)
929
1218
  * with supported data payload content type
930
1219
  * JSON Object (Hash)
931
- * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L150)
1220
+ * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L209)
932
1221
  * JSON Array
933
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L160)
1222
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L219)
934
1223
  * String
935
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L170)
1224
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L229)
936
1225
  * Binary
937
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L180)
1226
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L239)
938
1227
  * with unsupported data payload content type
939
1228
  * Integer
940
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L200)
1229
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L259)
941
1230
  * Float
942
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L209)
1231
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L268)
943
1232
  * Boolean
944
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L218)
1233
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L277)
945
1234
  * False
946
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L227)
1235
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L286)
947
1236
  * if connection fails before success
948
- * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L271)
1237
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L331)
949
1238
  * it should behave like a presence on behalf of another client method
950
1239
  * :enter_client when authenticated with a wildcard client_id
951
1240
  * and a valid client_id
952
- * [succeeds](./spec/acceptance/realtime/presence_spec.rb#L302)
1241
+ * [succeeds](./spec/acceptance/realtime/presence_spec.rb#L362)
953
1242
  * and a wildcard client_id
954
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L312)
1243
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L372)
955
1244
  * and an empty client_id
956
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L319)
1245
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L379)
1246
+ * and a client_id that is not a string type
1247
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L386)
957
1248
  * :enter_client when authenticated with a valid client_id
958
1249
  * and another invalid client_id
959
1250
  * before authentication
960
- * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L335)
1251
+ * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L402)
961
1252
  * after authentication
962
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L344)
1253
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L411)
963
1254
  * and a wildcard client_id
964
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L354)
1255
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L421)
965
1256
  * and an empty client_id
966
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L361)
1257
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L428)
967
1258
  * :enter_client when anonymous and no client_id
968
1259
  * and another invalid client_id
969
1260
  * before authentication
970
- * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L377)
1261
+ * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L444)
971
1262
  * after authentication
972
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L386)
1263
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L453)
973
1264
  * and a wildcard client_id
974
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L396)
1265
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L463)
975
1266
  * and an empty client_id
976
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L403)
1267
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L470)
977
1268
  * #update_client
978
1269
  * multiple times on the same channel with different client_ids
979
- * [updates the data attribute for the member when :data option provided](./spec/acceptance/realtime/presence_spec.rb#L1024)
980
- * [updates the data attribute to null for the member when :data option is not provided (assumed null)](./spec/acceptance/realtime/presence_spec.rb#L1048)
981
- * [enters if not already entered](./spec/acceptance/realtime/presence_spec.rb#L1060)
1270
+ * [updates the data attribute for the member when :data option provided](./spec/acceptance/realtime/presence_spec.rb#L1311)
1271
+ * [updates the data attribute to null for the member when :data option is not provided (assumed null)](./spec/acceptance/realtime/presence_spec.rb#L1335)
1272
+ * [enters if not already entered](./spec/acceptance/realtime/presence_spec.rb#L1347)
982
1273
  * it should behave like a public presence method
983
- * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L54)
984
- * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L66)
985
- * [implicitly attaches the channel](./spec/acceptance/realtime/presence_spec.rb#L77)
986
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L234)
987
- * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L241)
988
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L249)
989
- * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L259)
1274
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L63)
1275
+ * [raise an exception if the channel becomes detached](./spec/acceptance/realtime/presence_spec.rb#L81)
1276
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L97)
1277
+ * [raise an exception if the channel becomes failed](./spec/acceptance/realtime/presence_spec.rb#L114)
1278
+ * [implicitly attaches the channel](./spec/acceptance/realtime/presence_spec.rb#L130)
1279
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L293)
1280
+ * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L300)
1281
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L308)
1282
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L318)
990
1283
  * when :queue_messages client option is false
991
1284
  * and connection state initialized
992
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L89)
1285
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L142)
993
1286
  * and connection state connecting
994
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L97)
1287
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L152)
995
1288
  * and connection state disconnected
996
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L110)
1289
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L167)
997
1290
  * and connection state connected
998
- * [publishes the message](./spec/acceptance/realtime/presence_spec.rb#L123)
1291
+ * [publishes the message](./spec/acceptance/realtime/presence_spec.rb#L182)
999
1292
  * with supported data payload content type
1000
1293
  * JSON Object (Hash)
1001
- * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L150)
1294
+ * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L209)
1002
1295
  * JSON Array
1003
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L160)
1296
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L219)
1004
1297
  * String
1005
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L170)
1298
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L229)
1006
1299
  * Binary
1007
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L180)
1300
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L239)
1008
1301
  * with unsupported data payload content type
1009
1302
  * Integer
1010
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L200)
1303
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L259)
1011
1304
  * Float
1012
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L209)
1305
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L268)
1013
1306
  * Boolean
1014
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L218)
1307
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L277)
1015
1308
  * False
1016
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L227)
1309
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L286)
1017
1310
  * if connection fails before success
1018
- * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L271)
1311
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L331)
1019
1312
  * it should behave like a presence on behalf of another client method
1020
1313
  * :update_client when authenticated with a wildcard client_id
1021
1314
  * and a valid client_id
1022
- * [succeeds](./spec/acceptance/realtime/presence_spec.rb#L302)
1315
+ * [succeeds](./spec/acceptance/realtime/presence_spec.rb#L362)
1023
1316
  * and a wildcard client_id
1024
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L312)
1317
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L372)
1025
1318
  * and an empty client_id
1026
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L319)
1319
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L379)
1320
+ * and a client_id that is not a string type
1321
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L386)
1027
1322
  * :update_client when authenticated with a valid client_id
1028
1323
  * and another invalid client_id
1029
1324
  * before authentication
1030
- * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L335)
1325
+ * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L402)
1031
1326
  * after authentication
1032
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L344)
1327
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L411)
1033
1328
  * and a wildcard client_id
1034
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L354)
1329
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L421)
1035
1330
  * and an empty client_id
1036
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L361)
1331
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L428)
1037
1332
  * :update_client when anonymous and no client_id
1038
1333
  * and another invalid client_id
1039
1334
  * before authentication
1040
- * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L377)
1335
+ * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L444)
1041
1336
  * after authentication
1042
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L386)
1337
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L453)
1043
1338
  * and a wildcard client_id
1044
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L396)
1339
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L463)
1045
1340
  * and an empty client_id
1046
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L403)
1341
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L470)
1047
1342
  * #leave_client
1048
1343
  * leaves a channel
1049
1344
  * multiple times on the same channel with different client_ids
1050
- * [emits the :leave event for each client_id](./spec/acceptance/realtime/presence_spec.rb#L1090)
1051
- * [succeeds if that client_id has not previously entered the channel](./spec/acceptance/realtime/presence_spec.rb#L1114)
1345
+ * [emits the :leave event for each client_id](./spec/acceptance/realtime/presence_spec.rb#L1377)
1346
+ * [succeeds if that client_id has not previously entered the channel](./spec/acceptance/realtime/presence_spec.rb#L1401)
1052
1347
  * with a new value in :data option
1053
- * [emits the leave event with the new data value](./spec/acceptance/realtime/presence_spec.rb#L1138)
1348
+ * [emits the leave event with the new data value](./spec/acceptance/realtime/presence_spec.rb#L1425)
1054
1349
  * with a nil value in :data option
1055
- * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L1151)
1350
+ * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L1438)
1056
1351
  * with no :data option
1057
- * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L1164)
1352
+ * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L1451)
1058
1353
  * it should behave like a public presence method
1059
- * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L54)
1060
- * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L66)
1061
- * [implicitly attaches the channel](./spec/acceptance/realtime/presence_spec.rb#L77)
1062
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L234)
1063
- * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L241)
1064
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L249)
1065
- * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L259)
1354
+ * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L63)
1355
+ * [raise an exception if the channel becomes detached](./spec/acceptance/realtime/presence_spec.rb#L81)
1356
+ * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L97)
1357
+ * [raise an exception if the channel becomes failed](./spec/acceptance/realtime/presence_spec.rb#L114)
1358
+ * [implicitly attaches the channel](./spec/acceptance/realtime/presence_spec.rb#L130)
1359
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L293)
1360
+ * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L300)
1361
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L308)
1362
+ * [catches exceptions in the provided method block and logs them to the logger](./spec/acceptance/realtime/presence_spec.rb#L318)
1066
1363
  * when :queue_messages client option is false
1067
1364
  * and connection state initialized
1068
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L89)
1365
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L142)
1069
1366
  * and connection state connecting
1070
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L97)
1367
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L152)
1071
1368
  * and connection state disconnected
1072
- * [raises an exception](./spec/acceptance/realtime/presence_spec.rb#L110)
1369
+ * [fails the deferrable](./spec/acceptance/realtime/presence_spec.rb#L167)
1073
1370
  * and connection state connected
1074
- * [publishes the message](./spec/acceptance/realtime/presence_spec.rb#L123)
1371
+ * [publishes the message](./spec/acceptance/realtime/presence_spec.rb#L182)
1075
1372
  * with supported data payload content type
1076
1373
  * JSON Object (Hash)
1077
- * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L150)
1374
+ * [is encoded and decoded to the same hash](./spec/acceptance/realtime/presence_spec.rb#L209)
1078
1375
  * JSON Array
1079
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L160)
1376
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L219)
1080
1377
  * String
1081
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L170)
1378
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L229)
1082
1379
  * Binary
1083
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L180)
1380
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/presence_spec.rb#L239)
1084
1381
  * with unsupported data payload content type
1085
1382
  * Integer
1086
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L200)
1383
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L259)
1087
1384
  * Float
1088
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L209)
1385
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L268)
1089
1386
  * Boolean
1090
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L218)
1387
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L277)
1091
1388
  * False
1092
- * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L227)
1389
+ * [raises an UnsupportedDataType 40011 exception](./spec/acceptance/realtime/presence_spec.rb#L286)
1093
1390
  * if connection fails before success
1094
- * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L271)
1391
+ * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L331)
1095
1392
  * it should behave like a presence on behalf of another client method
1096
1393
  * :leave_client when authenticated with a wildcard client_id
1097
1394
  * and a valid client_id
1098
- * [succeeds](./spec/acceptance/realtime/presence_spec.rb#L302)
1395
+ * [succeeds](./spec/acceptance/realtime/presence_spec.rb#L362)
1099
1396
  * and a wildcard client_id
1100
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L312)
1397
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L372)
1101
1398
  * and an empty client_id
1102
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L319)
1399
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L379)
1400
+ * and a client_id that is not a string type
1401
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L386)
1103
1402
  * :leave_client when authenticated with a valid client_id
1104
1403
  * and another invalid client_id
1105
1404
  * before authentication
1106
- * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L335)
1405
+ * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L402)
1107
1406
  * after authentication
1108
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L344)
1407
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L411)
1109
1408
  * and a wildcard client_id
1110
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L354)
1409
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L421)
1111
1410
  * and an empty client_id
1112
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L361)
1411
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L428)
1113
1412
  * :leave_client when anonymous and no client_id
1114
1413
  * and another invalid client_id
1115
1414
  * before authentication
1116
- * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L377)
1415
+ * [allows the operation and then Ably rejects the operation](./spec/acceptance/realtime/presence_spec.rb#L444)
1117
1416
  * after authentication
1118
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L386)
1417
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L453)
1119
1418
  * and a wildcard client_id
1120
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L396)
1419
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L463)
1121
1420
  * and an empty client_id
1122
- * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L403)
1421
+ * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L470)
1123
1422
  * #get
1124
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L1183)
1125
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L1188)
1126
- * [catches exceptions in the provided method block](./spec/acceptance/realtime/presence_spec.rb#L1195)
1127
- * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L1202)
1128
- * [raise an exception if the channel is failed](./spec/acceptance/realtime/presence_spec.rb#L1212)
1129
- * [returns the current members on the channel](./spec/acceptance/realtime/presence_spec.rb#L1292)
1130
- * [filters by connection_id option if provided](./spec/acceptance/realtime/presence_spec.rb#L1307)
1131
- * [filters by client_id option if provided](./spec/acceptance/realtime/presence_spec.rb#L1329)
1132
- * [does not wait for SYNC to complete if :wait_for_sync option is false](./spec/acceptance/realtime/presence_spec.rb#L1353)
1423
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L1470)
1424
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L1475)
1425
+ * [catches exceptions in the provided method block](./spec/acceptance/realtime/presence_spec.rb#L1482)
1426
+ * [implicitly attaches the channel (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1490)
1427
+ * [fails if the connection is DETACHED (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1524)
1428
+ * [fails if the connection is FAILED (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1539)
1429
+ * [returns the current members on the channel (#RTP11a)](./spec/acceptance/realtime/presence_spec.rb#L1623)
1430
+ * [filters by connection_id option if provided (#RTP11c3)](./spec/acceptance/realtime/presence_spec.rb#L1638)
1431
+ * [filters by client_id option if provided (#RTP11c2)](./spec/acceptance/realtime/presence_spec.rb#L1660)
1432
+ * [does not wait for SYNC to complete if :wait_for_sync option is false (#RTP11c1)](./spec/acceptance/realtime/presence_spec.rb#L1684)
1433
+ * [returns the list of members and waits for SYNC to complete by default (#RTP11a)](./spec/acceptance/realtime/presence_spec.rb#L1693)
1434
+ * when the channel is SUSPENDED
1435
+ * with wait_for_sync: true
1436
+ * [returns the current PresenceMap and does not wait for the channel to change to the ATTACHED state (#RTP11d)](./spec/acceptance/realtime/presence_spec.rb#L1500)
1437
+ * with wait_for_sync: false
1438
+ * [returns the current PresenceMap and does not wait for the channel to change to the ATTACHED state (#RTP11d)](./spec/acceptance/realtime/presence_spec.rb#L1512)
1133
1439
  * during a sync
1134
1440
  * when :wait_for_sync is true
1135
- * [fails if the connection fails](./spec/acceptance/realtime/presence_spec.rb#L1243)
1136
- * [fails if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L1266)
1441
+ * [fails if the connection becomes FAILED (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1576)
1442
+ * [fails if the channel becomes detached (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1599)
1137
1443
  * when a member enters and then leaves
1138
- * [has no members](./spec/acceptance/realtime/presence_spec.rb#L1363)
1444
+ * [has no members](./spec/acceptance/realtime/presence_spec.rb#L1703)
1445
+ * when a member enters and the presence map is updated
1446
+ * [adds the member as being :present (#RTP2d)](./spec/acceptance/realtime/presence_spec.rb#L1716)
1139
1447
  * with lots of members on different clients
1140
- * [returns a complete list of members on all clients](./spec/acceptance/realtime/presence_spec.rb#L1382)
1448
+ * [returns a complete list of members on all clients](./spec/acceptance/realtime/presence_spec.rb#L1734)
1141
1449
  * #subscribe
1142
- * [implicitly attaches](./spec/acceptance/realtime/presence_spec.rb#L1457)
1450
+ * [implicitly attaches](./spec/acceptance/realtime/presence_spec.rb#L1809)
1143
1451
  * with no arguments
1144
- * [calls the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L1418)
1452
+ * [calls the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L1770)
1145
1453
  * with event name
1146
- * [calls the callback for specified presence event](./spec/acceptance/realtime/presence_spec.rb#L1438)
1454
+ * [calls the callback for specified presence event](./spec/acceptance/realtime/presence_spec.rb#L1790)
1455
+ * with a callback that raises an exception
1456
+ * [logs the error and continues](./spec/acceptance/realtime/presence_spec.rb#L1822)
1147
1457
  * #unsubscribe
1148
1458
  * with no arguments
1149
- * [removes the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L1470)
1459
+ * [removes the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L1843)
1150
1460
  * with event name
1151
- * [removes the callback for specified presence event](./spec/acceptance/realtime/presence_spec.rb#L1488)
1461
+ * [removes the callback for specified presence event](./spec/acceptance/realtime/presence_spec.rb#L1861)
1152
1462
  * REST #get
1153
- * [returns current members](./spec/acceptance/realtime/presence_spec.rb#L1507)
1154
- * [returns no members once left](./spec/acceptance/realtime/presence_spec.rb#L1520)
1463
+ * [returns current members](./spec/acceptance/realtime/presence_spec.rb#L1880)
1464
+ * [returns no members once left](./spec/acceptance/realtime/presence_spec.rb#L1893)
1155
1465
  * client_id with ASCII_8BIT
1156
1466
  * in connection set up
1157
- * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L1537)
1467
+ * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L1910)
1158
1468
  * in channel options
1159
- * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L1550)
1469
+ * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L1923)
1160
1470
  * encoding and decoding of presence message data
1161
- * [encrypts presence message data](./spec/acceptance/realtime/presence_spec.rb#L1576)
1471
+ * [encrypts presence message data](./spec/acceptance/realtime/presence_spec.rb#L1949)
1162
1472
  * #subscribe
1163
- * [emits decrypted enter events](./spec/acceptance/realtime/presence_spec.rb#L1595)
1164
- * [emits decrypted update events](./spec/acceptance/realtime/presence_spec.rb#L1607)
1165
- * [emits previously set data for leave events](./spec/acceptance/realtime/presence_spec.rb#L1621)
1473
+ * [emits decrypted enter events](./spec/acceptance/realtime/presence_spec.rb#L1968)
1474
+ * [emits decrypted update events](./spec/acceptance/realtime/presence_spec.rb#L1980)
1475
+ * [emits previously set data for leave events](./spec/acceptance/realtime/presence_spec.rb#L1994)
1166
1476
  * #get
1167
- * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L1637)
1477
+ * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L2010)
1168
1478
  * REST #get
1169
- * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L1650)
1479
+ * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L2023)
1170
1480
  * when cipher settings do not match publisher
1171
- * [delivers an unencoded presence message left with encoding value](./spec/acceptance/realtime/presence_spec.rb#L1665)
1172
- * [emits an error when cipher does not match and presence data cannot be decoded](./spec/acceptance/realtime/presence_spec.rb#L1678)
1481
+ * [delivers an unencoded presence message left with encoding value](./spec/acceptance/realtime/presence_spec.rb#L2038)
1482
+ * [emits an error when cipher does not match and presence data cannot be decoded](./spec/acceptance/realtime/presence_spec.rb#L2051)
1173
1483
  * leaving
1174
- * [expect :left event once underlying connection is closed](./spec/acceptance/realtime/presence_spec.rb#L1695)
1175
- * [expect :left event with client data from enter event](./spec/acceptance/realtime/presence_spec.rb#L1705)
1484
+ * [expect :left event once underlying connection is closed](./spec/acceptance/realtime/presence_spec.rb#L2067)
1485
+ * [expect :left event with client data from enter event](./spec/acceptance/realtime/presence_spec.rb#L2077)
1176
1486
  * connection failure mid-way through a large member sync
1177
- * [resumes the SYNC operation](./spec/acceptance/realtime/presence_spec.rb#L1724)
1487
+ * [resumes the SYNC operation (#RTP3)](./spec/acceptance/realtime/presence_spec.rb#L2096)
1488
+ * server-initiated sync
1489
+ * with multiple SYNC pages
1490
+ * [is initiated with a SYNC message and completed with a later SYNC message with no cursor value part of the channelSerial (#RTP18a, #RTP18b) ](./spec/acceptance/realtime/presence_spec.rb#L2134)
1491
+ * with a single SYNC page
1492
+ * [is initiated and completed with a single SYNC message (and no channelSerial) (#RTP18a, #RTP18c) ](./spec/acceptance/realtime/presence_spec.rb#L2185)
1493
+ * when members exist in the PresenceMap before a SYNC completes
1494
+ * [removes the members that are no longer present (#RTP19)](./spec/acceptance/realtime/presence_spec.rb#L2233)
1495
+ * when the client does not have presence subscribe privileges but is present on the channel
1496
+ * PENDING: *[receives presence updates for all presence events generated by the current connection and the presence map is kept up to date (#RTP17a)](./spec/acceptance/realtime/presence_spec.rb#L2291)*
1497
+ * local PresenceMap for presence members entered by this client
1498
+ * [maintains a copy of the member map for any member that shares this connection's connection ID (#RTP17)](./spec/acceptance/realtime/presence_spec.rb#L2328)
1499
+ * when a channel becomes attached again
1500
+ * and the resume flag is true
1501
+ * and the presence flag is false
1502
+ * [does not send any presence events as the PresenceMap is in sync (#RTP5c1)](./spec/acceptance/realtime/presence_spec.rb#L2368)
1503
+ * and the presence flag is true
1504
+ * and following the SYNC all local MemberMap members are present in the PresenceMap
1505
+ * [does nothing as MemberMap is in sync (#RTP5c2)](./spec/acceptance/realtime/presence_spec.rb#L2395)
1506
+ * and following the SYNC a local MemberMap member is not present in the PresenceMap
1507
+ * [re-enters the missing members automatically (#RTP5c2)](./spec/acceptance/realtime/presence_spec.rb#L2431)
1508
+ * and the resume flag is false
1509
+ * and the presence flag is false
1510
+ * [immediately resends all local presence members (#RTP5c2, #RTP19a)](./spec/acceptance/realtime/presence_spec.rb#L2511)
1511
+ * when re-entering a client automatically, if the re-enter fails for any reason
1512
+ * [should emit an ErrorInfo with error code 91004 (#RTP5c3)](./spec/acceptance/realtime/presence_spec.rb#L2559)
1513
+ * channel state side effects
1514
+ * channel transitions to the FAILED state
1515
+ * [clears the PresenceMap and local member map copy and does not emit any presence events (#RTP5a)](./spec/acceptance/realtime/presence_spec.rb#L2616)
1516
+ * channel transitions to the DETACHED state
1517
+ * [clears the PresenceMap and local member map copy and does not emit any presence events (#RTP5a)](./spec/acceptance/realtime/presence_spec.rb#L2640)
1518
+ * channel transitions to the SUSPENDED state
1519
+ * [maintains the PresenceMap and only publishes presence event changes since the last attached state (#RTP5f)](./spec/acceptance/realtime/presence_spec.rb#L2673)
1178
1520
 
1179
1521
  ### Ably::Realtime::Client#stats
1180
1522
  _(see [spec/acceptance/realtime/stats_spec.rb](./spec/acceptance/realtime/stats_spec.rb))_
@@ -1216,7 +1558,7 @@ _(see [spec/acceptance/rest/auth_spec.rb](./spec/acceptance/rest/auth_spec.rb))_
1216
1558
  * with :key_name & :key_secret options
1217
1559
  * [key_name is used in request and signing uses key_secret](./spec/acceptance/rest/auth_spec.rb#L177)
1218
1560
  * with :query_time option
1219
- * [queries the server for the time](./spec/acceptance/rest/auth_spec.rb#L185)
1561
+ * [queries the server for the time (#RSA10k)](./spec/acceptance/rest/auth_spec.rb#L185)
1220
1562
  * without :query_time option
1221
1563
  * [does not query the server for the time](./spec/acceptance/rest/auth_spec.rb#L194)
1222
1564
  * with :auth_url option merging
@@ -1254,13 +1596,13 @@ _(see [spec/acceptance/rest/auth_spec.rb](./spec/acceptance/rest/auth_spec.rb))_
1254
1596
  * that returns a TokenRequest
1255
1597
  * [calls the Proc with token_params when authenticating to obtain the request token](./spec/acceptance/rest/auth_spec.rb#L440)
1256
1598
  * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L444)
1257
- * when authorised
1599
+ * when authorized
1258
1600
  * [sets Auth#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L451)
1259
1601
  * [sets Client#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L455)
1260
1602
  * that returns a TokenDetails JSON object
1261
1603
  * [calls the Proc when authenticating to obtain the request token](./spec/acceptance/rest/auth_spec.rb#L489)
1262
1604
  * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L494)
1263
- * when authorised
1605
+ * when authorized
1264
1606
  * [sets Auth#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L506)
1265
1607
  * [sets Client#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L510)
1266
1608
  * that returns a TokenDetails object
@@ -1271,106 +1613,131 @@ _(see [spec/acceptance/rest/auth_spec.rb](./spec/acceptance/rest/auth_spec.rb))_
1271
1613
  * [returns a token with the client_id](./spec/acceptance/rest/auth_spec.rb#L571)
1272
1614
  * with token_param :client_id
1273
1615
  * [returns a token with the client_id](./spec/acceptance/rest/auth_spec.rb#L580)
1274
- * before #authorise has been called
1616
+ * before #authorize has been called
1275
1617
  * [has no current_token_details](./spec/acceptance/rest/auth_spec.rb#L587)
1276
- * #authorise
1277
- * [updates the persisted token params that are then used for subsequent authorise requests](./spec/acceptance/rest/auth_spec.rb#L637)
1278
- * [updates the persisted token params that are then used for subsequent authorise requests](./spec/acceptance/rest/auth_spec.rb#L643)
1618
+ * #authorize (#RSA10, #RSA10j)
1619
+ * [updates the persisted token params that are then used for subsequent authorize requests](./spec/acceptance/rest/auth_spec.rb#L754)
1620
+ * [updates the persisted auth options that are then used for subsequent authorize requests](./spec/acceptance/rest/auth_spec.rb#L760)
1279
1621
  * when called for the first time since the client has been instantiated
1280
1622
  * [passes all auth_options and token_params to #request_token](./spec/acceptance/rest/auth_spec.rb#L601)
1281
1623
  * [returns a valid token](./spec/acceptance/rest/auth_spec.rb#L606)
1282
- * [issues a new token if option :force => true](./spec/acceptance/rest/auth_spec.rb#L610)
1624
+ * [issues a new token every time (#RSA10a)](./spec/acceptance/rest/auth_spec.rb#L610)
1625
+ * query_time: true with authorize
1626
+ * [only queries the server time once and then works out the offset, query_time option is never persisted (#RSA10k)](./spec/acceptance/rest/auth_spec.rb#L624)
1627
+ * query_time: true ClientOption when instanced
1628
+ * [only queries the server time once and then works out the offset, query_time option is never persisted (#RSA10k)](./spec/acceptance/rest/auth_spec.rb#L644)
1629
+ * TokenParams argument
1630
+ * [has no effect on the defaults when null and TokenParam defaults remain the same](./spec/acceptance/rest/auth_spec.rb#L661)
1631
+ * [updates defaults when present and all previous configured TokenParams are discarded (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L668)
1632
+ * [updates Auth#token_params attribute with an immutable hash](./spec/acceptance/rest/auth_spec.rb#L676)
1633
+ * [uses TokenParams#timestamp for this request but obtains a new timestamp for subsequence requests (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L681)
1634
+ * AuthOptions argument
1635
+ * [has no effect on the defaults when null and AuthOptions defaults remain the same](./spec/acceptance/rest/auth_spec.rb#L706)
1636
+ * [updates defaults when present and all previous configured AuthOptions are discarded (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L712)
1637
+ * [updates Auth#options attribute with an immutable hash](./spec/acceptance/rest/auth_spec.rb#L719)
1638
+ * [uses AuthOptions#query_time for this request and will not query_time for subsequent requests (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L724)
1639
+ * [uses AuthOptions#query_time for this request and will query_time again if provided subsequently](./spec/acceptance/rest/auth_spec.rb#L730)
1283
1640
  * with previous authorisation
1284
- * [does not request a token if current_token_details has not expired](./spec/acceptance/rest/auth_spec.rb#L621)
1285
- * [requests a new token if token is expired](./spec/acceptance/rest/auth_spec.rb#L626)
1286
- * [issues a new token if option :force => true](./spec/acceptance/rest/auth_spec.rb#L632)
1641
+ * [requests a new token if token is expired](./spec/acceptance/rest/auth_spec.rb#L743)
1642
+ * [issues a new token every time #authorize is called](./spec/acceptance/rest/auth_spec.rb#L749)
1287
1643
  * with a Proc for the :auth_callback option
1288
- * [calls the Proc](./spec/acceptance/rest/auth_spec.rb#L659)
1289
- * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L663)
1644
+ * [calls the Proc](./spec/acceptance/rest/auth_spec.rb#L776)
1645
+ * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L780)
1290
1646
  * for every subsequent #request_token
1291
1647
  * without a :auth_callback Proc
1292
- * [calls the originally provided block](./spec/acceptance/rest/auth_spec.rb#L669)
1648
+ * [calls the originally provided block](./spec/acceptance/rest/auth_spec.rb#L786)
1293
1649
  * with a provided block
1294
- * [does not call the originally provided Proc and calls the new #request_token :auth_callback Proc](./spec/acceptance/rest/auth_spec.rb#L676)
1650
+ * [does not call the originally provided Proc and calls the new #request_token :auth_callback Proc](./spec/acceptance/rest/auth_spec.rb#L793)
1295
1651
  * with an explicit token string that expires
1296
1652
  * and a Proc for the :auth_callback option to provide a means to renew the token
1297
- * [calls the Proc once the token has expired and the new token is used](./spec/acceptance/rest/auth_spec.rb#L703)
1653
+ * [calls the Proc once the token has expired and the new token is used](./spec/acceptance/rest/auth_spec.rb#L820)
1298
1654
  * with an explicit ClientOptions client_id
1299
1655
  * and an incompatible client_id in a TokenDetails object passed to the auth callback
1300
- * [rejects a TokenDetails object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L721)
1656
+ * [rejects a TokenDetails object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L838)
1301
1657
  * and an incompatible client_id in a TokenRequest object passed to the auth callback and raises an exception
1302
- * [rejects a TokenRequests object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L729)
1658
+ * [rejects a TokenRequests object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L846)
1303
1659
  * and a token string without any retrievable client_id
1304
- * [rejects a TokenRequests object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L737)
1660
+ * [rejects a TokenRequests object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L854)
1305
1661
  * #create_token_request
1306
- * [returns a TokenRequest object](./spec/acceptance/rest/auth_spec.rb#L752)
1307
- * [returns a TokenRequest that can be passed to a client that can use it for authentication without an API key](./spec/acceptance/rest/auth_spec.rb#L756)
1308
- * [uses the key name from the client](./spec/acceptance/rest/auth_spec.rb#L763)
1309
- * [uses the default TTL](./spec/acceptance/rest/auth_spec.rb#L767)
1310
- * [uses the default capability](./spec/acceptance/rest/auth_spec.rb#L780)
1662
+ * [returns a TokenRequest object](./spec/acceptance/rest/auth_spec.rb#L869)
1663
+ * [returns a TokenRequest that can be passed to a client that can use it for authentication without an API key](./spec/acceptance/rest/auth_spec.rb#L873)
1664
+ * [uses the key name from the client](./spec/acceptance/rest/auth_spec.rb#L880)
1665
+ * [uses the default TTL](./spec/acceptance/rest/auth_spec.rb#L884)
1666
+ * [uses the default capability](./spec/acceptance/rest/auth_spec.rb#L897)
1311
1667
  * with a :ttl option below the Token expiry buffer that ensures tokens are renewed 15s before they expire as they are considered expired
1312
- * [uses the Token expiry buffer default + 10s to allow for a token request in flight](./spec/acceptance/rest/auth_spec.rb#L774)
1668
+ * [uses the Token expiry buffer default + 10s to allow for a token request in flight](./spec/acceptance/rest/auth_spec.rb#L891)
1313
1669
  * the nonce
1314
- * [is unique for every request](./spec/acceptance/rest/auth_spec.rb#L785)
1315
- * [is at least 16 characters](./spec/acceptance/rest/auth_spec.rb#L790)
1670
+ * [is unique for every request](./spec/acceptance/rest/auth_spec.rb#L902)
1671
+ * [is at least 16 characters](./spec/acceptance/rest/auth_spec.rb#L907)
1316
1672
  * with token param :ttl
1317
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L801)
1673
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L918)
1318
1674
  * with token param :nonce
1319
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L801)
1675
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L918)
1320
1676
  * with token param :client_id
1321
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L801)
1677
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L918)
1322
1678
  * when specifying capability
1323
- * [overrides the default](./spec/acceptance/rest/auth_spec.rb#L812)
1324
- * [uses these capabilities when Ably issues an actual token](./spec/acceptance/rest/auth_spec.rb#L816)
1679
+ * [overrides the default](./spec/acceptance/rest/auth_spec.rb#L929)
1680
+ * [uses these capabilities when Ably issues an actual token](./spec/acceptance/rest/auth_spec.rb#L933)
1325
1681
  * with additional invalid attributes
1326
- * [are ignored](./spec/acceptance/rest/auth_spec.rb#L826)
1682
+ * [are ignored](./spec/acceptance/rest/auth_spec.rb#L943)
1327
1683
  * when required fields are missing
1328
- * [should raise an exception if key secret is missing](./spec/acceptance/rest/auth_spec.rb#L837)
1329
- * [should raise an exception if key name is missing](./spec/acceptance/rest/auth_spec.rb#L841)
1684
+ * [should raise an exception if key secret is missing](./spec/acceptance/rest/auth_spec.rb#L954)
1685
+ * [should raise an exception if key name is missing](./spec/acceptance/rest/auth_spec.rb#L958)
1330
1686
  * timestamp attribute
1331
- * [is a Time object in Ruby and is set to the local time](./spec/acceptance/rest/auth_spec.rb#L868)
1687
+ * [is a Time object in Ruby and is set to the local time](./spec/acceptance/rest/auth_spec.rb#L985)
1332
1688
  * with :query_time auth_option
1333
- * [queries the server for the timestamp](./spec/acceptance/rest/auth_spec.rb#L853)
1689
+ * [queries the server for the timestamp](./spec/acceptance/rest/auth_spec.rb#L970)
1334
1690
  * with :timestamp option
1335
- * [uses the provided timestamp in the token request](./spec/acceptance/rest/auth_spec.rb#L863)
1691
+ * [uses the provided timestamp in the token request](./spec/acceptance/rest/auth_spec.rb#L980)
1336
1692
  * signing
1337
- * [generates a valid HMAC](./spec/acceptance/rest/auth_spec.rb#L892)
1693
+ * [generates a valid HMAC](./spec/acceptance/rest/auth_spec.rb#L1009)
1694
+ * lexicographic ordering of channels and operations
1695
+ * [HMAC is lexicographic ordered and thus the HMAC is identical](./spec/acceptance/rest/auth_spec.rb#L1036)
1696
+ * [is valid when used for authentication](./spec/acceptance/rest/auth_spec.rb#L1042)
1338
1697
  * using token authentication
1339
1698
  * with :token option
1340
- * [authenticates successfully using the provided :token](./spec/acceptance/rest/auth_spec.rb#L915)
1341
- * [disallows publishing on unspecified capability channels](./spec/acceptance/rest/auth_spec.rb#L919)
1342
- * [fails if timestamp is invalid](./spec/acceptance/rest/auth_spec.rb#L927)
1343
- * [cannot be renewed automatically](./spec/acceptance/rest/auth_spec.rb#L935)
1699
+ * [authenticates successfully using the provided :token](./spec/acceptance/rest/auth_spec.rb#L1069)
1700
+ * [disallows publishing on unspecified capability channels](./spec/acceptance/rest/auth_spec.rb#L1073)
1701
+ * [fails if timestamp is invalid](./spec/acceptance/rest/auth_spec.rb#L1081)
1702
+ * [cannot be renewed automatically](./spec/acceptance/rest/auth_spec.rb#L1089)
1703
+ * and the token expires
1704
+ * [should indicate an error and not retry the request (#RSA4a)](./spec/acceptance/rest/auth_spec.rb#L1123)
1344
1705
  * when implicit as a result of using :client_id
1345
1706
  * and requests to the Ably server are mocked
1346
- * [will send a token request to the server](./spec/acceptance/rest/auth_spec.rb#L963)
1707
+ * [will send a token request to the server](./spec/acceptance/rest/auth_spec.rb#L1153)
1347
1708
  * a token is created
1348
- * [before a request is made](./spec/acceptance/rest/auth_spec.rb#L972)
1349
- * [when a message is published](./spec/acceptance/rest/auth_spec.rb#L976)
1350
- * [with capability and TTL defaults](./spec/acceptance/rest/auth_spec.rb#L980)
1351
- * [#client_id contains the client_id](./spec/acceptance/rest/auth_spec.rb#L991)
1709
+ * [before a request is made](./spec/acceptance/rest/auth_spec.rb#L1162)
1710
+ * [when a message is published](./spec/acceptance/rest/auth_spec.rb#L1166)
1711
+ * [with capability and TTL defaults](./spec/acceptance/rest/auth_spec.rb#L1170)
1712
+ * [#client_id contains the client_id](./spec/acceptance/rest/auth_spec.rb#L1181)
1713
+ * when token expires
1714
+ * [automatically renews the token (#RSA4b)](./spec/acceptance/rest/auth_spec.rb#L1210)
1715
+ * [fails if the token renewal fails (#RSA4b)](./spec/acceptance/rest/auth_spec.rb#L1220)
1352
1716
  * when :client_id is provided in a token
1353
- * [#client_id contains the client_id](./spec/acceptance/rest/auth_spec.rb#L1006)
1717
+ * [#client_id contains the client_id](./spec/acceptance/rest/auth_spec.rb#L1244)
1354
1718
  * #client_id_validated?
1355
1719
  * when using basic auth
1356
- * [is false as basic auth users do not have an identity](./spec/acceptance/rest/auth_spec.rb#L1018)
1720
+ * [is false as basic auth users do not have an identity](./spec/acceptance/rest/auth_spec.rb#L1256)
1357
1721
  * when using a token auth string for a token with a client_id
1358
- * [is false as identification is not possible from an opaque token string](./spec/acceptance/rest/auth_spec.rb#L1026)
1722
+ * [is false as identification is not possible from an opaque token string](./spec/acceptance/rest/auth_spec.rb#L1264)
1359
1723
  * when using a token
1360
1724
  * with a client_id
1361
- * [is true](./spec/acceptance/rest/auth_spec.rb#L1035)
1725
+ * [is true](./spec/acceptance/rest/auth_spec.rb#L1273)
1362
1726
  * with no client_id (anonymous)
1363
- * [is true](./spec/acceptance/rest/auth_spec.rb#L1043)
1727
+ * [is true](./spec/acceptance/rest/auth_spec.rb#L1281)
1364
1728
  * with a wildcard client_id (anonymous)
1365
- * [is false](./spec/acceptance/rest/auth_spec.rb#L1051)
1729
+ * [is false](./spec/acceptance/rest/auth_spec.rb#L1289)
1366
1730
  * when using a token request with a client_id
1367
- * [is not true as identification is not confirmed until authenticated](./spec/acceptance/rest/auth_spec.rb#L1060)
1731
+ * [is not true as identification is not confirmed until authenticated](./spec/acceptance/rest/auth_spec.rb#L1298)
1368
1732
  * after authentication
1369
- * [is true as identification is completed during implicit authentication](./spec/acceptance/rest/auth_spec.rb#L1067)
1733
+ * [is true as identification is completed during implicit authentication](./spec/acceptance/rest/auth_spec.rb#L1305)
1370
1734
  * when using a :key and basic auth
1371
- * [#using_token_auth? is false](./spec/acceptance/rest/auth_spec.rb#L1075)
1372
- * [#key attribute contains the key string](./spec/acceptance/rest/auth_spec.rb#L1079)
1373
- * [#using_basic_auth? is true](./spec/acceptance/rest/auth_spec.rb#L1083)
1735
+ * [#using_token_auth? is false](./spec/acceptance/rest/auth_spec.rb#L1313)
1736
+ * [#key attribute contains the key string](./spec/acceptance/rest/auth_spec.rb#L1317)
1737
+ * [#using_basic_auth? is true](./spec/acceptance/rest/auth_spec.rb#L1321)
1738
+ * deprecated #authorise
1739
+ * [logs a deprecation warning (#RSA10l)](./spec/acceptance/rest/auth_spec.rb#L1357)
1740
+ * [returns a valid token (#RSA10l)](./spec/acceptance/rest/auth_spec.rb#L1362)
1374
1741
 
1375
1742
  ### Ably::Rest
1376
1743
  _(see [spec/acceptance/rest/base_spec.rb](./spec/acceptance/rest/base_spec.rb))_
@@ -1471,18 +1838,18 @@ _(see [spec/acceptance/rest/channel_spec.rb](./spec/acceptance/rest/channel_spec
1471
1838
  * #history option
1472
1839
  * :start
1473
1840
  * with milliseconds since epoch value
1474
- * [uses this value in the history request](./spec/acceptance/rest/channel_spec.rb#L392)
1841
+ * [uses this value in the history request](./spec/acceptance/rest/channel_spec.rb#L389)
1475
1842
  * with a Time object value
1476
- * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/channel_spec.rb#L402)
1843
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/channel_spec.rb#L399)
1477
1844
  * :end
1478
1845
  * with milliseconds since epoch value
1479
- * [uses this value in the history request](./spec/acceptance/rest/channel_spec.rb#L392)
1846
+ * [uses this value in the history request](./spec/acceptance/rest/channel_spec.rb#L389)
1480
1847
  * with a Time object value
1481
- * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/channel_spec.rb#L402)
1848
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/channel_spec.rb#L399)
1482
1849
  * when argument start is after end
1483
- * [should raise an exception](./spec/acceptance/rest/channel_spec.rb#L412)
1850
+ * [should raise an exception](./spec/acceptance/rest/channel_spec.rb#L409)
1484
1851
  * #presence
1485
- * [returns a REST Presence object](./spec/acceptance/rest/channel_spec.rb#L422)
1852
+ * [returns a REST Presence object](./spec/acceptance/rest/channel_spec.rb#L419)
1486
1853
 
1487
1854
  ### Ably::Rest::Channels
1488
1855
  _(see [spec/acceptance/rest/channels_spec.rb](./spec/acceptance/rest/channels_spec.rb))_
@@ -1509,94 +1876,132 @@ _(see [spec/acceptance/rest/client_spec.rb](./spec/acceptance/rest/client_spec.r
1509
1876
  * using JSON protocol
1510
1877
  * #initialize
1511
1878
  * with only an API key
1512
- * [uses basic authentication](./spec/acceptance/rest/client_spec.rb#L24)
1879
+ * [uses basic authentication](./spec/acceptance/rest/client_spec.rb#L25)
1513
1880
  * with an explicit string :token
1514
- * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L32)
1881
+ * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L33)
1515
1882
  * with :use_token_auth set to true
1516
- * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L40)
1883
+ * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L41)
1517
1884
  * with a :client_id configured
1518
- * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L48)
1885
+ * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L49)
1886
+ * with a non string :client_id
1887
+ * [raises an ArgumentError](./spec/acceptance/rest/client_spec.rb#L57)
1519
1888
  * with an invalid wildcard "*" :client_id
1520
- * [raises an exception](./spec/acceptance/rest/client_spec.rb#L54)
1889
+ * [raises an exception](./spec/acceptance/rest/client_spec.rb#L63)
1521
1890
  * with an :auth_callback Proc
1522
- * [calls the auth Proc to get a new token](./spec/acceptance/rest/client_spec.rb#L62)
1523
- * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L67)
1891
+ * [calls the auth Proc to get a new token](./spec/acceptance/rest/client_spec.rb#L71)
1892
+ * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L76)
1893
+ * with :default_token_params
1894
+ * [overides the default token params (#TO3j11)](./spec/acceptance/rest/client_spec.rb#L90)
1524
1895
  * with an :auth_callback Proc (clientId provided in library options instead of as a token_request param)
1525
- * [correctly sets the clientId on the token](./spec/acceptance/rest/client_spec.rb#L76)
1896
+ * [correctly sets the clientId on the token](./spec/acceptance/rest/client_spec.rb#L100)
1526
1897
  * with an auth URL
1527
- * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L86)
1898
+ * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L110)
1528
1899
  * before any REST request
1529
- * [sends an HTTP request to the provided auth URL to get a new token](./spec/acceptance/rest/client_spec.rb#L97)
1900
+ * [sends an HTTP request to the provided auth URL to get a new token](./spec/acceptance/rest/client_spec.rb#L121)
1530
1901
  * auth headers
1531
1902
  * with basic auth
1532
- * [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)](./spec/acceptance/rest/client_spec.rb#L117)
1903
+ * [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)](./spec/acceptance/rest/client_spec.rb#L141)
1533
1904
  * with token auth
1534
1905
  * without specifying protocol
1535
- * [sends the token string over HTTPS in the Authorization Bearer header with Base64 encoding](./spec/acceptance/rest/client_spec.rb#L136)
1906
+ * [sends the token string over HTTPS in the Authorization Bearer header with Base64 encoding](./spec/acceptance/rest/client_spec.rb#L160)
1536
1907
  * when setting constructor ClientOption :tls to false
1537
- * [sends the token string over HTTP in the Authorization Bearer header with Base64 encoding](./spec/acceptance/rest/client_spec.rb#L146)
1908
+ * [sends the token string over HTTP in the Authorization Bearer header with Base64 encoding](./spec/acceptance/rest/client_spec.rb#L170)
1538
1909
  * using tokens
1539
1910
  * when expired
1540
- * [creates a new token automatically when the old token expires](./spec/acceptance/rest/client_spec.rb#L179)
1911
+ * [creates a new token automatically when the old token expires](./spec/acceptance/rest/client_spec.rb#L203)
1541
1912
  * with a different client_id in the subsequent token
1542
- * [fails to authenticate and raises an exception](./spec/acceptance/rest/client_spec.rb#L192)
1913
+ * [fails to authenticate and raises an exception](./spec/acceptance/rest/client_spec.rb#L216)
1543
1914
  * when token has not expired
1544
- * [reuses the existing token for every request](./spec/acceptance/rest/client_spec.rb#L203)
1915
+ * [reuses the existing token for every request](./spec/acceptance/rest/client_spec.rb#L227)
1545
1916
  * connection transport
1546
1917
  * defaults
1547
1918
  * for default host
1548
- * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L220)
1549
- * [is configured to timeout connection requests in 15 seconds](./spec/acceptance/rest/client_spec.rb#L224)
1919
+ * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L244)
1920
+ * [is configured to timeout connection requests in 15 seconds](./spec/acceptance/rest/client_spec.rb#L248)
1550
1921
  * for the fallback hosts
1551
- * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L230)
1552
- * [is configured to timeout connection requests in 15 seconds](./spec/acceptance/rest/client_spec.rb#L234)
1922
+ * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L254)
1923
+ * [is configured to timeout connection requests in 15 seconds](./spec/acceptance/rest/client_spec.rb#L258)
1553
1924
  * with custom http_open_timeout and http_request_timeout options
1554
1925
  * for default host
1555
- * [is configured to use custom open timeout](./spec/acceptance/rest/client_spec.rb#L246)
1556
- * [is configured to use custom request timeout](./spec/acceptance/rest/client_spec.rb#L250)
1926
+ * [is configured to use custom open timeout](./spec/acceptance/rest/client_spec.rb#L270)
1927
+ * [is configured to use custom request timeout](./spec/acceptance/rest/client_spec.rb#L274)
1557
1928
  * for the fallback hosts
1558
- * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L256)
1559
- * [is configured to timeout connection requests in 15 seconds](./spec/acceptance/rest/client_spec.rb#L260)
1929
+ * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L280)
1930
+ * [is configured to timeout connection requests in 15 seconds](./spec/acceptance/rest/client_spec.rb#L284)
1560
1931
  * fallback hosts
1561
1932
  * configured
1562
- * [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](./spec/acceptance/rest/client_spec.rb#L274)
1563
- * when environment is NOT production
1564
- * [does not retry failed requests with fallback hosts when there is a connection error](./spec/acceptance/rest/client_spec.rb#L291)
1933
+ * [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)](./spec/acceptance/rest/client_spec.rb#L298)
1934
+ * when environment is NOT production (#RSC15b)
1935
+ * [does not retry failed requests with fallback hosts when there is a connection error](./spec/acceptance/rest/client_spec.rb#L315)
1565
1936
  * when environment is production
1566
1937
  * and connection times out
1567
- * [tries fallback hosts 3 times](./spec/acceptance/rest/client_spec.rb#L329)
1938
+ * [tries fallback hosts 3 times (#RSC15b, #RSC15b)](./spec/acceptance/rest/client_spec.rb#L354)
1568
1939
  * and the total request time exeeds 10 seconds
1569
- * [makes no further attempts to any fallback hosts](./spec/acceptance/rest/client_spec.rb#L344)
1940
+ * [makes no further attempts to any fallback hosts](./spec/acceptance/rest/client_spec.rb#L369)
1570
1941
  * and connection fails
1571
- * [tries fallback hosts 3 times](./spec/acceptance/rest/client_spec.rb#L360)
1942
+ * [tries fallback hosts 3 times](./spec/acceptance/rest/client_spec.rb#L385)
1943
+ * and first request to primary endpoint fails
1944
+ * [tries a fallback host, and for the next request tries the primary endpoint again (#RSC15e)](./spec/acceptance/rest/client_spec.rb#L419)
1572
1945
  * and basic authentication fails
1573
- * [does not attempt the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L384)
1946
+ * [does not attempt the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L446)
1574
1947
  * and server returns a 50x error
1575
- * [attempts the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L406)
1948
+ * [attempts the fallback hosts as this is an authentication failure (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L468)
1949
+ * when environment is production and server returns a 50x error
1950
+ * with custom fallback hosts provided
1951
+ * [attempts the fallback hosts as this is an authentication failure (#RSC15b, #RSC15a, #TO3k6)](./spec/acceptance/rest/client_spec.rb#L517)
1952
+ * with an empty array of fallback hosts provided (#RSC15b, #RSC15a, #TO3k6)
1953
+ * [does not attempt the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L530)
1954
+ * using a local web-server
1955
+ * and timing out the primary host
1956
+ * with request timeout less than max_retry_duration
1957
+ * [tries one of the fallback hosts (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L586)
1958
+ * with request timeout less than max_retry_duration
1959
+ * [tries one of the fallback hosts (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L608)
1960
+ * and failing the primary host
1961
+ * [tries one of the fallback hosts](./spec/acceptance/rest/client_spec.rb#L652)
1962
+ * when environment is not production and server returns a 50x error
1963
+ * with custom fallback hosts provided (#RSC15b, #TO3k6)
1964
+ * [attempts the fallback hosts as this is not an authentication failure](./spec/acceptance/rest/client_spec.rb#L702)
1965
+ * with an empty array of fallback hosts provided (#RSC15b, #TO3k6)
1966
+ * [does not attempt the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L715)
1967
+ * with fallback_hosts_use_default: true (#RSC15b, #TO3k7)
1968
+ * [attempts the default fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L740)
1576
1969
  * with a custom host
1577
1970
  * that does not exist
1578
- * [fails immediately and raises a Faraday Error](./spec/acceptance/rest/client_spec.rb#L422)
1971
+ * [fails immediately and raises a Faraday Error](./spec/acceptance/rest/client_spec.rb#L756)
1579
1972
  * fallback hosts
1580
- * [are never used](./spec/acceptance/rest/client_spec.rb#L443)
1973
+ * [are never used](./spec/acceptance/rest/client_spec.rb#L777)
1581
1974
  * that times out
1582
- * [fails immediately and raises a Faraday Error](./spec/acceptance/rest/client_spec.rb#L458)
1975
+ * [fails immediately and raises a Faraday Error](./spec/acceptance/rest/client_spec.rb#L792)
1583
1976
  * fallback hosts
1584
- * [are never used](./spec/acceptance/rest/client_spec.rb#L471)
1977
+ * [are never used](./spec/acceptance/rest/client_spec.rb#L805)
1585
1978
  * HTTP configuration options
1586
- * [is frozen](./spec/acceptance/rest/client_spec.rb#L528)
1979
+ * [is frozen](./spec/acceptance/rest/client_spec.rb#L862)
1587
1980
  * defaults
1588
- * [#http_open_timeout is 4s](./spec/acceptance/rest/client_spec.rb#L483)
1589
- * [#http_request_timeout is 15s](./spec/acceptance/rest/client_spec.rb#L487)
1590
- * [#http_max_retry_count is 3](./spec/acceptance/rest/client_spec.rb#L491)
1591
- * [#http_max_retry_duration is 10s](./spec/acceptance/rest/client_spec.rb#L495)
1981
+ * [#http_open_timeout is 4s](./spec/acceptance/rest/client_spec.rb#L817)
1982
+ * [#http_request_timeout is 15s](./spec/acceptance/rest/client_spec.rb#L821)
1983
+ * [#http_max_retry_count is 3](./spec/acceptance/rest/client_spec.rb#L825)
1984
+ * [#http_max_retry_duration is 10s](./spec/acceptance/rest/client_spec.rb#L829)
1592
1985
  * configured
1593
- * [#http_open_timeout uses provided value](./spec/acceptance/rest/client_spec.rb#L511)
1594
- * [#http_request_timeout uses provided value](./spec/acceptance/rest/client_spec.rb#L515)
1595
- * [#http_max_retry_count uses provided value](./spec/acceptance/rest/client_spec.rb#L519)
1596
- * [#http_max_retry_duration uses provided value](./spec/acceptance/rest/client_spec.rb#L523)
1986
+ * [#http_open_timeout uses provided value](./spec/acceptance/rest/client_spec.rb#L845)
1987
+ * [#http_request_timeout uses provided value](./spec/acceptance/rest/client_spec.rb#L849)
1988
+ * [#http_max_retry_count uses provided value](./spec/acceptance/rest/client_spec.rb#L853)
1989
+ * [#http_max_retry_duration uses provided value](./spec/acceptance/rest/client_spec.rb#L857)
1597
1990
  * #auth
1598
- * [is provides access to the Auth object](./spec/acceptance/rest/client_spec.rb#L539)
1599
- * [configures the Auth object with all ClientOptions passed to client in the initializer](./spec/acceptance/rest/client_spec.rb#L543)
1991
+ * [is provides access to the Auth object](./spec/acceptance/rest/client_spec.rb#L873)
1992
+ * [configures the Auth object with all ClientOptions passed to client in the initializer](./spec/acceptance/rest/client_spec.rb#L877)
1993
+ * version headers
1994
+ * with variant none
1995
+ * [sends a protocol version and lib version header (#G4, #RSC7a, #RSC7b)](./spec/acceptance/rest/client_spec.rb#L911)
1996
+ * with variant foo
1997
+ * [sends a protocol version and lib version header (#G4, #RSC7a, #RSC7b)](./spec/acceptance/rest/client_spec.rb#L911)
1998
+ * #request (#RSC19*)
1999
+ * get
2000
+ * [returns an HttpPaginatedResponse object](./spec/acceptance/rest/client_spec.rb#L924)
2001
+ * 404 request to invalid URL
2002
+ * [returns an object with 404 status code and error message](./spec/acceptance/rest/client_spec.rb#L931)
2003
+ * paged results
2004
+ * [provides paging](./spec/acceptance/rest/client_spec.rb#L943)
1600
2005
 
1601
2006
  ### Ably::Models::MessageEncoders
1602
2007
  _(see [spec/acceptance/rest/encoders_spec.rb](./spec/acceptance/rest/encoders_spec.rb))_
@@ -1645,68 +2050,75 @@ _(see [spec/acceptance/rest/message_spec.rb](./spec/acceptance/rest/message_spec
1645
2050
  * [is encoded and decoded to the same Array](./spec/acceptance/rest/message_spec.rb#L48)
1646
2051
  * Binary
1647
2052
  * [is encoded and decoded to the same Array](./spec/acceptance/rest/message_spec.rb#L57)
2053
+ * with supported extra payload content type (#RSL1h, #RSL6a2)
2054
+ * JSON Object (Hash)
2055
+ * PENDING: *[is encoded and decoded to the same hash](./spec/acceptance/rest/message_spec.rb#L68)*
2056
+ * JSON Array
2057
+ * PENDING: *[is encoded and decoded to the same Array](./spec/acceptance/rest/message_spec.rb#L78)*
2058
+ * nil
2059
+ * [is encoded and decoded to the same Array](./spec/acceptance/rest/message_spec.rb#L86)
1648
2060
  * with unsupported data payload content type
1649
2061
  * Integer
1650
- * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/rest/message_spec.rb#L68)
2062
+ * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/rest/message_spec.rb#L97)
1651
2063
  * Float
1652
- * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/rest/message_spec.rb#L76)
2064
+ * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/rest/message_spec.rb#L105)
1653
2065
  * Boolean
1654
- * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/rest/message_spec.rb#L84)
2066
+ * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/rest/message_spec.rb#L113)
1655
2067
  * False
1656
- * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/rest/message_spec.rb#L92)
2068
+ * [is raises an UnsupportedDataType 40011 exception](./spec/acceptance/rest/message_spec.rb#L121)
1657
2069
  * encryption and encoding
1658
2070
  * with #publish and #history
1659
- * with AES-128-CBC using crypto-data-128.json fixtures
2071
+ * with AES-128-CBC using crypto-data-128.json fixtures (#RTL7d)
1660
2072
  * item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
1661
2073
  * behaves like an Ably encrypter and decrypter
1662
- * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L137)
1663
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L152)
2074
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L166)
2075
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L181)
1664
2076
  * item 1 with encrypted encoding cipher+aes-128-cbc/base64
1665
2077
  * behaves like an Ably encrypter and decrypter
1666
- * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L137)
1667
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L152)
2078
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L166)
2079
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L181)
1668
2080
  * item 2 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
1669
2081
  * behaves like an Ably encrypter and decrypter
1670
- * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L137)
1671
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L152)
2082
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L166)
2083
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L181)
1672
2084
  * item 3 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
1673
2085
  * behaves like an Ably encrypter and decrypter
1674
- * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L137)
1675
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L152)
1676
- * with AES-256-CBC using crypto-data-256.json fixtures
2086
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L166)
2087
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L181)
2088
+ * with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d)
1677
2089
  * item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
1678
2090
  * behaves like an Ably encrypter and decrypter
1679
- * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L137)
1680
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L152)
2091
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L166)
2092
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L181)
1681
2093
  * item 1 with encrypted encoding cipher+aes-256-cbc/base64
1682
2094
  * behaves like an Ably encrypter and decrypter
1683
- * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L137)
1684
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L152)
2095
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L166)
2096
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L181)
1685
2097
  * item 2 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
1686
2098
  * behaves like an Ably encrypter and decrypter
1687
- * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L137)
1688
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L152)
2099
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L166)
2100
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L181)
1689
2101
  * item 3 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
1690
2102
  * behaves like an Ably encrypter and decrypter
1691
- * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L137)
1692
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L152)
2103
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L166)
2104
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L181)
1693
2105
  * when publishing lots of messages
1694
- * [encrypts on #publish and decrypts on #history](./spec/acceptance/rest/message_spec.rb#L185)
2106
+ * [encrypts on #publish and decrypts on #history](./spec/acceptance/rest/message_spec.rb#L214)
1695
2107
  * when retrieving #history with a different protocol
1696
- * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/rest/message_spec.rb#L212)
1697
- * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/rest/message_spec.rb#L212)
1698
- * [delivers a Hash payload to the receiver](./spec/acceptance/rest/message_spec.rb#L212)
2108
+ * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/rest/message_spec.rb#L241)
2109
+ * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/rest/message_spec.rb#L241)
2110
+ * [delivers a Hash payload to the receiver](./spec/acceptance/rest/message_spec.rb#L241)
1699
2111
  * when publishing on an unencrypted channel and retrieving with #history on an encrypted channel
1700
- * [does not attempt to decrypt the message](./spec/acceptance/rest/message_spec.rb#L228)
2112
+ * [does not attempt to decrypt the message](./spec/acceptance/rest/message_spec.rb#L257)
1701
2113
  * when publishing on an encrypted channel and retrieving with #history on an unencrypted channel
1702
- * [retrieves the message that remains encrypted with an encrypted encoding attribute](./spec/acceptance/rest/message_spec.rb#L249)
1703
- * [logs a Cipher exception](./spec/acceptance/rest/message_spec.rb#L255)
1704
- * publishing on an encrypted channel and retrieving #history with a different algorithm on another client
1705
- * [retrieves the message that remains encrypted with an encrypted encoding attribute](./spec/acceptance/rest/message_spec.rb#L276)
1706
- * [logs a Cipher exception](./spec/acceptance/rest/message_spec.rb#L282)
2114
+ * [retrieves the message that remains encrypted with an encrypted encoding attribute (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L278)
2115
+ * [logs a Cipher exception (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L284)
2116
+ * publishing on an encrypted channel and retrieving #history with a different algorithm on another client (#RTL7e)
2117
+ * [retrieves the message that remains encrypted with an encrypted encoding attribute (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L305)
2118
+ * [logs a Cipher exception (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L311)
1707
2119
  * publishing on an encrypted channel and subscribing with a different key on another client
1708
- * [retrieves the message that remains encrypted with an encrypted encoding attribute](./spec/acceptance/rest/message_spec.rb#L303)
1709
- * [logs a Cipher exception](./spec/acceptance/rest/message_spec.rb#L309)
2120
+ * [retrieves the message that remains encrypted with an encrypted encoding attribute](./spec/acceptance/rest/message_spec.rb#L332)
2121
+ * [logs a Cipher exception](./spec/acceptance/rest/message_spec.rb#L338)
1710
2122
 
1711
2123
  ### Ably::Rest::Presence
1712
2124
  _(see [spec/acceptance/rest/presence_spec.rb](./spec/acceptance/rest/presence_spec.rb))_
@@ -1717,60 +2129,60 @@ _(see [spec/acceptance/rest/presence_spec.rb](./spec/acceptance/rest/presence_sp
1717
2129
  * with :limit option
1718
2130
  * [returns a paged response limiting number of members per page](./spec/acceptance/rest/presence_spec.rb#L57)
1719
2131
  * default :limit
1720
- * [defaults to a limit of 100](./spec/acceptance/rest/presence_spec.rb#L89)
2132
+ * [defaults to a limit of 100](./spec/acceptance/rest/presence_spec.rb#L86)
1721
2133
  * with :client_id option
1722
- * [returns a list members filtered by the provided client ID](./spec/acceptance/rest/presence_spec.rb#L98)
2134
+ * [returns a list members filtered by the provided client ID](./spec/acceptance/rest/presence_spec.rb#L95)
1723
2135
  * with :connection_id option
1724
- * [returns a list members filtered by the provided connection ID](./spec/acceptance/rest/presence_spec.rb#L109)
1725
- * [returns a list members filtered by the provided connection ID](./spec/acceptance/rest/presence_spec.rb#L113)
2136
+ * [returns a list members filtered by the provided connection ID](./spec/acceptance/rest/presence_spec.rb#L106)
2137
+ * [returns a list members filtered by the provided connection ID](./spec/acceptance/rest/presence_spec.rb#L110)
1726
2138
  * #history
1727
- * [returns recent presence activity](./spec/acceptance/rest/presence_spec.rb#L122)
2139
+ * [returns recent presence activity](./spec/acceptance/rest/presence_spec.rb#L119)
1728
2140
  * default behaviour
1729
- * [uses backwards direction](./spec/acceptance/rest/presence_spec.rb#L137)
2141
+ * [uses backwards direction](./spec/acceptance/rest/presence_spec.rb#L134)
1730
2142
  * with options
1731
2143
  * direction: :forwards
1732
- * [returns recent presence activity forwards with most recent history last](./spec/acceptance/rest/presence_spec.rb#L149)
2144
+ * [returns recent presence activity forwards with most recent history last](./spec/acceptance/rest/presence_spec.rb#L146)
1733
2145
  * direction: :backwards
1734
- * [returns recent presence activity backwards with most recent history first](./spec/acceptance/rest/presence_spec.rb#L164)
2146
+ * [returns recent presence activity backwards with most recent history first](./spec/acceptance/rest/presence_spec.rb#L161)
1735
2147
  * #history
1736
2148
  * with options
1737
2149
  * limit options
1738
2150
  * default
1739
- * [is set to 100](./spec/acceptance/rest/presence_spec.rb#L212)
2151
+ * [is set to 100](./spec/acceptance/rest/presence_spec.rb#L206)
1740
2152
  * set to 1000
1741
- * [is passes the limit query param value 1000](./spec/acceptance/rest/presence_spec.rb#L225)
2153
+ * [is passes the limit query param value 1000](./spec/acceptance/rest/presence_spec.rb#L219)
1742
2154
  * with time range options
1743
2155
  * :start
1744
2156
  * with milliseconds since epoch value
1745
- * [uses this value in the history request](./spec/acceptance/rest/presence_spec.rb#L255)
2157
+ * [uses this value in the history request](./spec/acceptance/rest/presence_spec.rb#L249)
1746
2158
  * with Time object value
1747
- * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/presence_spec.rb#L265)
2159
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/presence_spec.rb#L259)
1748
2160
  * :end
1749
2161
  * with milliseconds since epoch value
1750
- * [uses this value in the history request](./spec/acceptance/rest/presence_spec.rb#L255)
2162
+ * [uses this value in the history request](./spec/acceptance/rest/presence_spec.rb#L249)
1751
2163
  * with Time object value
1752
- * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/presence_spec.rb#L265)
2164
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/presence_spec.rb#L259)
1753
2165
  * when argument start is after end
1754
- * [should raise an exception](./spec/acceptance/rest/presence_spec.rb#L276)
2166
+ * [should raise an exception](./spec/acceptance/rest/presence_spec.rb#L270)
1755
2167
  * decoding
1756
2168
  * with encoded fixture data
1757
2169
  * #history
1758
- * [decodes encoded and encryped presence fixture data automatically](./spec/acceptance/rest/presence_spec.rb#L295)
2170
+ * [decodes encoded and encryped presence fixture data automatically](./spec/acceptance/rest/presence_spec.rb#L289)
1759
2171
  * #get
1760
- * [decodes encoded and encryped presence fixture data automatically](./spec/acceptance/rest/presence_spec.rb#L302)
2172
+ * [decodes encoded and encryped presence fixture data automatically](./spec/acceptance/rest/presence_spec.rb#L296)
1761
2173
  * decoding permutations using mocked #history
1762
2174
  * valid decodeable content
1763
2175
  * #get
1764
- * [automaticaly decodes presence messages](./spec/acceptance/rest/presence_spec.rb#L358)
2176
+ * [automaticaly decodes presence messages](./spec/acceptance/rest/presence_spec.rb#L349)
1765
2177
  * #history
1766
- * [automaticaly decodes presence messages](./spec/acceptance/rest/presence_spec.rb#L375)
2178
+ * [automaticaly decodes presence messages](./spec/acceptance/rest/presence_spec.rb#L366)
1767
2179
  * invalid data
1768
2180
  * #get
1769
- * [returns the messages still encoded](./spec/acceptance/rest/presence_spec.rb#L406)
1770
- * [logs a cipher error](./spec/acceptance/rest/presence_spec.rb#L410)
2181
+ * [returns the messages still encoded](./spec/acceptance/rest/presence_spec.rb#L397)
2182
+ * [logs a cipher error](./spec/acceptance/rest/presence_spec.rb#L401)
1771
2183
  * #history
1772
- * [returns the messages still encoded](./spec/acceptance/rest/presence_spec.rb#L430)
1773
- * [logs a cipher error](./spec/acceptance/rest/presence_spec.rb#L434)
2184
+ * [returns the messages still encoded](./spec/acceptance/rest/presence_spec.rb#L421)
2185
+ * [logs a cipher error](./spec/acceptance/rest/presence_spec.rb#L425)
1774
2186
 
1775
2187
  ### Ably::Rest::Client#stats
1776
2188
  _(see [spec/acceptance/rest/stats_spec.rb](./spec/acceptance/rest/stats_spec.rb))_
@@ -1850,23 +2262,51 @@ _(see [spec/unit/logger_spec.rb](./spec/unit/logger_spec.rb))_
1850
2262
  * [uses the language provided Logger by default](./spec/unit/logger_spec.rb#L15)
1851
2263
  * with a custom Logger
1852
2264
  * with an invalid interface
1853
- * [raises an exception](./spec/unit/logger_spec.rb#L116)
2265
+ * [raises an exception](./spec/unit/logger_spec.rb#L118)
1854
2266
  * with a valid interface
1855
- * [is used](./spec/unit/logger_spec.rb#L135)
2267
+ * [is used](./spec/unit/logger_spec.rb#L137)
2268
+ * with blocks
2269
+ * [does not call the block unless the log level is met](./spec/unit/logger_spec.rb#L152)
2270
+ * with an exception in the logger block
2271
+ * [catches the error and continues](./spec/unit/logger_spec.rb#L167)
2272
+
2273
+ ### Ably::Models::AuthDetails
2274
+ _(see [spec/unit/models/auth_details_spec.rb](./spec/unit/models/auth_details_spec.rb))_
2275
+ * behaves like a model
2276
+ * attributes
2277
+ * #access_token
2278
+ * [retrieves attribute :access_token](./spec/shared/model_behaviour.rb#L15)
2279
+ * #==
2280
+ * [is true when attributes are the same](./spec/shared/model_behaviour.rb#L41)
2281
+ * [is false when attributes are not the same](./spec/shared/model_behaviour.rb#L46)
2282
+ * [is false when class type differs](./spec/shared/model_behaviour.rb#L50)
2283
+ * is immutable
2284
+ * [prevents changes](./spec/shared/model_behaviour.rb#L76)
2285
+ * [dups options](./spec/shared/model_behaviour.rb#L80)
2286
+ * ==
2287
+ * [is true when attributes are the same](./spec/unit/models/auth_details_spec.rb#L17)
2288
+ * [is false when attributes are not the same](./spec/unit/models/auth_details_spec.rb#L22)
2289
+ * [is false when class type differs](./spec/unit/models/auth_details_spec.rb#L26)
1856
2290
 
1857
2291
  ### Ably::Models::ChannelStateChange
1858
2292
  _(see [spec/unit/models/channel_state_change_spec.rb](./spec/unit/models/channel_state_change_spec.rb))_
1859
- * #current
2293
+ * #current (#TH1)
1860
2294
  * [is required](./spec/unit/models/channel_state_change_spec.rb#L10)
1861
2295
  * [is an attribute](./spec/unit/models/channel_state_change_spec.rb#L14)
1862
- * #previous
2296
+ * #previous (#TH2)
1863
2297
  * [is required](./spec/unit/models/channel_state_change_spec.rb#L20)
1864
2298
  * [is an attribute](./spec/unit/models/channel_state_change_spec.rb#L24)
1865
- * #reason
2299
+ * #event (#TH5)
1866
2300
  * [is not required](./spec/unit/models/channel_state_change_spec.rb#L30)
1867
2301
  * [is an attribute](./spec/unit/models/channel_state_change_spec.rb#L34)
2302
+ * #reason (#TH3)
2303
+ * [is not required](./spec/unit/models/channel_state_change_spec.rb#L40)
2304
+ * [is an attribute](./spec/unit/models/channel_state_change_spec.rb#L44)
2305
+ * #resumed (#TH4)
2306
+ * [is false when ommitted](./spec/unit/models/channel_state_change_spec.rb#L50)
2307
+ * [is true when provided](./spec/unit/models/channel_state_change_spec.rb#L54)
1868
2308
  * invalid attributes
1869
- * [raises an argument error](./spec/unit/models/channel_state_change_spec.rb#L40)
2309
+ * [raises an argument error](./spec/unit/models/channel_state_change_spec.rb#L60)
1870
2310
 
1871
2311
  ### Ably::Models::CipherParams
1872
2312
  _(see [spec/unit/models/cipher_params_spec.rb](./spec/unit/models/cipher_params_spec.rb))_
@@ -1929,29 +2369,34 @@ _(see [spec/unit/models/connection_details_spec.rb](./spec/unit/models/connectio
1929
2369
  * [prevents changes](./spec/shared/model_behaviour.rb#L76)
1930
2370
  * [dups options](./spec/shared/model_behaviour.rb#L80)
1931
2371
  * attributes
1932
- * #connection_state_ttl
1933
- * [retrieves attribute :connection_state_ttl and converts it from ms to s](./spec/unit/models/connection_details_spec.rb#L19)
2372
+ * #connection_state_ttl (#CD2f)
2373
+ * [retrieves attribute :connection_state_ttl and converts it from ms to s](./spec/unit/models/connection_details_spec.rb#L20)
2374
+ * #max_idle_interval (#CD2h)
2375
+ * [retrieves attribute :max_idle_interval and converts it from ms to s](./spec/unit/models/connection_details_spec.rb#L30)
1934
2376
  * ==
1935
- * [is true when attributes are the same](./spec/unit/models/connection_details_spec.rb#L28)
1936
- * [is false when attributes are not the same](./spec/unit/models/connection_details_spec.rb#L33)
1937
- * [is false when class type differs](./spec/unit/models/connection_details_spec.rb#L37)
2377
+ * [is true when attributes are the same](./spec/unit/models/connection_details_spec.rb#L39)
2378
+ * [is false when attributes are not the same](./spec/unit/models/connection_details_spec.rb#L44)
2379
+ * [is false when class type differs](./spec/unit/models/connection_details_spec.rb#L48)
1938
2380
 
1939
2381
  ### Ably::Models::ConnectionStateChange
1940
2382
  _(see [spec/unit/models/connection_state_change_spec.rb](./spec/unit/models/connection_state_change_spec.rb))_
1941
- * #current
2383
+ * #current (#TA2)
1942
2384
  * [is required](./spec/unit/models/connection_state_change_spec.rb#L10)
1943
2385
  * [is an attribute](./spec/unit/models/connection_state_change_spec.rb#L14)
1944
- * #previous
2386
+ * #previous(#TA2)
1945
2387
  * [is required](./spec/unit/models/connection_state_change_spec.rb#L20)
1946
2388
  * [is an attribute](./spec/unit/models/connection_state_change_spec.rb#L24)
1947
- * #retry_in
2389
+ * #event(#TA5)
1948
2390
  * [is not required](./spec/unit/models/connection_state_change_spec.rb#L30)
1949
2391
  * [is an attribute](./spec/unit/models/connection_state_change_spec.rb#L34)
1950
- * #reason
1951
- * [is not required](./spec/unit/models/connection_state_change_spec.rb#L40)
1952
- * [is an attribute](./spec/unit/models/connection_state_change_spec.rb#L44)
2392
+ * #retry_in (#TA2)
2393
+ * [is not required](./spec/unit/models/connection_state_change_spec.rb#L41)
2394
+ * [is an attribute](./spec/unit/models/connection_state_change_spec.rb#L45)
2395
+ * #reason (#TA3)
2396
+ * [is not required](./spec/unit/models/connection_state_change_spec.rb#L51)
2397
+ * [is an attribute](./spec/unit/models/connection_state_change_spec.rb#L55)
1953
2398
  * invalid attributes
1954
- * [raises an argument error](./spec/unit/models/connection_state_change_spec.rb#L50)
2399
+ * [raises an argument error](./spec/unit/models/connection_state_change_spec.rb#L61)
1955
2400
 
1956
2401
  ### Ably::Models::ErrorInfo
1957
2402
  _(see [spec/unit/models/error_info_spec.rb](./spec/unit/models/error_info_spec.rb))_
@@ -1973,6 +2418,60 @@ _(see [spec/unit/models/error_info_spec.rb](./spec/unit/models/error_info_spec.r
1973
2418
  * #status
1974
2419
  * [is an alias for #status_code](./spec/unit/models/error_info_spec.rb#L13)
1975
2420
 
2421
+ ### Ably::Models::HttpPaginatedResponse: #HP1 -> #HP8
2422
+ _(see [spec/unit/models/http_paginated_result_spec.rb](./spec/unit/models/http_paginated_result_spec.rb))_
2423
+ * #items
2424
+ * [returns correct length from body](./spec/unit/models/http_paginated_result_spec.rb#L33)
2425
+ * [is Enumerable](./spec/unit/models/http_paginated_result_spec.rb#L37)
2426
+ * [is iterable](./spec/unit/models/http_paginated_result_spec.rb#L41)
2427
+ * [provides [] accessor method](./spec/unit/models/http_paginated_result_spec.rb#L59)
2428
+ * [#first gets the first item in page](./spec/unit/models/http_paginated_result_spec.rb#L65)
2429
+ * [#last gets the last item in page](./spec/unit/models/http_paginated_result_spec.rb#L69)
2430
+ * #each
2431
+ * [returns an enumerator](./spec/unit/models/http_paginated_result_spec.rb#L46)
2432
+ * [yields each item](./spec/unit/models/http_paginated_result_spec.rb#L50)
2433
+ * with non paged http response
2434
+ * [is the last page](./spec/unit/models/http_paginated_result_spec.rb#L174)
2435
+ * [does not have next page](./spec/unit/models/http_paginated_result_spec.rb#L178)
2436
+ * [does not support pagination](./spec/unit/models/http_paginated_result_spec.rb#L182)
2437
+ * [returns nil when accessing next page](./spec/unit/models/http_paginated_result_spec.rb#L186)
2438
+ * [returns nil when accessing first page](./spec/unit/models/http_paginated_result_spec.rb#L190)
2439
+ * with paged http response
2440
+ * [has next page](./spec/unit/models/http_paginated_result_spec.rb#L208)
2441
+ * [is not the last page](./spec/unit/models/http_paginated_result_spec.rb#L212)
2442
+ * [supports pagination](./spec/unit/models/http_paginated_result_spec.rb#L216)
2443
+ * accessing next page
2444
+ * [returns another HttpPaginatedResponse](./spec/unit/models/http_paginated_result_spec.rb#L244)
2445
+ * [retrieves the next page of results](./spec/unit/models/http_paginated_result_spec.rb#L248)
2446
+ * [does not have a next page](./spec/unit/models/http_paginated_result_spec.rb#L253)
2447
+ * [is the last page](./spec/unit/models/http_paginated_result_spec.rb#L257)
2448
+ * [returns nil when trying to access the last page when it is the last page](./spec/unit/models/http_paginated_result_spec.rb#L261)
2449
+ * and then first page
2450
+ * [returns a HttpPaginatedResponse](./spec/unit/models/http_paginated_result_spec.rb#L272)
2451
+ * [retrieves the first page of results](./spec/unit/models/http_paginated_result_spec.rb#L276)
2452
+ * response metadata
2453
+ * successful response
2454
+ * [#success? is true](./spec/unit/models/http_paginated_result_spec.rb#L288)
2455
+ * [#status_code reflects status code](./spec/unit/models/http_paginated_result_spec.rb#L292)
2456
+ * [#error_code to be empty](./spec/unit/models/http_paginated_result_spec.rb#L296)
2457
+ * [#error_message to be empty](./spec/unit/models/http_paginated_result_spec.rb#L300)
2458
+ * [#headers to be a hash](./spec/unit/models/http_paginated_result_spec.rb#L304)
2459
+ * failed response
2460
+ * [#success? is false](./spec/unit/models/http_paginated_result_spec.rb#L313)
2461
+ * [#status_code reflects status code](./spec/unit/models/http_paginated_result_spec.rb#L317)
2462
+ * [#error_code to be populated](./spec/unit/models/http_paginated_result_spec.rb#L321)
2463
+ * [#error_message to be populated](./spec/unit/models/http_paginated_result_spec.rb#L325)
2464
+ * [#headers to be present](./spec/unit/models/http_paginated_result_spec.rb#L329)
2465
+ * #items Array conversion and nil handling #HP3
2466
+ * with Json Array
2467
+ * [is an array](./spec/unit/models/http_paginated_result_spec.rb#L344)
2468
+ * with Json Object
2469
+ * [is an array](./spec/unit/models/http_paginated_result_spec.rb#L354)
2470
+ * with empty response
2471
+ * [is an array](./spec/unit/models/http_paginated_result_spec.rb#L365)
2472
+ * with nil response
2473
+ * [is an array](./spec/unit/models/http_paginated_result_spec.rb#L375)
2474
+
1976
2475
  ### Ably::Models::MessageEncoders::Base64
1977
2476
  _(see [spec/unit/models/message_encoders/base64_spec.rb](./spec/unit/models/message_encoders/base64_spec.rb))_
1978
2477
  * #decode
@@ -1988,33 +2487,33 @@ _(see [spec/unit/models/message_encoders/base64_spec.rb](./spec/unit/models/mess
1988
2487
  * #encode
1989
2488
  * over binary transport
1990
2489
  * message with binary payload
1991
- * [leaves the message data intact as Base64 encoding is not necessary](./spec/unit/models/message_encoders/base64_spec.rb#L68)
1992
- * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L72)
2490
+ * [leaves the message data intact as Base64 encoding is not necessary](./spec/unit/models/message_encoders/base64_spec.rb#L69)
2491
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L73)
1993
2492
  * already encoded message with binary payload
1994
- * [leaves the message data intact as Base64 encoding is not necessary](./spec/unit/models/message_encoders/base64_spec.rb#L80)
1995
- * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L84)
2493
+ * [leaves the message data intact as Base64 encoding is not necessary](./spec/unit/models/message_encoders/base64_spec.rb#L81)
2494
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L85)
1996
2495
  * message with UTF-8 payload
1997
- * [leaves the data intact](./spec/unit/models/message_encoders/base64_spec.rb#L92)
1998
- * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L96)
2496
+ * [leaves the data intact](./spec/unit/models/message_encoders/base64_spec.rb#L93)
2497
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L97)
1999
2498
  * message with nil payload
2000
- * [leaves the message data intact](./spec/unit/models/message_encoders/base64_spec.rb#L104)
2001
- * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L108)
2499
+ * [leaves the message data intact](./spec/unit/models/message_encoders/base64_spec.rb#L105)
2500
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L109)
2002
2501
  * message with empty binary string payload
2003
- * [leaves the message data intact](./spec/unit/models/message_encoders/base64_spec.rb#L116)
2004
- * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L120)
2502
+ * [leaves the message data intact](./spec/unit/models/message_encoders/base64_spec.rb#L117)
2503
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L121)
2005
2504
  * over text transport
2006
2505
  * message with binary payload
2007
- * [encodes binary data as base64](./spec/unit/models/message_encoders/base64_spec.rb#L135)
2008
- * [adds the encoding](./spec/unit/models/message_encoders/base64_spec.rb#L139)
2506
+ * [encodes binary data as base64](./spec/unit/models/message_encoders/base64_spec.rb#L136)
2507
+ * [adds the encoding](./spec/unit/models/message_encoders/base64_spec.rb#L140)
2009
2508
  * already encoded message with binary payload
2010
- * [encodes binary data as base64](./spec/unit/models/message_encoders/base64_spec.rb#L147)
2011
- * [adds the encoding](./spec/unit/models/message_encoders/base64_spec.rb#L151)
2509
+ * [encodes binary data as base64](./spec/unit/models/message_encoders/base64_spec.rb#L148)
2510
+ * [adds the encoding](./spec/unit/models/message_encoders/base64_spec.rb#L152)
2012
2511
  * message with UTF-8 payload
2013
- * [leaves the data intact](./spec/unit/models/message_encoders/base64_spec.rb#L159)
2014
- * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L163)
2512
+ * [leaves the data intact](./spec/unit/models/message_encoders/base64_spec.rb#L160)
2513
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L164)
2015
2514
  * message with nil payload
2016
- * [leaves the message data intact](./spec/unit/models/message_encoders/base64_spec.rb#L171)
2017
- * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L175)
2515
+ * [leaves the message data intact](./spec/unit/models/message_encoders/base64_spec.rb#L172)
2516
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L176)
2018
2517
 
2019
2518
  ### Ably::Models::MessageEncoders::Cipher
2020
2519
  _(see [spec/unit/models/message_encoders/cipher_spec.rb](./spec/unit/models/message_encoders/cipher_spec.rb))_
@@ -2150,60 +2649,88 @@ _(see [spec/unit/models/message_spec.rb](./spec/unit/models/message_spec.rb))_
2150
2649
  * [dups options](./spec/shared/model_behaviour.rb#L80)
2151
2650
  * #timestamp
2152
2651
  * [retrieves attribute :timestamp as Time object from ProtocolMessage](./spec/unit/models/message_spec.rb#L22)
2652
+ * #extras (#TM2i)
2653
+ * when missing
2654
+ * [is nil](./spec/unit/models/message_spec.rb#L33)
2655
+ * when a string
2656
+ * [raises an exception](./spec/unit/models/message_spec.rb#L40)
2657
+ * when a Hash
2658
+ * [contains a Hash Json object](./spec/unit/models/message_spec.rb#L47)
2659
+ * when a Json Array
2660
+ * [contains a Json Array object](./spec/unit/models/message_spec.rb#L54)
2153
2661
  * #connection_id attribute
2154
2662
  * when this model has a connectionId attribute
2155
2663
  * but no protocol message
2156
- * [uses the model value](./spec/unit/models/message_spec.rb#L37)
2664
+ * [uses the model value](./spec/unit/models/message_spec.rb#L69)
2157
2665
  * with a protocol message with a different connectionId
2158
- * [uses the model value](./spec/unit/models/message_spec.rb#L45)
2666
+ * [uses the model value](./spec/unit/models/message_spec.rb#L77)
2159
2667
  * when this model has no connectionId attribute
2160
2668
  * and no protocol message
2161
- * [uses the model value](./spec/unit/models/message_spec.rb#L55)
2669
+ * [uses the model value](./spec/unit/models/message_spec.rb#L87)
2162
2670
  * with a protocol message with a connectionId
2163
- * [uses the model value](./spec/unit/models/message_spec.rb#L63)
2671
+ * [uses the model value](./spec/unit/models/message_spec.rb#L95)
2164
2672
  * initialized with
2165
2673
  * :name
2166
2674
  * as UTF_8 string
2167
- * [is permitted](./spec/unit/models/message_spec.rb#L90)
2168
- * [remains as UTF-8](./spec/unit/models/message_spec.rb#L94)
2675
+ * [is permitted](./spec/unit/models/message_spec.rb#L122)
2676
+ * [remains as UTF-8](./spec/unit/models/message_spec.rb#L126)
2169
2677
  * as SHIFT_JIS string
2170
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L102)
2171
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L106)
2678
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L134)
2679
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L138)
2172
2680
  * as ASCII_8BIT string
2173
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L114)
2174
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L118)
2681
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L146)
2682
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L150)
2175
2683
  * as Integer
2176
- * [raises an argument error](./spec/unit/models/message_spec.rb#L126)
2684
+ * [raises an argument error](./spec/unit/models/message_spec.rb#L158)
2177
2685
  * as Nil
2178
- * [is permitted](./spec/unit/models/message_spec.rb#L134)
2686
+ * [is permitted](./spec/unit/models/message_spec.rb#L166)
2179
2687
  * :client_id
2180
2688
  * as UTF_8 string
2181
- * [is permitted](./spec/unit/models/message_spec.rb#L90)
2182
- * [remains as UTF-8](./spec/unit/models/message_spec.rb#L94)
2689
+ * [is permitted](./spec/unit/models/message_spec.rb#L122)
2690
+ * [remains as UTF-8](./spec/unit/models/message_spec.rb#L126)
2183
2691
  * as SHIFT_JIS string
2184
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L102)
2185
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L106)
2692
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L134)
2693
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L138)
2186
2694
  * as ASCII_8BIT string
2187
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L114)
2188
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L118)
2695
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L146)
2696
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L150)
2189
2697
  * as Integer
2190
- * [raises an argument error](./spec/unit/models/message_spec.rb#L126)
2698
+ * [raises an argument error](./spec/unit/models/message_spec.rb#L158)
2191
2699
  * as Nil
2192
- * [is permitted](./spec/unit/models/message_spec.rb#L134)
2700
+ * [is permitted](./spec/unit/models/message_spec.rb#L166)
2193
2701
  * :encoding
2194
2702
  * as UTF_8 string
2195
- * [is permitted](./spec/unit/models/message_spec.rb#L90)
2196
- * [remains as UTF-8](./spec/unit/models/message_spec.rb#L94)
2703
+ * [is permitted](./spec/unit/models/message_spec.rb#L122)
2704
+ * [remains as UTF-8](./spec/unit/models/message_spec.rb#L126)
2197
2705
  * as SHIFT_JIS string
2198
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L102)
2199
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L106)
2706
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L134)
2707
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L138)
2200
2708
  * as ASCII_8BIT string
2201
- * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L114)
2202
- * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L118)
2709
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L146)
2710
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L150)
2203
2711
  * as Integer
2204
- * [raises an argument error](./spec/unit/models/message_spec.rb#L126)
2712
+ * [raises an argument error](./spec/unit/models/message_spec.rb#L158)
2205
2713
  * as Nil
2206
- * [is permitted](./spec/unit/models/message_spec.rb#L134)
2714
+ * [is permitted](./spec/unit/models/message_spec.rb#L166)
2715
+ * #from_encoded (#TM3)
2716
+ * with no encoding
2717
+ * [returns a message object](./spec/unit/models/message_spec.rb#L422)
2718
+ * with a block
2719
+ * [does not call the block](./spec/unit/models/message_spec.rb#L430)
2720
+ * with an encoding
2721
+ * [returns a message object](./spec/unit/models/message_spec.rb#L447)
2722
+ * with a custom encoding
2723
+ * [returns a message object with the residual incompatible transforms left in the encoding property](./spec/unit/models/message_spec.rb#L462)
2724
+ * with a Cipher encoding
2725
+ * [returns a message object with the residual incompatible transforms left in the encoding property](./spec/unit/models/message_spec.rb#L481)
2726
+ * with invalid Cipher encoding
2727
+ * without a block
2728
+ * [raises an exception](./spec/unit/models/message_spec.rb#L499)
2729
+ * with a block
2730
+ * [calls the block with the exception](./spec/unit/models/message_spec.rb#L505)
2731
+ * #from_encoded_array (#TM3)
2732
+ * with no encoding
2733
+ * [returns an Array of message objects](./spec/unit/models/message_spec.rb#L524)
2207
2734
 
2208
2735
  ### Ably::Models::PaginatedResult
2209
2736
  _(see [spec/unit/models/paginated_result_spec.rb](./spec/unit/models/paginated_result_spec.rb))_
@@ -2318,6 +2845,36 @@ _(see [spec/unit/models/presence_message_spec.rb](./spec/unit/models/presence_me
2318
2845
  * [raises an argument error](./spec/unit/models/presence_message_spec.rb#L174)
2319
2846
  * as Nil
2320
2847
  * [is permitted](./spec/unit/models/presence_message_spec.rb#L182)
2848
+ * #from_encoded (#TP4)
2849
+ * with no encoding
2850
+ * [returns a presence message object](./spec/unit/models/presence_message_spec.rb#L395)
2851
+ * with a block
2852
+ * [does not call the block](./spec/unit/models/presence_message_spec.rb#L403)
2853
+ * with an encoding
2854
+ * [returns a presence message object](./spec/unit/models/presence_message_spec.rb#L420)
2855
+ * with a custom encoding
2856
+ * [returns a presence message object with the residual incompatible transforms left in the encoding property](./spec/unit/models/presence_message_spec.rb#L435)
2857
+ * with a Cipher encoding
2858
+ * [returns a presence message object with the residual incompatible transforms left in the encoding property](./spec/unit/models/presence_message_spec.rb#L454)
2859
+ * with invalid Cipher encoding
2860
+ * without a block
2861
+ * [raises an exception](./spec/unit/models/presence_message_spec.rb#L471)
2862
+ * with a block
2863
+ * [calls the block with the exception](./spec/unit/models/presence_message_spec.rb#L477)
2864
+ * #from_encoded_array (#TP4)
2865
+ * with no encoding
2866
+ * [returns an Array of presence message objects](./spec/unit/models/presence_message_spec.rb#L496)
2867
+ * #shallow_clone
2868
+ * with inherited attributes from ProtocolMessage
2869
+ * [creates a duplicate of the message without any ProtocolMessage dependency](./spec/unit/models/presence_message_spec.rb#L516)
2870
+ * with embedded attributes for all fields
2871
+ * [creates a duplicate of the message without any ProtocolMessage dependency](./spec/unit/models/presence_message_spec.rb#L530)
2872
+ * with new attributes passed in to the method
2873
+ * [creates a duplicate of the message without any ProtocolMessage dependency](./spec/unit/models/presence_message_spec.rb#L546)
2874
+ * with an invalid ProtocolMessage (missing an ID)
2875
+ * [allows an ID to be passed in to the shallow clone that takes precedence](./spec/unit/models/presence_message_spec.rb#L558)
2876
+ * with mixing of cases
2877
+ * [resolves case issues and can use camelCase or snake_case](./spec/unit/models/presence_message_spec.rb#L565)
2321
2878
 
2322
2879
  ### Ably::Models::ProtocolMessage
2323
2880
  _(see [spec/unit/models/protocol_message_spec.rb](./spec/unit/models/protocol_message_spec.rb))_
@@ -2342,73 +2899,87 @@ _(see [spec/unit/models/protocol_message_spec.rb](./spec/unit/models/protocol_me
2342
2899
  * [dups options](./spec/shared/model_behaviour.rb#L80)
2343
2900
  * attributes
2344
2901
  * #timestamp
2345
- * [retrieves attribute :timestamp as Time object](./spec/unit/models/protocol_message_spec.rb#L74)
2902
+ * [retrieves attribute :timestamp as Time object](./spec/unit/models/protocol_message_spec.rb#L75)
2346
2903
  * #count
2347
2904
  * when missing
2348
- * [is 1](./spec/unit/models/protocol_message_spec.rb#L83)
2905
+ * [is 1](./spec/unit/models/protocol_message_spec.rb#L84)
2349
2906
  * when non numeric
2350
- * [is 1](./spec/unit/models/protocol_message_spec.rb#L90)
2907
+ * [is 1](./spec/unit/models/protocol_message_spec.rb#L91)
2351
2908
  * when greater than 1
2352
- * [is the value of count](./spec/unit/models/protocol_message_spec.rb#L97)
2909
+ * [is the value of count](./spec/unit/models/protocol_message_spec.rb#L98)
2353
2910
  * #message_serial
2354
- * [converts :msg_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L105)
2911
+ * [converts :msg_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L106)
2355
2912
  * #has_message_serial?
2356
2913
  * without msg_serial
2357
- * [returns false](./spec/unit/models/protocol_message_spec.rb#L115)
2914
+ * [returns false](./spec/unit/models/protocol_message_spec.rb#L116)
2358
2915
  * with msg_serial
2359
- * [returns true](./spec/unit/models/protocol_message_spec.rb#L123)
2916
+ * [returns true](./spec/unit/models/protocol_message_spec.rb#L124)
2360
2917
  * #connection_serial
2361
- * [converts :connection_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L131)
2362
- * #flags
2918
+ * [converts :connection_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L132)
2919
+ * #flags (#TR4i)
2363
2920
  * when nil
2364
- * [is zero](./spec/unit/models/protocol_message_spec.rb#L141)
2921
+ * [is zero](./spec/unit/models/protocol_message_spec.rb#L142)
2365
2922
  * when numeric
2366
- * [is an Integer](./spec/unit/models/protocol_message_spec.rb#L149)
2367
- * when has_presence
2368
- * [#has_presence_flag? is true](./spec/unit/models/protocol_message_spec.rb#L157)
2923
+ * [is an Integer](./spec/unit/models/protocol_message_spec.rb#L150)
2924
+ * when presence flag present
2925
+ * [#has_presence_flag? is true](./spec/unit/models/protocol_message_spec.rb#L158)
2926
+ * [#has_channel_resumed_flag? is false](./spec/unit/models/protocol_message_spec.rb#L162)
2927
+ * when channel resumed flag present
2928
+ * [#has_channel_resumed_flag? is true](./spec/unit/models/protocol_message_spec.rb#L170)
2929
+ * [#has_presence_flag? is false](./spec/unit/models/protocol_message_spec.rb#L174)
2930
+ * when channel resumed and presence flags present
2931
+ * [#has_channel_resumed_flag? is true](./spec/unit/models/protocol_message_spec.rb#L182)
2932
+ * [#has_presence_flag? is true](./spec/unit/models/protocol_message_spec.rb#L186)
2369
2933
  * when has another future flag
2370
- * [#has_presence_flag? is false](./spec/unit/models/protocol_message_spec.rb#L165)
2934
+ * [#has_presence_flag? is false](./spec/unit/models/protocol_message_spec.rb#L194)
2935
+ * [#has_backlog_flag? is true](./spec/unit/models/protocol_message_spec.rb#L198)
2371
2936
  * #has_connection_serial?
2372
2937
  * without connection_serial
2373
- * [returns false](./spec/unit/models/protocol_message_spec.rb#L175)
2938
+ * [returns false](./spec/unit/models/protocol_message_spec.rb#L208)
2374
2939
  * with connection_serial
2375
- * [returns true](./spec/unit/models/protocol_message_spec.rb#L183)
2940
+ * [returns true](./spec/unit/models/protocol_message_spec.rb#L216)
2376
2941
  * #serial
2377
2942
  * with underlying msg_serial
2378
- * [converts :msg_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L192)
2943
+ * [converts :msg_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L225)
2379
2944
  * with underlying connection_serial
2380
- * [converts :connection_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L200)
2945
+ * [converts :connection_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L233)
2381
2946
  * with underlying connection_serial and msg_serial
2382
- * [prefers connection_serial and converts :connection_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L208)
2947
+ * [prefers connection_serial and converts :connection_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L241)
2383
2948
  * #has_serial?
2384
2949
  * without msg_serial or connection_serial
2385
- * [returns false](./spec/unit/models/protocol_message_spec.rb#L219)
2950
+ * [returns false](./spec/unit/models/protocol_message_spec.rb#L252)
2386
2951
  * with msg_serial
2387
- * [returns true](./spec/unit/models/protocol_message_spec.rb#L227)
2952
+ * [returns true](./spec/unit/models/protocol_message_spec.rb#L260)
2388
2953
  * with connection_serial
2389
- * [returns true](./spec/unit/models/protocol_message_spec.rb#L235)
2954
+ * [returns true](./spec/unit/models/protocol_message_spec.rb#L268)
2390
2955
  * #error
2391
2956
  * with no error attribute
2392
- * [returns nil](./spec/unit/models/protocol_message_spec.rb#L245)
2957
+ * [returns nil](./spec/unit/models/protocol_message_spec.rb#L278)
2393
2958
  * with nil error
2394
- * [returns nil](./spec/unit/models/protocol_message_spec.rb#L253)
2959
+ * [returns nil](./spec/unit/models/protocol_message_spec.rb#L286)
2395
2960
  * with error
2396
- * [returns a valid ErrorInfo object](./spec/unit/models/protocol_message_spec.rb#L261)
2397
- * #messages
2398
- * [contains Message objects](./spec/unit/models/protocol_message_spec.rb#L271)
2399
- * #presence
2400
- * [contains PresenceMessage objects](./spec/unit/models/protocol_message_spec.rb#L281)
2401
- * #connection_details
2961
+ * [returns a valid ErrorInfo object](./spec/unit/models/protocol_message_spec.rb#L294)
2962
+ * #messages (#TR4k)
2963
+ * [contains Message objects](./spec/unit/models/protocol_message_spec.rb#L304)
2964
+ * #presence (#TR4l)
2965
+ * [contains PresenceMessage objects](./spec/unit/models/protocol_message_spec.rb#L314)
2966
+ * #connection_details (#TR4o)
2967
+ * with a JSON value
2968
+ * [contains a ConnectionDetails object](./spec/unit/models/protocol_message_spec.rb#L327)
2969
+ * [contains the attributes from the JSON connectionDetails](./spec/unit/models/protocol_message_spec.rb#L331)
2970
+ * without a JSON value
2971
+ * [contains an empty ConnectionDetails object](./spec/unit/models/protocol_message_spec.rb#L340)
2972
+ * #auth (#TR4p)
2402
2973
  * with a JSON value
2403
- * [contains a ConnectionDetails object](./spec/unit/models/protocol_message_spec.rb#L294)
2404
- * [contains the attributes from the JSON connectionDetails](./spec/unit/models/protocol_message_spec.rb#L298)
2974
+ * [contains a AuthDetails object](./spec/unit/models/protocol_message_spec.rb#L354)
2975
+ * [contains the attributes from the JSON auth details](./spec/unit/models/protocol_message_spec.rb#L358)
2405
2976
  * without a JSON value
2406
- * [contains an empty ConnectionDetails object](./spec/unit/models/protocol_message_spec.rb#L307)
2407
- * #connection_key
2977
+ * [contains an empty AuthDetails object](./spec/unit/models/protocol_message_spec.rb#L366)
2978
+ * #connection_key (#TR4e)
2408
2979
  * existing only in #connection_details.connection_key
2409
- * [is returned](./spec/unit/models/protocol_message_spec.rb#L319)
2980
+ * [is returned](./spec/unit/models/protocol_message_spec.rb#L377)
2410
2981
  * existing in both #connection_key and #connection_details.connection_key
2411
- * [returns #connection_details.connection_key as #connection_key will be deprecated > 0.8](./spec/unit/models/protocol_message_spec.rb#L327)
2982
+ * [returns #connection_details.connection_key as #connection_key will be deprecated > 0.8](./spec/unit/models/protocol_message_spec.rb#L385)
2412
2983
 
2413
2984
  ### Ably::Models::Stats
2414
2985
  _(see [spec/unit/models/stats_spec.rb](./spec/unit/models/stats_spec.rb))_
@@ -2584,6 +3155,18 @@ _(see [spec/unit/models/token_details_spec.rb](./spec/unit/models/token_details_
2584
3155
  * [is true when attributes are the same](./spec/unit/models/token_details_spec.rb#L89)
2585
3156
  * [is false when attributes are not the same](./spec/unit/models/token_details_spec.rb#L94)
2586
3157
  * [is false when class type differs](./spec/unit/models/token_details_spec.rb#L98)
3158
+ * to_json
3159
+ * with all attributes and values
3160
+ * [returns all attributes](./spec/unit/models/token_details_spec.rb#L130)
3161
+ * with only a token string
3162
+ * [returns populated attributes](./spec/unit/models/token_details_spec.rb#L143)
3163
+ * from_json (#TD7)
3164
+ * with Ruby idiomatic Hash object
3165
+ * [returns a valid TokenDetails object](./spec/unit/models/token_details_spec.rb#L169)
3166
+ * with JSON-like object
3167
+ * [returns a valid TokenDetails object](./spec/unit/models/token_details_spec.rb#L192)
3168
+ * with JSON string
3169
+ * [returns a valid TokenDetails object](./spec/unit/models/token_details_spec.rb#L214)
2587
3170
 
2588
3171
  ### Ably::Models::TokenRequest
2589
3172
  _(see [spec/unit/models/token_request_spec.rb](./spec/unit/models/token_request_spec.rb))_
@@ -2623,6 +3206,13 @@ _(see [spec/unit/models/token_request_spec.rb](./spec/unit/models/token_request_
2623
3206
  * [is true when attributes are the same](./spec/unit/models/token_request_spec.rb#L78)
2624
3207
  * [is false when attributes are not the same](./spec/unit/models/token_request_spec.rb#L83)
2625
3208
  * [is false when class type differs](./spec/unit/models/token_request_spec.rb#L87)
3209
+ * from_json (#TE6)
3210
+ * with Ruby idiomatic Hash object
3211
+ * [returns a valid TokenRequest object](./spec/unit/models/token_request_spec.rb#L130)
3212
+ * with JSON-like object
3213
+ * [returns a valid TokenRequest object](./spec/unit/models/token_request_spec.rb#L152)
3214
+ * with JSON string
3215
+ * [returns a valid TokenRequest object](./spec/unit/models/token_request_spec.rb#L174)
2626
3216
 
2627
3217
  ### Ably::Modules::EventEmitter
2628
3218
  _(see [spec/unit/modules/event_emitter_spec.rb](./spec/unit/modules/event_emitter_spec.rb))_
@@ -2633,29 +3223,60 @@ _(see [spec/unit/modules/event_emitter_spec.rb](./spec/unit/modules/event_emitte
2633
3223
  * [with the same block](./spec/unit/modules/event_emitter_spec.rb#L62)
2634
3224
  * event callback changes within the callback block
2635
3225
  * when new event callbacks are added
2636
- * [is unaffected and processes the prior event callbacks once](./spec/unit/modules/event_emitter_spec.rb#L86)
2637
- * [adds them for the next emitted event](./spec/unit/modules/event_emitter_spec.rb#L92)
3226
+ * [is unaffected and processes the prior event callbacks once (#RTE6b)](./spec/unit/modules/event_emitter_spec.rb#L86)
3227
+ * [adds them for the next emitted event (#RTE6b)](./spec/unit/modules/event_emitter_spec.rb#L92)
2638
3228
  * when callbacks are removed
2639
- * [is unaffected and processes the prior event callbacks once](./spec/unit/modules/event_emitter_spec.rb#L113)
2640
- * [removes them for the next emitted event](./spec/unit/modules/event_emitter_spec.rb#L118)
2641
- * #on
2642
- * [calls the block every time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L131)
2643
- * [catches exceptions in the provided block, logs the error and continues](./spec/unit/modules/event_emitter_spec.rb#L138)
2644
- * #once
2645
- * [calls the block the first time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L160)
2646
- * [does not remove other blocks after it is called](./spec/unit/modules/event_emitter_spec.rb#L167)
2647
- * [catches exceptions in the provided block, logs the error and continues](./spec/unit/modules/event_emitter_spec.rb#L175)
3229
+ * [is unaffected and processes the prior event callbacks once (#RTE6b)](./spec/unit/modules/event_emitter_spec.rb#L113)
3230
+ * [removes them for the next emitted event (#RTE6b)](./spec/unit/modules/event_emitter_spec.rb#L118)
3231
+ * #on (#RTE3)
3232
+ * with event specified
3233
+ * [calls the block every time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L132)
3234
+ * [catches exceptions in the provided block, logs the error and continues](./spec/unit/modules/event_emitter_spec.rb#L139)
3235
+ * with no event specified
3236
+ * [calls the block every time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L149)
3237
+ * [catches exceptions in the provided block, logs the error and continues](./spec/unit/modules/event_emitter_spec.rb#L156)
3238
+ * #once (#RTE4)
3239
+ * with event specified
3240
+ * [calls the block the first time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L182)
3241
+ * [does not remove other blocks after it is called](./spec/unit/modules/event_emitter_spec.rb#L189)
3242
+ * [catches exceptions in the provided block, logs the error and continues](./spec/unit/modules/event_emitter_spec.rb#L197)
3243
+ * with no event specified
3244
+ * [calls the block the first time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L207)
3245
+ * [does not remove other blocks after it is called](./spec/unit/modules/event_emitter_spec.rb#L214)
3246
+ * [catches exceptions in the provided block, logs the error and continues](./spec/unit/modules/event_emitter_spec.rb#L222)
2648
3247
  * #unsafe_once
2649
- * [calls the block the first time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L183)
2650
- * [does not catch exceptions in provided blocks](./spec/unit/modules/event_emitter_spec.rb#L190)
3248
+ * [calls the block the first time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L233)
3249
+ * [does not catch exceptions in provided blocks](./spec/unit/modules/event_emitter_spec.rb#L240)
2651
3250
  * #off
2652
- * with event names as arguments
2653
- * [deletes matching callbacks](./spec/unit/modules/event_emitter_spec.rb#L208)
2654
- * [deletes all callbacks if not block given](./spec/unit/modules/event_emitter_spec.rb#L213)
2655
- * [continues if the block does not exist](./spec/unit/modules/event_emitter_spec.rb#L218)
2656
- * without any event names
2657
- * [deletes all matching callbacks](./spec/unit/modules/event_emitter_spec.rb#L225)
2658
- * [deletes all callbacks if not block given](./spec/unit/modules/event_emitter_spec.rb#L230)
3251
+ * with event specified in on handler
3252
+ * with event names as arguments
3253
+ * [deletes matching callbacks when a block is provided](./spec/unit/modules/event_emitter_spec.rb#L259)
3254
+ * [deletes all matching callbacks when a block is not provided](./spec/unit/modules/event_emitter_spec.rb#L264)
3255
+ * [continues if the block does not exist](./spec/unit/modules/event_emitter_spec.rb#L269)
3256
+ * without any event names
3257
+ * [deletes all matching callbacks](./spec/unit/modules/event_emitter_spec.rb#L276)
3258
+ * [deletes all callbacks if not block given](./spec/unit/modules/event_emitter_spec.rb#L281)
3259
+ * when on callback is configured for all events
3260
+ * with event names as arguments
3261
+ * [does not remove the all events callback when a block is provided](./spec/unit/modules/event_emitter_spec.rb#L298)
3262
+ * [does not remove the all events callback when a block is not provided](./spec/unit/modules/event_emitter_spec.rb#L303)
3263
+ * [does not remove the all events callback when the block does not match](./spec/unit/modules/event_emitter_spec.rb#L308)
3264
+ * without any event names
3265
+ * [deletes all matching callbacks](./spec/unit/modules/event_emitter_spec.rb#L315)
3266
+ * [deletes all callbacks if not block given](./spec/unit/modules/event_emitter_spec.rb#L320)
3267
+ * with unsafe_on subscribers
3268
+ * [does not deregister them](./spec/unit/modules/event_emitter_spec.rb#L336)
3269
+ * with unsafe_once subscribers
3270
+ * [does not deregister them](./spec/unit/modules/event_emitter_spec.rb#L351)
3271
+ * #unsafe_off
3272
+ * with unsafe_on subscribers
3273
+ * [deregisters them](./spec/unit/modules/event_emitter_spec.rb#L370)
3274
+ * with unsafe_once subscribers
3275
+ * [deregister them](./spec/unit/modules/event_emitter_spec.rb#L385)
3276
+ * with on subscribers
3277
+ * [does not deregister them](./spec/unit/modules/event_emitter_spec.rb#L400)
3278
+ * with once subscribers
3279
+ * [does not deregister them](./spec/unit/modules/event_emitter_spec.rb#L415)
2659
3280
 
2660
3281
  ### Ably::Modules::StateEmitter
2661
3282
  _(see [spec/unit/modules/state_emitter_spec.rb](./spec/unit/modules/state_emitter_spec.rb))_
@@ -2771,7 +3392,7 @@ _(see [spec/unit/realtime/client_spec.rb](./spec/unit/realtime/client_spec.rb))_
2771
3392
  * with token_details
2772
3393
  * [sets the token](./spec/shared/client_initializer_behaviour.rb#L151)
2773
3394
  * with token_params
2774
- * [configures the default token_params](./spec/shared/client_initializer_behaviour.rb#L159)
3395
+ * [configures default_token_params](./spec/shared/client_initializer_behaviour.rb#L159)
2775
3396
  * endpoint
2776
3397
  * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L170)
2777
3398
  * with environment option
@@ -2812,8 +3433,8 @@ _(see [spec/unit/realtime/client_spec.rb](./spec/unit/realtime/client_spec.rb))_
2812
3433
  ### Ably::Realtime::Connection
2813
3434
  _(see [spec/unit/realtime/connection_spec.rb](./spec/unit/realtime/connection_spec.rb))_
2814
3435
  * callbacks
2815
- * [are supported for valid STATE events](./spec/unit/realtime/connection_spec.rb#L18)
2816
- * [fail with unacceptable STATE event names](./spec/unit/realtime/connection_spec.rb#L24)
3436
+ * [are supported for valid STATE events](./spec/unit/realtime/connection_spec.rb#L21)
3437
+ * [fail with unacceptable STATE event names](./spec/unit/realtime/connection_spec.rb#L27)
2817
3438
 
2818
3439
  ### Ably::Realtime::Presence
2819
3440
  _(see [spec/unit/realtime/presence_spec.rb](./spec/unit/realtime/presence_spec.rb))_
@@ -2822,17 +3443,17 @@ _(see [spec/unit/realtime/presence_spec.rb](./spec/unit/realtime/presence_spec.r
2822
3443
  * [fail with unacceptable STATE event names](./spec/unit/realtime/presence_spec.rb#L19)
2823
3444
  * subscriptions
2824
3445
  * #subscribe
2825
- * [without a block raises an invalid ArgumentError](./spec/unit/realtime/presence_spec.rb#L62)
2826
- * [with no action specified subscribes the provided block to all action](./spec/unit/realtime/presence_spec.rb#L66)
2827
- * [with a single action argument subscribes that block to matching actions](./spec/unit/realtime/presence_spec.rb#L72)
2828
- * [with a multiple action arguments subscribes that block to all of those actions](./spec/unit/realtime/presence_spec.rb#L79)
2829
- * [with a multiple duplicate action arguments subscribes that block to all of those unique actions once](./spec/unit/realtime/presence_spec.rb#L91)
3446
+ * [without a block raises an invalid ArgumentError](./spec/unit/realtime/presence_spec.rb#L63)
3447
+ * [with no action specified subscribes the provided block to all action](./spec/unit/realtime/presence_spec.rb#L67)
3448
+ * [with a single action argument subscribes that block to matching actions](./spec/unit/realtime/presence_spec.rb#L73)
3449
+ * [with a multiple action arguments subscribes that block to all of those actions](./spec/unit/realtime/presence_spec.rb#L80)
3450
+ * [with a multiple duplicate action arguments subscribes that block to all of those unique actions once](./spec/unit/realtime/presence_spec.rb#L92)
2830
3451
  * #unsubscribe
2831
- * [with no action specified unsubscribes that block from all events](./spec/unit/realtime/presence_spec.rb#L106)
2832
- * [with a single action argument unsubscribes the provided block with the matching action](./spec/unit/realtime/presence_spec.rb#L112)
2833
- * [with multiple action arguments unsubscribes each of those matching actions with the provided block](./spec/unit/realtime/presence_spec.rb#L118)
2834
- * [with a non-matching action argument has no effect](./spec/unit/realtime/presence_spec.rb#L124)
2835
- * [with no block argument unsubscribes all blocks for the action argument](./spec/unit/realtime/presence_spec.rb#L130)
3452
+ * [with no action specified unsubscribes that block from all events](./spec/unit/realtime/presence_spec.rb#L107)
3453
+ * [with a single action argument unsubscribes the provided block with the matching action](./spec/unit/realtime/presence_spec.rb#L113)
3454
+ * [with multiple action arguments unsubscribes each of those matching actions with the provided block](./spec/unit/realtime/presence_spec.rb#L119)
3455
+ * [with a non-matching action argument has no effect](./spec/unit/realtime/presence_spec.rb#L125)
3456
+ * [with no block argument unsubscribes all blocks for the action argument](./spec/unit/realtime/presence_spec.rb#L131)
2836
3457
 
2837
3458
  ### Ably::Realtime
2838
3459
  _(see [spec/unit/realtime/realtime_spec.rb](./spec/unit/realtime/realtime_spec.rb))_
@@ -2845,12 +3466,12 @@ _(see [spec/unit/realtime/safe_deferrable_spec.rb](./spec/unit/realtime/safe_def
2845
3466
  * [adds a callback that is called when #fail is called](./spec/shared/safe_deferrable_behaviour.rb#L15)
2846
3467
  * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L22)
2847
3468
  * #fail
2848
- * [calls the callbacks defined with #errback, but not the ones added for success #callback](./spec/shared/safe_deferrable_behaviour.rb#L32)
3469
+ * [calls the callbacks defined with #errback, but not the ones added for success #callback](./spec/shared/safe_deferrable_behaviour.rb#L34)
2849
3470
  * #callback
2850
- * [adds a callback that is called when #succed is called](./spec/shared/safe_deferrable_behaviour.rb#L44)
2851
- * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L51)
3471
+ * [adds a callback that is called when #succed is called](./spec/shared/safe_deferrable_behaviour.rb#L46)
3472
+ * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L53)
2852
3473
  * #succeed
2853
- * [calls the callbacks defined with #callback, but not the ones added for #errback](./spec/shared/safe_deferrable_behaviour.rb#L61)
3474
+ * [calls the callbacks defined with #callback, but not the ones added for #errback](./spec/shared/safe_deferrable_behaviour.rb#L65)
2854
3475
 
2855
3476
  ### Ably::Models::Message
2856
3477
  _(see [spec/unit/realtime/safe_deferrable_spec.rb](./spec/unit/realtime/safe_deferrable_spec.rb))_
@@ -2859,12 +3480,12 @@ _(see [spec/unit/realtime/safe_deferrable_spec.rb](./spec/unit/realtime/safe_def
2859
3480
  * [adds a callback that is called when #fail is called](./spec/shared/safe_deferrable_behaviour.rb#L15)
2860
3481
  * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L22)
2861
3482
  * #fail
2862
- * [calls the callbacks defined with #errback, but not the ones added for success #callback](./spec/shared/safe_deferrable_behaviour.rb#L32)
3483
+ * [calls the callbacks defined with #errback, but not the ones added for success #callback](./spec/shared/safe_deferrable_behaviour.rb#L34)
2863
3484
  * #callback
2864
- * [adds a callback that is called when #succed is called](./spec/shared/safe_deferrable_behaviour.rb#L44)
2865
- * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L51)
3485
+ * [adds a callback that is called when #succed is called](./spec/shared/safe_deferrable_behaviour.rb#L46)
3486
+ * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L53)
2866
3487
  * #succeed
2867
- * [calls the callbacks defined with #callback, but not the ones added for #errback](./spec/shared/safe_deferrable_behaviour.rb#L61)
3488
+ * [calls the callbacks defined with #callback, but not the ones added for #errback](./spec/shared/safe_deferrable_behaviour.rb#L65)
2868
3489
 
2869
3490
  ### Ably::Models::PresenceMessage
2870
3491
  _(see [spec/unit/realtime/safe_deferrable_spec.rb](./spec/unit/realtime/safe_deferrable_spec.rb))_
@@ -2873,12 +3494,12 @@ _(see [spec/unit/realtime/safe_deferrable_spec.rb](./spec/unit/realtime/safe_def
2873
3494
  * [adds a callback that is called when #fail is called](./spec/shared/safe_deferrable_behaviour.rb#L15)
2874
3495
  * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L22)
2875
3496
  * #fail
2876
- * [calls the callbacks defined with #errback, but not the ones added for success #callback](./spec/shared/safe_deferrable_behaviour.rb#L32)
3497
+ * [calls the callbacks defined with #errback, but not the ones added for success #callback](./spec/shared/safe_deferrable_behaviour.rb#L34)
2877
3498
  * #callback
2878
- * [adds a callback that is called when #succed is called](./spec/shared/safe_deferrable_behaviour.rb#L44)
2879
- * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L51)
3499
+ * [adds a callback that is called when #succed is called](./spec/shared/safe_deferrable_behaviour.rb#L46)
3500
+ * [catches exceptions in the callback and logs the error to the logger](./spec/shared/safe_deferrable_behaviour.rb#L53)
2880
3501
  * #succeed
2881
- * [calls the callbacks defined with #callback, but not the ones added for #errback](./spec/shared/safe_deferrable_behaviour.rb#L61)
3502
+ * [calls the callbacks defined with #callback, but not the ones added for #errback](./spec/shared/safe_deferrable_behaviour.rb#L65)
2882
3503
 
2883
3504
  ### Ably::Rest::Channel
2884
3505
  _(see [spec/unit/rest/channel_spec.rb](./spec/unit/rest/channel_spec.rb))_
@@ -2958,7 +3579,7 @@ _(see [spec/unit/rest/client_spec.rb](./spec/unit/rest/client_spec.rb))_
2958
3579
  * with token_details
2959
3580
  * [sets the token](./spec/shared/client_initializer_behaviour.rb#L151)
2960
3581
  * with token_params
2961
- * [configures the default token_params](./spec/shared/client_initializer_behaviour.rb#L159)
3582
+ * [configures default_token_params](./spec/shared/client_initializer_behaviour.rb#L159)
2962
3583
  * endpoint
2963
3584
  * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L170)
2964
3585
  * with environment option
@@ -2991,7 +3612,7 @@ _(see [spec/unit/rest/client_spec.rb](./spec/unit/rest/client_spec.rb))_
2991
3612
  * initializer options
2992
3613
  * TLS
2993
3614
  * disabled
2994
- * [fails for any operation with basic auth and attempting to send an API key over a non-secure connection](./spec/unit/rest/client_spec.rb#L17)
3615
+ * [fails for any operation with basic auth and attempting to send an API key over a non-secure connection (#RSA1)](./spec/unit/rest/client_spec.rb#L17)
2995
3616
  * :use_token_auth
2996
3617
  * set to false
2997
3618
  * with a key and :tls => false
@@ -3028,12 +3649,12 @@ _(see [spec/unit/util/crypto_spec.rb](./spec/unit/util/crypto_spec.rb))_
3028
3649
  * [raises an ArgumentError](./spec/unit/util/crypto_spec.rb#L93)
3029
3650
  * using shared client lib fixture data
3030
3651
  * with AES-128-CBC
3031
- * behaves like an Ably encrypter and decrypter
3652
+ * behaves like an Ably encrypter and decrypter (#RTL7d)
3032
3653
  * text payload
3033
3654
  * [encrypts exactly the same binary data as other client libraries](./spec/unit/util/crypto_spec.rb#L116)
3034
3655
  * [decrypts exactly the same binary data as other client libraries](./spec/unit/util/crypto_spec.rb#L120)
3035
3656
  * with AES-256-CBC
3036
- * behaves like an Ably encrypter and decrypter
3657
+ * behaves like an Ably encrypter and decrypter (#RTL7d)
3037
3658
  * text payload
3038
3659
  * [encrypts exactly the same binary data as other client libraries](./spec/unit/util/crypto_spec.rb#L116)
3039
3660
  * [decrypts exactly the same binary data as other client libraries](./spec/unit/util/crypto_spec.rb#L120)
@@ -3052,6 +3673,6 @@ _(see [spec/unit/util/pub_sub_spec.rb](./spec/unit/util/pub_sub_spec.rb))_
3052
3673
 
3053
3674
  ## Test summary
3054
3675
 
3055
- * Passing tests: 1492
3056
- * Pending tests: 6
3676
+ * Passing tests: 1806
3677
+ * Pending tests: 12
3057
3678
  * Failing tests: 0