ably 1.1.2 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/check.yml +27 -0
  3. data/CHANGELOG.md +67 -0
  4. data/COPYRIGHT +1 -0
  5. data/LICENSE +172 -11
  6. data/MAINTAINERS.md +1 -0
  7. data/README.md +11 -21
  8. data/SPEC.md +1020 -922
  9. data/ably.gemspec +4 -4
  10. data/lib/ably/auth.rb +12 -2
  11. data/lib/ably/exceptions.rb +2 -2
  12. data/lib/ably/modules/ably.rb +11 -1
  13. data/lib/ably/realtime/channel.rb +7 -11
  14. data/lib/ably/realtime/channel/channel_manager.rb +2 -2
  15. data/lib/ably/realtime/channel/channel_properties.rb +24 -0
  16. data/lib/ably/realtime/client.rb +9 -0
  17. data/lib/ably/realtime/connection.rb +5 -4
  18. data/lib/ably/realtime/connection/websocket_transport.rb +67 -1
  19. data/lib/ably/realtime/presence.rb +0 -14
  20. data/lib/ably/rest/channel.rb +27 -19
  21. data/lib/ably/rest/client.rb +31 -15
  22. data/lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb +4 -1
  23. data/lib/ably/version.rb +1 -1
  24. data/spec/acceptance/realtime/auth_spec.rb +3 -3
  25. data/spec/acceptance/realtime/channel_spec.rb +10 -0
  26. data/spec/acceptance/realtime/client_spec.rb +72 -16
  27. data/spec/acceptance/realtime/connection_failures_spec.rb +26 -11
  28. data/spec/acceptance/realtime/connection_spec.rb +36 -17
  29. data/spec/acceptance/realtime/presence_history_spec.rb +0 -58
  30. data/spec/acceptance/realtime/presence_spec.rb +54 -0
  31. data/spec/acceptance/realtime/push_admin_spec.rb +3 -19
  32. data/spec/acceptance/rest/auth_spec.rb +6 -75
  33. data/spec/acceptance/rest/base_spec.rb +8 -4
  34. data/spec/acceptance/rest/channel_spec.rb +42 -4
  35. data/spec/acceptance/rest/client_spec.rb +121 -26
  36. data/spec/acceptance/rest/push_admin_spec.rb +3 -19
  37. data/spec/shared/client_initializer_behaviour.rb +131 -8
  38. data/spec/spec_helper.rb +1 -0
  39. data/spec/support/serialization_helper.rb +21 -0
  40. data/spec/support/test_app.rb +2 -2
  41. data/spec/unit/realtime/client_spec.rb +19 -6
  42. metadata +20 -15
  43. data/.travis.yml +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 372821f0df3a03b36e29d0c2ce4141e08b7467c794aa28c542e38b10d658a0f5
4
- data.tar.gz: 7015ce6030cf75b97474cab9dfb809d671d4178efd34aff777514502a3a74d83
3
+ metadata.gz: fa84b23cf7efa53651ed44ee5ba5fd19fa1e18b63025b5217cb88d069c095b5a
4
+ data.tar.gz: 357ce5eb6984d9a0cbc16a96fd267d45de4325d9b885538a9e09550bead51082
5
5
  SHA512:
6
- metadata.gz: d92e931347421a955f3a318fca505cbb9f2271417a804a4e5a2e310c155abf4f42d2d89beca434e372a4b5777d931d278019a10b77d4b151d4e154a8a06d8064
7
- data.tar.gz: 7e1d96e9b49558bdd010fa63e155ca291921e910212cb38ec00eafe7a6e7b58038150a1e24308d109ac59814bc5f181d2d653734c12c901ce11d7757410a4b28
6
+ metadata.gz: f17679d2f885d6cf61d99996a3ebdc7bcf0b03e6edf8b0ca35c26806199f897e39ce033c1454f0082f643824e703a508d465be217a413e88650b7a04bd3faddb
7
+ data.tar.gz: 3fd85374765d146902fb6f64968fc2f6b9560e40bf168b2d3acf336b6dd94b0f9e98ccf0edcb1b04fb3e38eceb16f41601828c6a4da5a8efe64734e89b1243be
@@ -0,0 +1,27 @@
1
+ on:
2
+ pull_request:
3
+ push:
4
+ branches:
5
+ - main
6
+
7
+ jobs:
8
+ check:
9
+ runs-on: ubuntu-latest
10
+ continue-on-error: true
11
+ strategy:
12
+ matrix:
13
+ ruby: [ '2.5', '2.6', '2.7' ]
14
+ protocol: [ 'json', 'msgpack' ]
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ with:
18
+ submodules: 'recursive'
19
+ - uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+ bundler-cache: true
23
+ - env:
24
+ RSPEC_RETRY: true
25
+ PARALLEL_TEST_PROCESSORS: 2
26
+ PROTOCOL: ${{ matrix.protocol }}
27
+ run: ./spec/run_parallel_tests
data/CHANGELOG.md CHANGED
@@ -1,5 +1,72 @@
1
1
  # Change Log
2
2
 
3
+ ## [v1.1.6](https://github.com/ably/ably-ruby/tree/v1.1.6)
4
+
5
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v1.1.5...v1.1.6)
6
+
7
+ This release will have no effect for users of the realtime `ably-ruby` client, however for users of `ably-ruby-rest` it will update the `faraday` dependency to 1.x (this change was already made for `ably-ruby` in `v1.1.5`).
8
+
9
+ **Merged pull requests:**
10
+
11
+ - Document libcurl requirement [\#243](https://github.com/ably/ably-ruby/pull/243) ([owenpearson](https://github.com/owenpearson))
12
+ - Fix broken markdown hyperlink in readme [\#242](https://github.com/ably/ably-ruby/pull/242) ([owenpearson](https://github.com/owenpearson))
13
+ - Update README with new Ably links [\#239](https://github.com/ably/ably-ruby/pull/239) ([mattheworiordan](https://github.com/mattheworiordan))
14
+ - Fix documentation for Channel\#publish [\#183](https://github.com/ably/ably-ruby/pull/183) ([zreisman](https://github.com/zreisman))
15
+
16
+ ## [v1.1.5](https://github.com/ably/ably-ruby/tree/v1.1.5)
17
+
18
+ Please note: this library now depends on `libcurl` as a system dependency. On most systems this is already installed but in rare cases where it isn't (for example debian-slim Docker images such as ruby-slim) you will need to install it yourself. On debian you can install it with the command `sudo apt-get install libcurl4`.
19
+
20
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v1.1.4...v.1.1.5)
21
+
22
+ **Implemented enhancements:**
23
+
24
+ - Upgrade to support HTTP/2 [\#192](https://github.com/ably/ably-ruby/issues/192), fixed in [\#197](https://github.com/ably/ably-ruby/pull/197) ([mattheworiordan](https://github.com/mattheworiordan))
25
+ - Default fallback hosts for custom environments [\#232](https://github.com/ably/ably-ruby/issues/232), fixed in [\#196](https://github.com/ably/ably-ruby/pull/196) ([mattheworiordan](https://github.com/mattheworiordan), [owenpearson](https://github.com/owenpearson), [lmars](https://github.com/lmars))
26
+
27
+ ## [v1.1.4](https://github.com/ably/ably-ruby/tree/v1.1.4)
28
+
29
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v1.1.3...v1.1.4)
30
+
31
+ **Implemented enhancements:**
32
+
33
+ - statesman dependency very outdated [\#199](https://github.com/ably/ably-ruby/issues/199)
34
+ - Add support for custom transportParams [\#176](https://github.com/ably/ably-ruby/issues/176)
35
+ - Re-enable imempotency tests as part of 1.1 release [\#174](https://github.com/ably/ably-ruby/issues/174)
36
+ - Ensure request method accepts UPDATE, PATCH & DELETE verbs [\#168](https://github.com/ably/ably-ruby/issues/168)
37
+ - my-members presenceMap requirement change for 1.1 [\#163](https://github.com/ably/ably-ruby/issues/163)
38
+ - Add ChannelProperties as part of 1.0 spec \(RTL15\) [\#112](https://github.com/ably/ably-ruby/issues/112)
39
+
40
+ **Fixed bugs:**
41
+
42
+ - client\_id should be passed as clientId [\#159](https://github.com/ably/ably-ruby/issues/159)
43
+ - Error in the HTTP2 framing layer issue before heroku-20 [\#215](https://github.com/ably/ably-ruby/issues/215)
44
+ - Using a clientId should no longer be forcing token auth in the 1.1 spec [\#182](https://github.com/ably/ably-ruby/issues/182)
45
+
46
+ **Merged pull requests:**
47
+
48
+ - Continue running all workflow jobs when one fails [\#235](https://github.com/ably/ably-ruby/pull/235) ([owenpearson](https://github.com/owenpearson))
49
+ - Set SNI hostname and verify peer certificates when using TLS [\#234](https://github.com/ably/ably-ruby/pull/234) ([lmars](https://github.com/lmars))
50
+ - Validate that members presenceMap does not change on synthesized leave [\#231](https://github.com/ably/ably-ruby/pull/231) ([TheSmartnik](https://github.com/TheSmartnik))
51
+ - Conform license and copyright [\#229](https://github.com/ably/ably-ruby/pull/229) ([QuintinWillison](https://github.com/QuintinWillison))
52
+ - Add ChannelProperties \(RTL15\) [\#227](https://github.com/ably/ably-ruby/pull/227) ([TheSmartnik](https://github.com/TheSmartnik))
53
+ - Replace fury badges with shields.io [\#226](https://github.com/ably/ably-ruby/pull/226) ([owenpearson](https://github.com/owenpearson))
54
+ - Add transport\_params option to realtime client \(RTC1f1\) [\#224](https://github.com/ably/ably-ruby/pull/224) ([TheSmartnik](https://github.com/TheSmartnik))
55
+ - Use GitHub actions [\#223](https://github.com/ably/ably-ruby/pull/223) ([owenpearson](https://github.com/owenpearson))
56
+ - Add support for delete, patch, put method in \#request [\#218](https://github.com/ably/ably-ruby/pull/218) ([TheSmartnik](https://github.com/TheSmartnik))
57
+ - Upgrade statesman [\#217](https://github.com/ably/ably-ruby/pull/217) ([TheSmartnik](https://github.com/TheSmartnik))
58
+ - Remove until\_attach option for presence history [\#216](https://github.com/ably/ably-ruby/pull/216) ([TheSmartnik](https://github.com/TheSmartnik))
59
+ - Update Travis CI versions [\#214](https://github.com/ably/ably-ruby/pull/214) ([TheSmartnik](https://github.com/TheSmartnik))
60
+ - Add maintainers file [\#213](https://github.com/ably/ably-ruby/pull/213) ([niksilver](https://github.com/niksilver))
61
+
62
+ ## [v1.1.3](https://github.com/ably/ably-ruby/tree/v1.1.3)
63
+
64
+ [Full Changelog](https://github.com/ably/ably-ruby/compare/v1.1.2...v1.1.3)
65
+
66
+ **Merged pull requests:**
67
+
68
+ - RestChannel#publish: implement params (RSL1l) [\#210](https://github.com/ably/ably-ruby/pull/210) ([simonwoolf](https://github.com/simonwoolf))
69
+
3
70
  ## [v1.1.2](https://github.com/ably/ably-ruby/tree/v1.1.2)
4
71
 
5
72
  [Full Changelog](https://github.com/ably/ably-ruby/compare/v1.1.1...v1.1.2)
data/COPYRIGHT ADDED
@@ -0,0 +1 @@
1
+ Copyright 2015-2021 Ably Real-time Ltd (ably.com)
data/LICENSE CHANGED
@@ -1,15 +1,176 @@
1
- Copyright (c) 2015-2017 Ably
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
2
4
 
3
- Copyright 2015-2017 Ably Real-time Ltd
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
4
6
 
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
7
+ 1. Definitions.
8
8
 
9
- http://www.apache.org/licenses/LICENSE-2.0
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
10
11
 
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
data/MAINTAINERS.md ADDED
@@ -0,0 +1 @@
1
+ This repository is owned by the Ably SDK team.
data/README.md CHANGED
@@ -1,29 +1,23 @@
1
- # [Ably](https://www.ably.io)
1
+ # [Ably](https://ably.com)
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/ably.svg)](http://badge.fury.io/rb/ably)
3
+ [![Gem Version](https://img.shields.io/gem/v/ably?style=flat)](https://img.shields.io/gem/v/ably?style=flat)
4
4
  [![Coverage Status](https://coveralls.io/repos/ably/ably-ruby/badge.svg)](https://coveralls.io/r/ably/ably-ruby)
5
5
 
6
- A Ruby client library for [ably.io](https://www.ably.io), the realtime messaging service. This library currently targets the [Ably 1.1 client library specification](https://www.ably.io/documentation/client-lib-development-guide/features/). You can jump to the '[Known Limitations](#known-limitations)' section to see the features this client library does not yet support or [view our client library SDKs feature support matrix](https://www.ably.io/download/sdk-feature-support-matrix) to see the list of all the available features.
6
+ A Ruby client library for [ably.com](https://ably.com), the realtime messaging service. This library currently targets the [Ably 1.1 client library specification](https://ably.com/documentation/client-lib-development-guide/features/). You can see the complete list of features this client library supports in [our client library SDKs feature support matrix](https://ably.com/download/sdk-feature-support-matrix).
7
7
 
8
8
  ## Supported platforms
9
9
 
10
10
  This SDK supports Ruby 1.9.3+.
11
11
 
12
- We regression-test the SDK against a selection of Ruby versions (which we update over time, but usually consists of mainstream and widely used versions). Please refer to [.travis.yml](./.travis.yml) for the set of versions that currently undergo CI testing.
12
+ As of v1.1.5 this library requires `libcurl` as a system dependency. On most systems this is already installed but in rare cases where it isn't (for example debian-slim Docker images such as ruby-slim) you will need to install it yourself. On debian you can install it with the command `sudo apt-get install libcurl4`.
13
13
 
14
- If you find any compatibility issues, please [do raise an issue](https://github.com/ably/ably-ruby/issues/new) in this repository or [contact Ably customer support](https://support.ably.io/) for advice.
14
+ We regression-test the SDK against a selection of Ruby versions (which we update over time, but usually consists of mainstream and widely used versions). Please refer to [.github/workflows/check.yml](./.github/workflows/check.yml) for the set of versions that currently undergo CI testing.
15
15
 
16
- ## Known Limitations
17
-
18
- This client library is currently *not compatible* with some of the Ably features:
19
-
20
- | Feature |
21
- | :--- |
22
- | [Custom transportParams](https://www.ably.io/documentation/realtime/connection#client-options) |
16
+ If you find any compatibility issues, please [do raise an issue](https://github.com/ably/ably-ruby/issues/new) in this repository or [contact Ably customer support](https://ably.com/support/) for advice.
23
17
 
24
18
  ## Documentation
25
19
 
26
- Visit https://www.ably.io/documentation for a complete API reference and more examples.
20
+ Visit https://ably.com/documentation for a complete API reference and code examples.
27
21
 
28
22
  ## Installation
29
23
 
@@ -43,7 +37,7 @@ Or install it yourself as:
43
37
 
44
38
  ### Using with Rails or Sinatra
45
39
 
46
- 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.
40
+ This `ably` gem provides both a [Realtime](https://ably.com/documentation/realtime/usage) and [REST](https://ably.com/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.
47
41
 
48
42
  If you are using Ably within your Rails or Sinatra apps, more often than not, you probably want to use the REST only version of the library that has no dependency on EventMachine and provides a synchronous API that you will be used to using within Rails and Sinatra. [See the REST only Ruby version of the Ably library](https://github.com/ably/ably-ruby-rest).
49
43
 
@@ -69,7 +63,7 @@ client = Ably::Realtime.new(key: 'xxxxx')
69
63
  client = Ably::Realtime.new(token: 'xxxxx')
70
64
  ```
71
65
 
72
- If you do not have an API key, [sign up for a free API key now](https://www.ably.io/signup)
66
+ If you do not have an API key, [sign up for a free API key now](https://ably.com/signup)
73
67
 
74
68
  ### Connection
75
69
 
@@ -195,7 +189,7 @@ channel.publish "name (not encrypted)", "sensitive data (encrypted before being
195
189
 
196
190
  ### Introduction
197
191
 
198
- Unlike the Realtime API, all calls are synchronous and are not run within an [EventMachine](https://github.com/eventmachine/eventmachine) [reactor](https://github.com/eventmachine/eventmachine/wiki/General-Introduction).
192
+ Unlike the Realtime API, all calls are synchronous and are not run within [EventMachine](https://github.com/eventmachine/eventmachine).
199
193
 
200
194
  All examples assume a client and/or channel has been created as follows:
201
195
 
@@ -303,7 +297,7 @@ If you only need to use the REST features of this library and do not want EventM
303
297
 
304
298
  ## Support, feedback and troubleshooting
305
299
 
306
- Please visit http://support.ably.io/ for access to our knowledgebase and to ask for any assistance.
300
+ Please visit https://ably.com/support for access to our knowledgebase and to ask for any assistance.
307
301
 
308
302
  You can also view the [community reported Github issues](https://github.com/ably/ably-ruby/issues).
309
303
 
@@ -329,7 +323,3 @@ This library uses [semantic versioning](http://semver.org/). For each release, t
329
323
  * Visit [https://github.com/ably/ably-ruby/tags](https://github.com/ably/ably-ruby/tags) and `Add release notes` for the release including links to the changelog entry.
330
324
  * Run `rake release` to publish the gem to [Rubygems](https://rubygems.org/gems/ably)
331
325
  * Release the [REST-only library `ably-ruby-rest`](https://github.com/ably/ably-ruby-rest#release-process)
332
-
333
- ## License
334
-
335
- Copyright (c) 2017 Ably Real-time Ltd, Licensed under the Apache License, Version 2.0. Refer to [LICENSE](LICENSE) for the license terms.
data/SPEC.md CHANGED
@@ -1,4 +1,4 @@
1
- # Ably Realtime & REST Client Library 1.1.0 Specification
1
+ # Ably Realtime & REST Client Library 1.1.5 Specification
2
2
 
3
3
  ### Ably::Realtime::Auth
4
4
  _(see [spec/acceptance/realtime/auth_spec.rb](./spec/acceptance/realtime/auth_spec.rb))_
@@ -55,7 +55,7 @@ _(see [spec/acceptance/realtime/auth_spec.rb](./spec/acceptance/realtime/auth_sp
55
55
  * and an incompatible client_id in a TokenDetails object passed to the auth callback
56
56
  * [rejects a TokenDetails object with an incompatible client_id and fails with an exception](./spec/acceptance/realtime/auth_spec.rb#L287)
57
57
  * when already authenticated with a valid token
58
- * [ensures message delivery continuity whilst upgrading (#RTC8a1)](./spec/acceptance/realtime/auth_spec.rb#L701)
58
+ * [ensures message delivery continuity whilst upgrading (#RTC8a1)](./spec/acceptance/realtime/auth_spec.rb#L703)
59
59
  * when INITIALIZED
60
60
  * [obtains a token and connects to Ably (#RTC8c, #RTC8b1)](./spec/acceptance/realtime/auth_spec.rb#L328)
61
61
  * when CONNECTING
@@ -82,93 +82,93 @@ _(see [spec/acceptance/realtime/auth_spec.rb](./spec/acceptance/realtime/auth_sp
82
82
  * when upgrading capabilities
83
83
  * [is allowed (#RTC8a1)](./spec/acceptance/realtime/auth_spec.rb#L659)
84
84
  * when downgrading capabilities (#RTC8a1)
85
- * [is allowed and channels are detached](./spec/acceptance/realtime/auth_spec.rb#L684)
85
+ * [is allowed and channels are detached](./spec/acceptance/realtime/auth_spec.rb#L686)
86
86
  * #authorize_async
87
- * [returns a token synchronously](./spec/acceptance/realtime/auth_spec.rb#L735)
87
+ * [returns a token synchronously](./spec/acceptance/realtime/auth_spec.rb#L737)
88
88
  * server initiated AUTH ProtocolMessage
89
89
  * when received
90
- * [should immediately start a new authentication process (#RTN22)](./spec/acceptance/realtime/auth_spec.rb#L756)
90
+ * [should immediately start a new authentication process (#RTN22)](./spec/acceptance/realtime/auth_spec.rb#L758)
91
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#L779)
92
+ * [should expect the connection to be disconnected by the server but should resume automatically (#RTN22a)](./spec/acceptance/realtime/auth_spec.rb#L781)
93
93
  * #auth_params
94
- * [returns the auth params asynchronously](./spec/acceptance/realtime/auth_spec.rb#L805)
94
+ * [returns the auth params asynchronously](./spec/acceptance/realtime/auth_spec.rb#L807)
95
95
  * #auth_params_sync
96
- * [returns the auth params synchronously](./spec/acceptance/realtime/auth_spec.rb#L814)
96
+ * [returns the auth params synchronously](./spec/acceptance/realtime/auth_spec.rb#L816)
97
97
  * #auth_header
98
- * [returns an auth header asynchronously](./spec/acceptance/realtime/auth_spec.rb#L821)
98
+ * [returns an auth header asynchronously](./spec/acceptance/realtime/auth_spec.rb#L823)
99
99
  * #auth_header_sync
100
- * [returns an auth header synchronously](./spec/acceptance/realtime/auth_spec.rb#L830)
100
+ * [returns an auth header synchronously](./spec/acceptance/realtime/auth_spec.rb#L832)
101
101
  * #client_id_validated?
102
102
  * when using basic auth
103
103
  * before connected
104
- * [is false as basic auth users do not have an identity](./spec/acceptance/realtime/auth_spec.rb#L843)
104
+ * [is false as basic auth users do not have an identity](./spec/acceptance/realtime/auth_spec.rb#L845)
105
105
  * once connected
106
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L850)
107
- * [contains a validated wildcard client_id](./spec/acceptance/realtime/auth_spec.rb#L857)
106
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L852)
107
+ * [contains a validated wildcard client_id](./spec/acceptance/realtime/auth_spec.rb#L859)
108
108
  * when using a token string
109
109
  * with a valid client_id
110
110
  * before connected
111
- * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L871)
112
- * [#client_id is nil](./spec/acceptance/realtime/auth_spec.rb#L876)
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)
113
113
  * once connected
114
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L883)
115
- * [#client_id is populated](./spec/acceptance/realtime/auth_spec.rb#L890)
114
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L885)
115
+ * [#client_id is populated](./spec/acceptance/realtime/auth_spec.rb#L892)
116
116
  * with no client_id (anonymous)
117
117
  * before connected
118
- * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L903)
118
+ * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L905)
119
119
  * once connected
120
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L910)
120
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L912)
121
121
  * with a wildcard client_id (anonymous)
122
122
  * before connected
123
- * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L923)
123
+ * [is false as identification is not possible from an opaque token string](./spec/acceptance/realtime/auth_spec.rb#L925)
124
124
  * once connected
125
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L930)
125
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L932)
126
126
  * when using a token
127
127
  * with a client_id
128
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L944)
128
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L946)
129
129
  * once connected
130
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L950)
130
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L952)
131
131
  * with no client_id (anonymous)
132
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L962)
132
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L964)
133
133
  * once connected
134
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L968)
134
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L970)
135
135
  * with a wildcard client_id (anonymous)
136
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L980)
136
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L982)
137
137
  * once connected
138
- * [is true](./spec/acceptance/realtime/auth_spec.rb#L986)
138
+ * [is true](./spec/acceptance/realtime/auth_spec.rb#L988)
139
139
  * when using a token request with a client_id
140
- * [is not true as identification is not confirmed until authenticated](./spec/acceptance/realtime/auth_spec.rb#L999)
140
+ * [is not true as identification is not confirmed until authenticated](./spec/acceptance/realtime/auth_spec.rb#L1001)
141
141
  * once connected
142
- * [is true as identification is completed following CONNECTED ProtocolMessage](./spec/acceptance/realtime/auth_spec.rb#L1005)
142
+ * [is true as identification is completed following CONNECTED ProtocolMessage](./spec/acceptance/realtime/auth_spec.rb#L1007)
143
143
  * deprecated #authorise
144
- * [logs a deprecation warning (#RSA10l)](./spec/acceptance/realtime/auth_spec.rb#L1019)
145
- * [returns a valid token (#RSA10l)](./spec/acceptance/realtime/auth_spec.rb#L1025)
144
+ * [logs a deprecation warning (#RSA10l)](./spec/acceptance/realtime/auth_spec.rb#L1021)
145
+ * [returns a valid token (#RSA10l)](./spec/acceptance/realtime/auth_spec.rb#L1027)
146
146
  * when using JWT
147
147
  * when using auth_url
148
148
  * when credentials are valid
149
- * [client successfully fetches a channel and publishes a message](./spec/acceptance/realtime/auth_spec.rb#L1044)
149
+ * [client successfully fetches a channel and publishes a message](./spec/acceptance/realtime/auth_spec.rb#L1046)
150
150
  * when credentials are wrong
151
- * [disconnected includes and invalid signature message](./spec/acceptance/realtime/auth_spec.rb#L1057)
151
+ * [disconnected includes and invalid signature message](./spec/acceptance/realtime/auth_spec.rb#L1059)
152
152
  * when token is expired
153
- * [receives a 40142 error from the server](./spec/acceptance/realtime/auth_spec.rb#L1070)
153
+ * [receives a 40142 error from the server](./spec/acceptance/realtime/auth_spec.rb#L1072)
154
154
  * when using auth_callback
155
155
  * when credentials are valid
156
- * [authentication succeeds and client can post a message](./spec/acceptance/realtime/auth_spec.rb#L1095)
156
+ * [authentication succeeds and client can post a message](./spec/acceptance/realtime/auth_spec.rb#L1097)
157
157
  * when credentials are invalid
158
- * [authentication fails and reason for disconnection is invalid signature](./spec/acceptance/realtime/auth_spec.rb#L1110)
158
+ * [authentication fails and reason for disconnection is invalid signature](./spec/acceptance/realtime/auth_spec.rb#L1112)
159
159
  * when the client is initialized with ClientOptions and the token is a JWT token
160
160
  * when credentials are valid
161
- * [posts successfully to a channel](./spec/acceptance/realtime/auth_spec.rb#L1127)
161
+ * [posts successfully to a channel](./spec/acceptance/realtime/auth_spec.rb#L1129)
162
162
  * when credentials are invalid
163
- * [fails with an invalid signature error](./spec/acceptance/realtime/auth_spec.rb#L1141)
163
+ * [fails with an invalid signature error](./spec/acceptance/realtime/auth_spec.rb#L1144)
164
164
  * when JWT token expires
165
- * [client disconnects, a new token is requested via auth_callback and the client gets reconnected](./spec/acceptance/realtime/auth_spec.rb#L1168)
165
+ * [client disconnects, a new token is requested via auth_callback and the client gets reconnected](./spec/acceptance/realtime/auth_spec.rb#L1171)
166
166
  * and an AUTH procol message is received
167
- * [client reauths correctly without going through a disconnection](./spec/acceptance/realtime/auth_spec.rb#L1196)
167
+ * [client reauths correctly without going through a disconnection](./spec/acceptance/realtime/auth_spec.rb#L1199)
168
168
  * when the JWT token request includes a client_id
169
- * [the client_id is the same that was specified in the auth_callback that generated the JWT token](./spec/acceptance/realtime/auth_spec.rb#L1224)
169
+ * [the client_id is the same that was specified in the auth_callback that generated the JWT token](./spec/acceptance/realtime/auth_spec.rb#L1227)
170
170
  * when the JWT token request includes a subscribe-only capability
171
- * [client fails to publish to a channel with subscribe-only capability and publishes successfully on a channel with permissions](./spec/acceptance/realtime/auth_spec.rb#L1242)
171
+ * [client fails to publish to a channel with subscribe-only capability and publishes successfully on a channel with permissions](./spec/acceptance/realtime/auth_spec.rb#L1245)
172
172
 
173
173
  ### Ably::Realtime::Channel#history
174
174
  _(see [spec/acceptance/realtime/channel_history_spec.rb](./spec/acceptance/realtime/channel_history_spec.rb))_
@@ -183,15 +183,15 @@ _(see [spec/acceptance/realtime/channel_history_spec.rb](./spec/acceptance/realt
183
183
  * [retrieves history forwards with pagination through :limit option](./spec/acceptance/realtime/channel_history_spec.rb#L94)
184
184
  * [retrieves history backwards with pagination through :limit option](./spec/acceptance/realtime/channel_history_spec.rb#L103)
185
185
  * in multiple ProtocolMessages
186
- * FAILED: ~~[retrieves limited history forwards with pagination](./spec/acceptance/realtime/channel_history_spec.rb#L114)~~
187
- * FAILED: ~~[retrieves limited history backwards with pagination](./spec/acceptance/realtime/channel_history_spec.rb#L125)~~
186
+ * [retrieves limited history forwards with pagination](./spec/acceptance/realtime/channel_history_spec.rb#L114)
187
+ * [retrieves limited history backwards with pagination](./spec/acceptance/realtime/channel_history_spec.rb#L127)
188
188
  * and REST history
189
- * [return the same results with unique matching message IDs](./spec/acceptance/realtime/channel_history_spec.rb#L141)
189
+ * [return the same results with unique matching message IDs](./spec/acceptance/realtime/channel_history_spec.rb#L145)
190
190
  * with option until_attach: true
191
- * [retrieves all messages before channel was attached](./spec/acceptance/realtime/channel_history_spec.rb#L166)
192
- * [fails the deferrable unless the state is attached](./spec/acceptance/realtime/channel_history_spec.rb#L215)
191
+ * [retrieves all messages before channel was attached](./spec/acceptance/realtime/channel_history_spec.rb#L172)
192
+ * [fails the deferrable unless the state is attached](./spec/acceptance/realtime/channel_history_spec.rb#L221)
193
193
  * and two pages of messages
194
- * [retrieves two pages of messages before channel was attached](./spec/acceptance/realtime/channel_history_spec.rb#L181)
194
+ * [retrieves two pages of messages before channel was attached](./spec/acceptance/realtime/channel_history_spec.rb#L187)
195
195
 
196
196
  ### Ably::Realtime::Channel
197
197
  _(see [spec/acceptance/realtime/channel_spec.rb](./spec/acceptance/realtime/channel_spec.rb))_
@@ -201,286 +201,287 @@ _(see [spec/acceptance/realtime/channel_spec.rb](./spec/acceptance/realtime/chan
201
201
  * [remains initialized when accessing a channel](./spec/acceptance/realtime/channel_spec.rb#L29)
202
202
  * [opens a connection implicitly on #attach](./spec/acceptance/realtime/channel_spec.rb#L37)
203
203
  * #attach
204
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_spec.rb#L142)
205
- * [calls the SafeDeferrable callback on success (#RTL4d)](./spec/acceptance/realtime/channel_spec.rb#L147)
204
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_spec.rb#L152)
205
+ * [calls the SafeDeferrable callback on success (#RTL4d)](./spec/acceptance/realtime/channel_spec.rb#L157)
206
206
  * when initialized
207
207
  * [emits attaching then attached events](./spec/acceptance/realtime/channel_spec.rb#L48)
208
208
  * [ignores subsequent #attach calls but calls the success callback if provided](./spec/acceptance/realtime/channel_spec.rb#L58)
209
209
  * [attaches to a channel](./spec/acceptance/realtime/channel_spec.rb#L71)
210
210
  * [attaches to a channel and calls the provided block (#RTL4d)](./spec/acceptance/realtime/channel_spec.rb#L79)
211
- * [sends an ATTACH and waits for an ATTACHED (#RTL4c)](./spec/acceptance/realtime/channel_spec.rb#L86)
212
- * [implicitly attaches the channel (#RTL7c)](./spec/acceptance/realtime/channel_spec.rb#L110)
211
+ * [sets attach_serial property after the attachment (#RTL15a)](./spec/acceptance/realtime/channel_spec.rb#L86)
212
+ * [sends an ATTACH and waits for an ATTACHED (#RTL4c)](./spec/acceptance/realtime/channel_spec.rb#L96)
213
+ * [implicitly attaches the channel (#RTL7c)](./spec/acceptance/realtime/channel_spec.rb#L120)
213
214
  * when the implicit channel attach fails
214
- * [registers the listener anyway (#RTL7c)](./spec/acceptance/realtime/channel_spec.rb#L127)
215
+ * [registers the listener anyway (#RTL7c)](./spec/acceptance/realtime/channel_spec.rb#L137)
215
216
  * when an ATTACHED acknowledge is not received on the current connection
216
- * [sends another ATTACH each time the connection becomes connected](./spec/acceptance/realtime/channel_spec.rb#L158)
217
+ * [sends another ATTACH each time the connection becomes connected](./spec/acceptance/realtime/channel_spec.rb#L168)
217
218
  * when state is :attached
218
- * [does nothing (#RTL4a)](./spec/acceptance/realtime/channel_spec.rb#L196)
219
+ * [does nothing (#RTL4a)](./spec/acceptance/realtime/channel_spec.rb#L206)
219
220
  * when state is :failed
220
- * [reattaches and sets the errorReason to nil (#RTL4g)](./spec/acceptance/realtime/channel_spec.rb#L216)
221
+ * [reattaches and sets the errorReason to nil (#RTL4g)](./spec/acceptance/realtime/channel_spec.rb#L226)
221
222
  * when state is :detaching
222
- * [does the attach operation after the completion of the pending request (#RTL4h)](./spec/acceptance/realtime/channel_spec.rb#L231)
223
+ * [does the attach operation after the completion of the pending request (#RTL4h)](./spec/acceptance/realtime/channel_spec.rb#L241)
223
224
  * with many connections and many channels on each simultaneously
224
- * [attaches all channels](./spec/acceptance/realtime/channel_spec.rb#L259)
225
+ * [attaches all channels](./spec/acceptance/realtime/channel_spec.rb#L269)
225
226
  * failure as a result of insufficient key permissions
226
- * [emits failed event (#RTL4e)](./spec/acceptance/realtime/channel_spec.rb#L291)
227
- * [calls the errback of the returned Deferrable (#RTL4d)](./spec/acceptance/realtime/channel_spec.rb#L300)
228
- * [updates the error_reason](./spec/acceptance/realtime/channel_spec.rb#L308)
227
+ * [emits failed event (#RTL4e)](./spec/acceptance/realtime/channel_spec.rb#L300)
228
+ * [calls the errback of the returned Deferrable (#RTL4d)](./spec/acceptance/realtime/channel_spec.rb#L309)
229
+ * [updates the error_reason](./spec/acceptance/realtime/channel_spec.rb#L317)
229
230
  * and subsequent authorisation with suitable permissions
230
- * [attaches to the channel successfully and resets the channel error_reason](./spec/acceptance/realtime/channel_spec.rb#L317)
231
+ * [attaches to the channel successfully and resets the channel error_reason](./spec/acceptance/realtime/channel_spec.rb#L326)
231
232
  * with connection state
232
- * [is initialized (#RTL4i)](./spec/acceptance/realtime/channel_spec.rb#L336)
233
- * [is connecting (#RTL4i)](./spec/acceptance/realtime/channel_spec.rb#L343)
234
- * [is disconnected (#RTL4i)](./spec/acceptance/realtime/channel_spec.rb#L351)
233
+ * [is initialized (#RTL4i)](./spec/acceptance/realtime/channel_spec.rb#L345)
234
+ * [is connecting (#RTL4i)](./spec/acceptance/realtime/channel_spec.rb#L352)
235
+ * [is disconnected (#RTL4i)](./spec/acceptance/realtime/channel_spec.rb#L360)
235
236
  * #detach
236
237
  * when state is :attached
237
- * [it detaches from a channel (#RTL5d)](./spec/acceptance/realtime/channel_spec.rb#L366)
238
- * [detaches from a channel and calls the provided block (#RTL5d, #RTL5e)](./spec/acceptance/realtime/channel_spec.rb#L376)
239
- * [emits :detaching then :detached events](./spec/acceptance/realtime/channel_spec.rb#L386)
240
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_spec.rb#L398)
241
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L405)
238
+ * [it detaches from a channel (#RTL5d)](./spec/acceptance/realtime/channel_spec.rb#L375)
239
+ * [detaches from a channel and calls the provided block (#RTL5d, #RTL5e)](./spec/acceptance/realtime/channel_spec.rb#L385)
240
+ * [emits :detaching then :detached events](./spec/acceptance/realtime/channel_spec.rb#L395)
241
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/channel_spec.rb#L407)
242
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L414)
242
243
  * and DETACHED message is not received within realtime request timeout
243
- * [fails the deferrable and returns to the previous state (#RTL5f, #RTL5e)](./spec/acceptance/realtime/channel_spec.rb#L419)
244
+ * [fails the deferrable and returns to the previous state (#RTL5f, #RTL5e)](./spec/acceptance/realtime/channel_spec.rb#L428)
244
245
  * when state is :failed
245
- * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L439)
246
+ * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L448)
246
247
  * when state is :attaching
247
- * [waits for the attach to complete and then moves to detached](./spec/acceptance/realtime/channel_spec.rb#L452)
248
+ * [waits for the attach to complete and then moves to detached](./spec/acceptance/realtime/channel_spec.rb#L461)
248
249
  * when state is :detaching
249
- * [ignores subsequent #detach calls but calls the callback if provided (#RTL5i)](./spec/acceptance/realtime/channel_spec.rb#L469)
250
+ * [ignores subsequent #detach calls but calls the callback if provided (#RTL5i)](./spec/acceptance/realtime/channel_spec.rb#L478)
250
251
  * when state is :suspended
251
- * [moves the channel state immediately to DETACHED state (#RTL5j)](./spec/acceptance/realtime/channel_spec.rb#L486)
252
+ * [moves the channel state immediately to DETACHED state (#RTL5j)](./spec/acceptance/realtime/channel_spec.rb#L495)
252
253
  * when state is :initialized
253
- * [does nothing as there is no channel to detach (#RTL5a)](./spec/acceptance/realtime/channel_spec.rb#L506)
254
- * [returns a valid deferrable](./spec/acceptance/realtime/channel_spec.rb#L514)
254
+ * [does nothing as there is no channel to detach (#RTL5a)](./spec/acceptance/realtime/channel_spec.rb#L515)
255
+ * [returns a valid deferrable](./spec/acceptance/realtime/channel_spec.rb#L523)
255
256
  * when state is :detached
256
- * [does nothing as the channel is detached (#RTL5a)](./spec/acceptance/realtime/channel_spec.rb#L524)
257
+ * [does nothing as the channel is detached (#RTL5a)](./spec/acceptance/realtime/channel_spec.rb#L533)
257
258
  * when connection state is
258
259
  * closing
259
- * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L541)
260
+ * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L550)
260
261
  * failed and channel is failed
261
- * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L561)
262
+ * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L570)
262
263
  * failed and channel is detached
263
- * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L583)
264
+ * [fails the deferrable (#RTL5b)](./spec/acceptance/realtime/channel_spec.rb#L592)
264
265
  * initialized
265
- * [does the detach operation once the connection state is connected (#RTL5h)](./spec/acceptance/realtime/channel_spec.rb#L603)
266
+ * [does the detach operation once the connection state is connected (#RTL5h)](./spec/acceptance/realtime/channel_spec.rb#L612)
266
267
  * connecting
267
- * [does the detach operation once the connection state is connected (#RTL5h)](./spec/acceptance/realtime/channel_spec.rb#L618)
268
+ * [does the detach operation once the connection state is connected (#RTL5h)](./spec/acceptance/realtime/channel_spec.rb#L627)
268
269
  * disconnected
269
- * [does the detach operation once the connection state is connected (#RTL5h)](./spec/acceptance/realtime/channel_spec.rb#L637)
270
+ * [does the detach operation once the connection state is connected (#RTL5h)](./spec/acceptance/realtime/channel_spec.rb#L646)
270
271
  * automatic channel recovery
271
272
  * when an ATTACH request times out
272
- * [moves to the SUSPENDED state (#RTL4f)](./spec/acceptance/realtime/channel_spec.rb#L664)
273
+ * [moves to the SUSPENDED state (#RTL4f)](./spec/acceptance/realtime/channel_spec.rb#L673)
273
274
  * if a subsequent ATTACHED is received on an ATTACHED channel
274
- * [ignores the additional ATTACHED if resumed is true (#RTL12)](./spec/acceptance/realtime/channel_spec.rb#L678)
275
- * [emits an UPDATE only when resumed is true (#RTL12)](./spec/acceptance/realtime/channel_spec.rb#L692)
276
- * [emits an UPDATE when resumed is true and includes the reason error from the ProtocolMessage (#RTL12)](./spec/acceptance/realtime/channel_spec.rb#L708)
275
+ * [ignores the additional ATTACHED if resumed is true (#RTL12)](./spec/acceptance/realtime/channel_spec.rb#L687)
276
+ * [emits an UPDATE only when resumed is true (#RTL12)](./spec/acceptance/realtime/channel_spec.rb#L701)
277
+ * [emits an UPDATE when resumed is true and includes the reason error from the ProtocolMessage (#RTL12)](./spec/acceptance/realtime/channel_spec.rb#L717)
277
278
  * #publish
278
279
  * when channel is attached (#RTL6c1)
279
- * [publishes messages](./spec/acceptance/realtime/channel_spec.rb#L733)
280
+ * [publishes messages](./spec/acceptance/realtime/channel_spec.rb#L742)
280
281
  * when channel is not attached in state Initializing (#RTL6c1)
281
- * [publishes messages immediately and does not implicitly attach (#RTL6c1)](./spec/acceptance/realtime/channel_spec.rb#L745)
282
+ * [publishes messages immediately and does not implicitly attach (#RTL6c1)](./spec/acceptance/realtime/channel_spec.rb#L754)
282
283
  * when channel is Attaching (#RTL6c1)
283
- * [publishes messages immediately (#RTL6c1)](./spec/acceptance/realtime/channel_spec.rb#L762)
284
+ * [publishes messages immediately (#RTL6c1)](./spec/acceptance/realtime/channel_spec.rb#L771)
284
285
  * when channel is Detaching (#RTL6c1)
285
- * [publishes messages immediately (#RTL6c1)](./spec/acceptance/realtime/channel_spec.rb#L787)
286
+ * [publishes messages immediately (#RTL6c1)](./spec/acceptance/realtime/channel_spec.rb#L796)
286
287
  * when channel is Detached (#RTL6c1)
287
- * [publishes messages immediately (#RTL6c1)](./spec/acceptance/realtime/channel_spec.rb#L814)
288
+ * [publishes messages immediately (#RTL6c1)](./spec/acceptance/realtime/channel_spec.rb#L823)
288
289
  * with :queue_messages client option set to false (#RTL6c4)
289
290
  * and connection state connected (#RTL6c4)
290
- * [publishes the message](./spec/acceptance/realtime/channel_spec.rb#L845)
291
+ * [publishes the message](./spec/acceptance/realtime/channel_spec.rb#L854)
291
292
  * and connection state initialized (#RTL6c4)
292
- * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L854)
293
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L863)
293
294
  * and connection state connecting (#RTL6c4)
294
- * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L864)
295
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L873)
295
296
  * and connection state disconnected (#RTL6c4)
296
- * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L879)
297
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L888)
297
298
  * and connection state suspended (#RTL6c4)
298
- * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L879)
299
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L888)
299
300
  * and connection state closing (#RTL6c4)
300
- * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L879)
301
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L888)
301
302
  * and connection state closed (#RTL6c4)
302
- * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L879)
303
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L888)
303
304
  * and the channel state is failed (#RTL6c4)
304
- * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L900)
305
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L909)
305
306
  * with name and data arguments
306
- * [publishes the message and return true indicating success](./spec/acceptance/realtime/channel_spec.rb#L918)
307
+ * [publishes the message and return true indicating success](./spec/acceptance/realtime/channel_spec.rb#L927)
307
308
  * and additional attributes
308
- * [publishes the message with the attributes and return true indicating success](./spec/acceptance/realtime/channel_spec.rb#L931)
309
+ * [publishes the message with the attributes and return true indicating success](./spec/acceptance/realtime/channel_spec.rb#L940)
309
310
  * and additional invalid attributes
310
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L944)
311
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L953)
311
312
  * with an array of Hash objects with :name and :data attributes
312
- * [publishes an array of messages in one ProtocolMessage](./spec/acceptance/realtime/channel_spec.rb#L958)
313
+ * [publishes an array of messages in one ProtocolMessage](./spec/acceptance/realtime/channel_spec.rb#L967)
313
314
  * with an array of Message objects
314
- * [publishes an array of messages in one ProtocolMessage](./spec/acceptance/realtime/channel_spec.rb#L986)
315
+ * [publishes an array of messages in one ProtocolMessage](./spec/acceptance/realtime/channel_spec.rb#L995)
315
316
  * nil attributes
316
317
  * when name is nil
317
- * [publishes the message without a name attribute in the payload](./spec/acceptance/realtime/channel_spec.rb#L1010)
318
+ * [publishes the message without a name attribute in the payload](./spec/acceptance/realtime/channel_spec.rb#L1019)
318
319
  * when data is nil
319
- * [publishes the message without a data attribute in the payload](./spec/acceptance/realtime/channel_spec.rb#L1033)
320
+ * [publishes the message without a data attribute in the payload](./spec/acceptance/realtime/channel_spec.rb#L1043)
320
321
  * with neither name or data attributes
321
- * [publishes the message without any attributes in the payload](./spec/acceptance/realtime/channel_spec.rb#L1056)
322
+ * [publishes the message without any attributes in the payload](./spec/acceptance/realtime/channel_spec.rb#L1067)
322
323
  * with two invalid message out of 12
323
324
  * before client_id is known (validated)
324
- * [calls the errback once](./spec/acceptance/realtime/channel_spec.rb#L1080)
325
+ * [calls the errback once](./spec/acceptance/realtime/channel_spec.rb#L1091)
325
326
  * when client_id is known (validated)
326
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L1100)
327
+ * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L1111)
327
328
  * only invalid messages
328
329
  * before client_id is known (validated)
329
- * [calls the errback once](./spec/acceptance/realtime/channel_spec.rb#L1119)
330
+ * [calls the errback once](./spec/acceptance/realtime/channel_spec.rb#L1130)
330
331
  * when client_id is known (validated)
331
- * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L1138)
332
+ * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L1149)
332
333
  * with many many messages and many connections simultaneously
333
- * [publishes all messages, all success callbacks are called, and a history request confirms all messages were published](./spec/acceptance/realtime/channel_spec.rb#L1152)
334
+ * [publishes all messages, all success callbacks are called, and a history request confirms all messages were published](./spec/acceptance/realtime/channel_spec.rb#L1163)
334
335
  * with more than allowed messages in a single publish
335
- * [rejects the publish](./spec/acceptance/realtime/channel_spec.rb#L1175)
336
+ * [rejects the publish](./spec/acceptance/realtime/channel_spec.rb#L1186)
336
337
  * identified clients
337
338
  * when authenticated with a wildcard client_id
338
339
  * with a valid client_id in the message
339
- * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1195)
340
+ * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1206)
340
341
  * with a wildcard client_id in the message
341
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1207)
342
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1218)
342
343
  * with a non-String client_id in the message
343
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1214)
344
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1225)
344
345
  * with an empty client_id in the message
345
- * [succeeds and publishes without a client_id](./spec/acceptance/realtime/channel_spec.rb#L1221)
346
+ * [succeeds and publishes without a client_id](./spec/acceptance/realtime/channel_spec.rb#L1232)
346
347
  * when authenticated with a Token string with an implicit client_id
347
348
  * before the client is CONNECTED and the client's identity has been obtained
348
349
  * with a valid client_id in the message
349
- * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1241)
350
+ * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1252)
350
351
  * with an invalid client_id in the message
351
- * [succeeds in the client library but then fails when delivered to Ably](./spec/acceptance/realtime/channel_spec.rb#L1254)
352
+ * [succeeds in the client library but then fails when delivered to Ably](./spec/acceptance/realtime/channel_spec.rb#L1265)
352
353
  * with an empty client_id in the message
353
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1265)
354
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1276)
354
355
  * after the client is CONNECTED and the client's identity is known
355
356
  * with a valid client_id in the message
356
- * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1279)
357
+ * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1290)
357
358
  * with an invalid client_id in the message
358
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1293)
359
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1304)
359
360
  * with an empty client_id in the message
360
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1302)
361
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1313)
361
362
  * when authenticated with a valid client_id
362
363
  * with a valid client_id
363
- * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1324)
364
+ * [succeeds](./spec/acceptance/realtime/channel_spec.rb#L1335)
364
365
  * with a wildcard client_id in the message
365
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1336)
366
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1347)
366
367
  * with an invalid client_id in the message
367
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1343)
368
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1354)
368
369
  * with an empty client_id in the message
369
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1350)
370
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1361)
370
371
  * when anonymous and no client_id
371
372
  * with a client_id in the message
372
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1369)
373
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1380)
373
374
  * with a wildcard client_id in the message
374
- * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1376)
375
+ * [throws an exception](./spec/acceptance/realtime/channel_spec.rb#L1387)
375
376
  * with an empty client_id in the message
376
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1383)
377
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/realtime/channel_spec.rb#L1394)
377
378
  * #subscribe
378
379
  * with an event argument
379
- * [subscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L1399)
380
+ * [subscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L1410)
380
381
  * before attach
381
- * [receives messages as soon as attached](./spec/acceptance/realtime/channel_spec.rb#L1409)
382
+ * [receives messages as soon as attached](./spec/acceptance/realtime/channel_spec.rb#L1420)
382
383
  * with no event argument
383
- * [subscribes for all events](./spec/acceptance/realtime/channel_spec.rb#L1423)
384
+ * [subscribes for all events](./spec/acceptance/realtime/channel_spec.rb#L1434)
384
385
  * with a callback that raises an exception
385
- * [logs the error and continues](./spec/acceptance/realtime/channel_spec.rb#L1435)
386
+ * [logs the error and continues](./spec/acceptance/realtime/channel_spec.rb#L1446)
386
387
  * many times with different event names
387
- * [filters events accordingly to each callback](./spec/acceptance/realtime/channel_spec.rb#L1454)
388
+ * [filters events accordingly to each callback](./spec/acceptance/realtime/channel_spec.rb#L1465)
388
389
  * #unsubscribe
389
390
  * with an event argument
390
- * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L1477)
391
+ * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L1488)
391
392
  * with no event argument
392
- * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L1490)
393
+ * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L1501)
393
394
  * when connection state changes to
394
395
  * :failed
395
396
  * an :attaching channel
396
- * [transitions state to :failed (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1513)
397
+ * [transitions state to :failed (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1524)
397
398
  * an :attached channel
398
- * [transitions state to :failed (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1530)
399
- * [updates the channel error_reason (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1542)
399
+ * [transitions state to :failed (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1541)
400
+ * [updates the channel error_reason (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1553)
400
401
  * a :detached channel
401
- * [remains in the :detached state (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1556)
402
+ * [remains in the :detached state (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1567)
402
403
  * a :failed channel
403
- * [remains in the :failed state and ignores the failure error (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1575)
404
+ * [remains in the :failed state and ignores the failure error (#RTL3a)](./spec/acceptance/realtime/channel_spec.rb#L1586)
404
405
  * a channel ATTACH request
405
- * [fails the deferrable (#RTL4b)](./spec/acceptance/realtime/channel_spec.rb#L1595)
406
+ * [fails the deferrable (#RTL4b)](./spec/acceptance/realtime/channel_spec.rb#L1606)
406
407
  * :closed
407
408
  * an :attached channel
408
- * [transitions state to :detached (#RTL3b)](./spec/acceptance/realtime/channel_spec.rb#L1611)
409
+ * [transitions state to :detached (#RTL3b)](./spec/acceptance/realtime/channel_spec.rb#L1622)
409
410
  * an :attaching channel (#RTL3b)
410
- * [transitions state to :detached](./spec/acceptance/realtime/channel_spec.rb#L1622)
411
+ * [transitions state to :detached](./spec/acceptance/realtime/channel_spec.rb#L1633)
411
412
  * a :detached channel
412
- * [remains in the :detached state (#RTL3b)](./spec/acceptance/realtime/channel_spec.rb#L1637)
413
+ * [remains in the :detached state (#RTL3b)](./spec/acceptance/realtime/channel_spec.rb#L1648)
413
414
  * a :failed channel
414
- * [remains in the :failed state and retains the error_reason (#RTL3b)](./spec/acceptance/realtime/channel_spec.rb#L1657)
415
+ * [remains in the :failed state and retains the error_reason (#RTL3b)](./spec/acceptance/realtime/channel_spec.rb#L1668)
415
416
  * a channel ATTACH request when connection CLOSED
416
- * [fails the deferrable (#RTL4b)](./spec/acceptance/realtime/channel_spec.rb#L1677)
417
+ * [fails the deferrable (#RTL4b)](./spec/acceptance/realtime/channel_spec.rb#L1688)
417
418
  * a channel ATTACH request when connection CLOSING
418
- * [fails the deferrable (#RTL4b)](./spec/acceptance/realtime/channel_spec.rb#L1691)
419
+ * [fails the deferrable (#RTL4b)](./spec/acceptance/realtime/channel_spec.rb#L1702)
419
420
  * :suspended
420
421
  * an :attaching channel
421
- * [transitions state to :suspended (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1707)
422
+ * [transitions state to :suspended (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1718)
422
423
  * an :attached channel
423
- * [transitions state to :suspended (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1721)
424
- * [transitions state automatically to :attaching once the connection is re-established (#RTN15c3)](./spec/acceptance/realtime/channel_spec.rb#L1730)
424
+ * [transitions state to :suspended (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1732)
425
+ * [transitions state automatically to :attaching once the connection is re-established (#RTN15c3)](./spec/acceptance/realtime/channel_spec.rb#L1741)
425
426
  * a :detached channel
426
- * [remains in the :detached state (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1744)
427
+ * [remains in the :detached state (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1755)
427
428
  * a :failed channel
428
- * [remains in the :failed state and retains the error_reason (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1764)
429
+ * [remains in the :failed state and retains the error_reason (#RTL3c)](./spec/acceptance/realtime/channel_spec.rb#L1775)
429
430
  * a channel ATTACH request when connection SUSPENDED (#RTL4b)
430
- * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L1786)
431
+ * [fails the deferrable](./spec/acceptance/realtime/channel_spec.rb#L1797)
431
432
  * :connected
432
433
  * a :suspended channel
433
- * [is automatically reattached (#RTL3d)](./spec/acceptance/realtime/channel_spec.rb#L1802)
434
+ * [is automatically reattached (#RTL3d)](./spec/acceptance/realtime/channel_spec.rb#L1813)
434
435
  * when re-attach attempt fails
435
- * [returns to a suspended state (#RTL3d)](./spec/acceptance/realtime/channel_spec.rb#L1819)
436
+ * [returns to a suspended state (#RTL3d)](./spec/acceptance/realtime/channel_spec.rb#L1830)
436
437
  * :disconnected
437
438
  * with an initialized channel
438
- * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1845)
439
+ * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1856)
439
440
  * with an attaching channel
440
- * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1858)
441
+ * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1869)
441
442
  * with an attached channel
442
- * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1873)
443
+ * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1884)
443
444
  * with a detached channel
444
- * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1885)
445
+ * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1896)
445
446
  * with a failed channel
446
- * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1907)
447
+ * [has no effect on the channel states (#RTL3e)](./spec/acceptance/realtime/channel_spec.rb#L1918)
447
448
  * #presence
448
- * [returns a Ably::Realtime::Presence object](./spec/acceptance/realtime/channel_spec.rb#L1922)
449
+ * [returns a Ably::Realtime::Presence object](./spec/acceptance/realtime/channel_spec.rb#L1933)
449
450
  * channel state change
450
- * [emits a ChannelStateChange object](./spec/acceptance/realtime/channel_spec.rb#L1929)
451
+ * [emits a ChannelStateChange object](./spec/acceptance/realtime/channel_spec.rb#L1940)
451
452
  * ChannelStateChange object
452
- * [has current state](./spec/acceptance/realtime/channel_spec.rb#L1938)
453
- * [has a previous state](./spec/acceptance/realtime/channel_spec.rb#L1947)
454
- * [has the event that generated the state change (#TA5)](./spec/acceptance/realtime/channel_spec.rb#L1956)
455
- * [has an empty reason when there is no error](./spec/acceptance/realtime/channel_spec.rb#L1974)
453
+ * [has current state](./spec/acceptance/realtime/channel_spec.rb#L1949)
454
+ * [has a previous state](./spec/acceptance/realtime/channel_spec.rb#L1958)
455
+ * [has the event that generated the state change (#TA5)](./spec/acceptance/realtime/channel_spec.rb#L1967)
456
+ * [has an empty reason when there is no error](./spec/acceptance/realtime/channel_spec.rb#L1985)
456
457
  * on failure
457
- * [has a reason Error object when there is an error on the channel](./spec/acceptance/realtime/channel_spec.rb#L1987)
458
+ * [has a reason Error object when there is an error on the channel](./spec/acceptance/realtime/channel_spec.rb#L1998)
458
459
  * #resume (#RTL2f)
459
- * [is false when a channel first attaches](./spec/acceptance/realtime/channel_spec.rb#L2000)
460
- * [is true when a connection is recovered and the channel is attached](./spec/acceptance/realtime/channel_spec.rb#L2008)
461
- * [is false when a connection fails to recover and the channel is attached](./spec/acceptance/realtime/channel_spec.rb#L2027)
460
+ * [is false when a channel first attaches](./spec/acceptance/realtime/channel_spec.rb#L2013)
461
+ * [is true when a connection is recovered and the channel is attached](./spec/acceptance/realtime/channel_spec.rb#L2021)
462
+ * [is false when a connection fails to recover and the channel is attached](./spec/acceptance/realtime/channel_spec.rb#L2040)
462
463
  * when a resume fails
463
- * [is false when a resume fails to recover and the channel is automatically re-attached](./spec/acceptance/realtime/channel_spec.rb#L2049)
464
+ * [is false when a resume fails to recover and the channel is automatically re-attached](./spec/acceptance/realtime/channel_spec.rb#L2062)
464
465
  * moves to
465
466
  * suspended
466
- * [all queued messages fail with NACK (#RTL11)](./spec/acceptance/realtime/channel_spec.rb#L2072)
467
- * [all published messages awaiting an ACK do nothing (#RTL11a)](./spec/acceptance/realtime/channel_spec.rb#L2095)
467
+ * [all queued messages fail with NACK (#RTL11)](./spec/acceptance/realtime/channel_spec.rb#L2085)
468
+ * [all published messages awaiting an ACK do nothing (#RTL11a)](./spec/acceptance/realtime/channel_spec.rb#L2108)
468
469
  * failed
469
- * [all queued messages fail with NACK (#RTL11)](./spec/acceptance/realtime/channel_spec.rb#L2072)
470
- * [all published messages awaiting an ACK do nothing (#RTL11a)](./spec/acceptance/realtime/channel_spec.rb#L2095)
470
+ * [all queued messages fail with NACK (#RTL11)](./spec/acceptance/realtime/channel_spec.rb#L2085)
471
+ * [all published messages awaiting an ACK do nothing (#RTL11a)](./spec/acceptance/realtime/channel_spec.rb#L2108)
471
472
  * when it receives a server-initiated DETACHED (#RTL13)
472
473
  * and channel is initialized (#RTL13)
473
- * [does nothing](./spec/acceptance/realtime/channel_spec.rb#L2130)
474
+ * [does nothing](./spec/acceptance/realtime/channel_spec.rb#L2143)
474
475
  * and channel is failed
475
- * [does nothing (#RTL13)](./spec/acceptance/realtime/channel_spec.rb#L2151)
476
+ * [does nothing (#RTL13)](./spec/acceptance/realtime/channel_spec.rb#L2164)
476
477
  * and channel is attached
477
- * [reattaches immediately (#RTL13a)](./spec/acceptance/realtime/channel_spec.rb#L2167)
478
+ * [reattaches immediately (#RTL13a)](./spec/acceptance/realtime/channel_spec.rb#L2180)
478
479
  * and channel is suspended
479
- * [reattaches immediately (#RTL13a)](./spec/acceptance/realtime/channel_spec.rb#L2183)
480
+ * [reattaches immediately (#RTL13a)](./spec/acceptance/realtime/channel_spec.rb#L2196)
480
481
  * and channel is attaching
481
- * [will move to the SUSPENDED state and then attempt to ATTACH with the ATTACHING state (#RTL13b)](./spec/acceptance/realtime/channel_spec.rb#L2205)
482
+ * [will move to the SUSPENDED state and then attempt to ATTACH with the ATTACHING state (#RTL13b)](./spec/acceptance/realtime/channel_spec.rb#L2218)
482
483
  * when it receives an ERROR ProtocolMessage
483
- * [should transition to the failed state and the error_reason should be set (#RTL14)](./spec/acceptance/realtime/channel_spec.rb#L2253)
484
+ * [should transition to the failed state and the error_reason should be set (#RTL14)](./spec/acceptance/realtime/channel_spec.rb#L2266)
484
485
 
485
486
  ### Ably::Realtime::Channels
486
487
  _(see [spec/acceptance/realtime/channels_spec.rb](./spec/acceptance/realtime/channels_spec.rb))_
@@ -519,63 +520,67 @@ _(see [spec/acceptance/realtime/client_spec.rb](./spec/acceptance/realtime/clien
519
520
  * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L69)
520
521
  * with valid :key and :use_token_auth option set to true
521
522
  * [automatically authorizes on connect and generates a token](./spec/acceptance/realtime/client_spec.rb#L82)
522
- * with client_id
523
- * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L95)
524
523
  * with TLS disabled
525
524
  * and a pre-generated Token provided with the :token option
526
525
  * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L69)
527
526
  * with valid :key and :use_token_auth option set to true
528
527
  * [automatically authorizes on connect and generates a token](./spec/acceptance/realtime/client_spec.rb#L82)
529
- * with client_id
530
- * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L95)
531
528
  * with a Proc for the :auth_callback option
532
- * [calls the Proc](./spec/acceptance/realtime/client_spec.rb#L120)
533
- * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/realtime/client_spec.rb#L127)
529
+ * [calls the Proc](./spec/acceptance/realtime/client_spec.rb#L104)
530
+ * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/realtime/client_spec.rb#L111)
534
531
  * when the returned token has a client_id
535
- * [sets Auth#client_id to the new token's client_id immediately when connecting](./spec/acceptance/realtime/client_spec.rb#L135)
536
- * [sets Client#client_id to the new token's client_id immediately when connecting](./spec/acceptance/realtime/client_spec.rb#L143)
532
+ * [sets Auth#client_id to the new token's client_id immediately when connecting](./spec/acceptance/realtime/client_spec.rb#L119)
533
+ * [sets Client#client_id to the new token's client_id immediately when connecting](./spec/acceptance/realtime/client_spec.rb#L127)
537
534
  * with a wildcard client_id token
538
535
  * and an explicit client_id in ClientOptions
539
- * [allows uses the explicit client_id in the connection](./spec/acceptance/realtime/client_spec.rb#L161)
536
+ * [allows uses the explicit client_id in the connection](./spec/acceptance/realtime/client_spec.rb#L145)
540
537
  * and client_id omitted in ClientOptions
541
- * [uses the token provided clientId in the connection](./spec/acceptance/realtime/client_spec.rb#L177)
538
+ * [uses the token provided clientId in the connection](./spec/acceptance/realtime/client_spec.rb#L161)
542
539
  * with an invalid wildcard "*" :client_id
543
- * [raises an exception](./spec/acceptance/realtime/client_spec.rb#L193)
540
+ * [raises an exception](./spec/acceptance/realtime/client_spec.rb#L177)
544
541
  * realtime connection settings
545
542
  * defaults
546
- * [disconnected_retry_timeout is 15s](./spec/acceptance/realtime/client_spec.rb#L202)
547
- * [suspended_retry_timeout is 30s](./spec/acceptance/realtime/client_spec.rb#L207)
543
+ * [disconnected_retry_timeout is 15s](./spec/acceptance/realtime/client_spec.rb#L186)
544
+ * [suspended_retry_timeout is 30s](./spec/acceptance/realtime/client_spec.rb#L191)
548
545
  * overriden in ClientOptions
549
- * [disconnected_retry_timeout is updated](./spec/acceptance/realtime/client_spec.rb#L216)
550
- * [suspended_retry_timeout is updated](./spec/acceptance/realtime/client_spec.rb#L221)
546
+ * [disconnected_retry_timeout is updated](./spec/acceptance/realtime/client_spec.rb#L200)
547
+ * [suspended_retry_timeout is updated](./spec/acceptance/realtime/client_spec.rb#L205)
551
548
  * #connection
552
- * [provides access to the Connection object](./spec/acceptance/realtime/client_spec.rb#L230)
549
+ * [provides access to the Connection object](./spec/acceptance/realtime/client_spec.rb#L214)
553
550
  * #channels
554
- * [provides access to the Channels collection object](./spec/acceptance/realtime/client_spec.rb#L237)
551
+ * [provides access to the Channels collection object](./spec/acceptance/realtime/client_spec.rb#L221)
555
552
  * #auth
556
- * [provides access to the Realtime::Auth object](./spec/acceptance/realtime/client_spec.rb#L244)
553
+ * [provides access to the Realtime::Auth object](./spec/acceptance/realtime/client_spec.rb#L228)
557
554
  * #request (#RSC19*)
558
555
  * get
559
- * [returns an HttpPaginatedResponse object](./spec/acceptance/realtime/client_spec.rb#L254)
556
+ * [returns an HttpPaginatedResponse object](./spec/acceptance/realtime/client_spec.rb#L240)
560
557
  * 404 request to invalid URL
561
- * [returns an object with 404 status code and error message](./spec/acceptance/realtime/client_spec.rb#L263)
558
+ * [returns an object with 404 status code and error message](./spec/acceptance/realtime/client_spec.rb#L249)
562
559
  * paged results
563
- * [provides paging](./spec/acceptance/realtime/client_spec.rb#L277)
560
+ * [provides paging](./spec/acceptance/realtime/client_spec.rb#L263)
561
+ * post
562
+ * [supports post](./spec/acceptance/realtime/client_spec.rb#L294)
563
+ * delete
564
+ * [supports delete](./spec/acceptance/realtime/client_spec.rb#L308)
565
+ * patch
566
+ * [supports patch](./spec/acceptance/realtime/client_spec.rb#L325)
567
+ * put
568
+ * [supports put](./spec/acceptance/realtime/client_spec.rb#L349)
564
569
  * #publish (#TBC)
565
- * [publishing a message implicity connects and publishes the message successfully on the provided channel](./spec/acceptance/realtime/client_spec.rb#L311)
566
- * [publishing does not result in a channel being created](./spec/acceptance/realtime/client_spec.rb#L322)
567
- * [publishing supports an array of Message objects](./spec/acceptance/realtime/client_spec.rb#L349)
568
- * [publishing supports an array of Hash objects](./spec/acceptance/realtime/client_spec.rb#L360)
569
- * [publishing on a closed connection fails](./spec/acceptance/realtime/client_spec.rb#L371)
570
+ * [publishing a message implicity connects and publishes the message successfully on the provided channel](./spec/acceptance/realtime/client_spec.rb#L367)
571
+ * [publishing does not result in a channel being created](./spec/acceptance/realtime/client_spec.rb#L379)
572
+ * [publishing supports an array of Message objects](./spec/acceptance/realtime/client_spec.rb#L407)
573
+ * [publishing supports an array of Hash objects](./spec/acceptance/realtime/client_spec.rb#L419)
574
+ * [publishing on a closed connection fails](./spec/acceptance/realtime/client_spec.rb#L431)
570
575
  * with extras
571
- * [publishing supports extras](./spec/acceptance/realtime/client_spec.rb#L338)
576
+ * [publishing supports extras](./spec/acceptance/realtime/client_spec.rb#L395)
572
577
  * queue_messages ClientOption
573
578
  * when true
574
- * [will queue messages whilst connecting and publish once connected](./spec/acceptance/realtime/client_spec.rb#L387)
579
+ * [will queue messages whilst connecting and publish once connected](./spec/acceptance/realtime/client_spec.rb#L447)
575
580
  * when false
576
- * [will reject messages on an initializing connection](./spec/acceptance/realtime/client_spec.rb#L404)
581
+ * [will reject messages on an initializing connection](./spec/acceptance/realtime/client_spec.rb#L464)
577
582
  * with more than allowed messages in a single publish
578
- * [rejects the publish](./spec/acceptance/realtime/client_spec.rb#L421)
583
+ * [rejects the publish](./spec/acceptance/realtime/client_spec.rb#L481)
579
584
 
580
585
  ### Ably::Realtime::Connection failures
581
586
  _(see [spec/acceptance/realtime/connection_failures_spec.rb](./spec/acceptance/realtime/connection_failures_spec.rb))_
@@ -592,331 +597,349 @@ _(see [spec/acceptance/realtime/connection_failures_spec.rb](./spec/acceptance/r
592
597
  * [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)
593
598
  * request fails due to invalid content
594
599
  * [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)
600
+ * request fails due to slow response and subsequent timeout
601
+ * [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#L127)
602
+ * request fails once due to slow response but succeeds the second time
603
+ * [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#L175)
595
604
  * existing CONNECTED connection
596
605
  * authorize request failure leaves connection in existing condition
597
- * [the connection remains in the CONNECTED state and authorize fails (#RSA4c, #RSA4c1, #RSA4c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L120)
606
+ * [the connection remains in the CONNECTED state and authorize fails (#RSA4c, #RSA4c1, #RSA4c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L196)
598
607
  * with auth_callback
599
608
  * opening a new connection
600
609
  * when callback fails due to an exception
601
- * [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)
610
+ * [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#L224)
602
611
  * existing CONNECTED connection
603
612
  * when callback fails due to the request taking longer than realtime_request_timeout
604
- * [the authorization request fails as configured in the realtime_request_timeout (#RSA4c, #RSA4c1, #RSA4c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L179)
613
+ * [the authorization request fails as configured in the realtime_request_timeout (#RSA4c, #RSA4c1, #RSA4c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L255)
605
614
  * automatic connection retry
606
615
  * with invalid WebSocket host
607
616
  * when disconnected
608
- * [enters the suspended state after multiple attempts to connect](./spec/acceptance/realtime/connection_failures_spec.rb#L244)
617
+ * [enters the suspended state after multiple attempts to connect](./spec/acceptance/realtime/connection_failures_spec.rb#L320)
609
618
  * for the first time
610
- * [reattempts connection immediately and then waits disconnected_retry_timeout for a subsequent attempt](./spec/acceptance/realtime/connection_failures_spec.rb#L265)
619
+ * [reattempts connection immediately and then waits disconnected_retry_timeout for a subsequent attempt](./spec/acceptance/realtime/connection_failures_spec.rb#L341)
611
620
  * #close
612
- * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L282)
621
+ * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L358)
613
622
  * when connection state is :suspended
614
- * [stays in the suspended state after any number of reconnection attempts](./spec/acceptance/realtime/connection_failures_spec.rb#L301)
623
+ * [stays in the suspended state after any number of reconnection attempts](./spec/acceptance/realtime/connection_failures_spec.rb#L377)
615
624
  * for the first time
616
- * [waits suspended_retry_timeout before attempting to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L324)
625
+ * [waits suspended_retry_timeout before attempting to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L400)
617
626
  * #close
618
- * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L346)
627
+ * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L422)
619
628
  * when connection state is :failed
620
629
  * #close
621
- * [will not transition state to :close and fails with an InvalidStateChange exception](./spec/acceptance/realtime/connection_failures_spec.rb#L365)
630
+ * [will not transition state to :close and fails with an InvalidStateChange exception](./spec/acceptance/realtime/connection_failures_spec.rb#L441)
622
631
  * #error_reason
623
- * [contains the error when state is disconnected](./spec/acceptance/realtime/connection_failures_spec.rb#L386)
624
- * [contains the error when state is suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L386)
625
- * [contains the error when state is failed](./spec/acceptance/realtime/connection_failures_spec.rb#L386)
626
- * [is reset to nil when :connected](./spec/acceptance/realtime/connection_failures_spec.rb#L400)
627
- * [is reset to nil when :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L411)
632
+ * [contains the error when state is disconnected](./spec/acceptance/realtime/connection_failures_spec.rb#L462)
633
+ * [contains the error when state is suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L462)
634
+ * [contains the error when state is failed](./spec/acceptance/realtime/connection_failures_spec.rb#L462)
635
+ * [is reset to nil when :connected](./spec/acceptance/realtime/connection_failures_spec.rb#L476)
636
+ * [is reset to nil when :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L487)
628
637
  * #connect
629
638
  * connection opening times out
630
- * [attempts to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L442)
639
+ * [attempts to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L518)
631
640
  * when retry intervals are stubbed to attempt reconnection quickly
632
- * [never calls the provided success block](./spec/acceptance/realtime/connection_failures_spec.rb#L466)
641
+ * [never calls the provided success block](./spec/acceptance/realtime/connection_failures_spec.rb#L542)
633
642
  * connection resume
634
643
  * when DISCONNECTED ProtocolMessage received from the server
635
- * [reconnects automatically and immediately](./spec/acceptance/realtime/connection_failures_spec.rb#L497)
644
+ * [reconnects automatically and immediately](./spec/acceptance/realtime/connection_failures_spec.rb#L573)
636
645
  * connection state freshness is monitored
637
- * [resumes connections when disconnected within the connection_state_ttl period (#RTN15g)](./spec/acceptance/realtime/connection_failures_spec.rb#L518)
646
+ * [resumes connections when disconnected within the connection_state_ttl period (#RTN15g)](./spec/acceptance/realtime/connection_failures_spec.rb#L594)
638
647
  * when connection_state_ttl period has passed since being disconnected
639
- * [clears the local connection state and uses a new connection when the connection_state_ttl period has passed (#RTN15g)](./spec/acceptance/realtime/connection_failures_spec.rb#L558)
648
+ * [clears the local connection state and uses a new connection when the connection_state_ttl period has passed (#RTN15g)](./spec/acceptance/realtime/connection_failures_spec.rb#L634)
640
649
  * when connection_state_ttl period has passed since last activity on the connection
641
- * [does not clear the local connection state when the connection_state_ttl period has passed since last activity, but the idle timeout has not passed (#RTN15g1, #RTN15g2)](./spec/acceptance/realtime/connection_failures_spec.rb#L611)
642
- * [clears the local connection state and uses a new connection when the connection_state_ttl + max_idle_interval period has passed since last activity (#RTN15g1, #RTN15g2)](./spec/acceptance/realtime/connection_failures_spec.rb#L645)
643
- * [still reattaches the channels automatically following a new connection being established (#RTN15g2)](./spec/acceptance/realtime/connection_failures_spec.rb#L680)
650
+ * [does not clear the local connection state when the connection_state_ttl period has passed since last activity, but the idle timeout has not passed (#RTN15g1, #RTN15g2)](./spec/acceptance/realtime/connection_failures_spec.rb#L687)
651
+ * [clears the local connection state and uses a new connection when the connection_state_ttl + max_idle_interval period has passed since last activity (#RTN15g1, #RTN15g2)](./spec/acceptance/realtime/connection_failures_spec.rb#L721)
652
+ * [still reattaches the channels automatically following a new connection being established (#RTN15g2)](./spec/acceptance/realtime/connection_failures_spec.rb#L756)
644
653
  * and subsequently fails to reconnect
645
- * [retries every 15 seconds](./spec/acceptance/realtime/connection_failures_spec.rb#L739)
654
+ * [retries every 15 seconds](./spec/acceptance/realtime/connection_failures_spec.rb#L815)
646
655
  * when websocket transport is abruptly disconnected
647
- * [reconnects automatically](./spec/acceptance/realtime/connection_failures_spec.rb#L782)
656
+ * [reconnects automatically](./spec/acceptance/realtime/connection_failures_spec.rb#L858)
648
657
  * hosts used
649
- * [reconnects with the default host](./spec/acceptance/realtime/connection_failures_spec.rb#L798)
658
+ * [reconnects with the default host](./spec/acceptance/realtime/connection_failures_spec.rb#L874)
650
659
  * after successfully reconnecting and resuming
651
- * [retains connection_id and updates the connection_key (#RTN15e, #RTN16d)](./spec/acceptance/realtime/connection_failures_spec.rb#L822)
652
- * [includes the error received in the connection state change from Ably but leaves the channels attached](./spec/acceptance/realtime/connection_failures_spec.rb#L837)
653
- * [retains channel subscription state](./spec/acceptance/realtime/connection_failures_spec.rb#L863)
654
- * [retains the client_serial (#RTN15c2, #RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L924)
660
+ * [retains connection_id and updates the connection_key (#RTN15e, #RTN16d)](./spec/acceptance/realtime/connection_failures_spec.rb#L898)
661
+ * [includes the error received in the connection state change from Ably but leaves the channels attached](./spec/acceptance/realtime/connection_failures_spec.rb#L913)
662
+ * [retains channel subscription state](./spec/acceptance/realtime/connection_failures_spec.rb#L939)
663
+ * [retains the client_msg_serial (#RTN15c2, #RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L1000)
655
664
  * when messages were published whilst the client was disconnected
656
- * [receives the messages published whilst offline](./spec/acceptance/realtime/connection_failures_spec.rb#L891)
665
+ * [receives the messages published whilst offline](./spec/acceptance/realtime/connection_failures_spec.rb#L967)
657
666
  * when failing to resume
658
667
  * because the connection_key is not or no longer valid
659
- * [updates the connection_id and connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L964)
660
- * [issue a reattach for all attached channels and fail all message awaiting an ACK (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L979)
661
- * [issue a reattach for all attaching channels and fail all queued messages (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L1017)
662
- * [issue a attach for all suspended channels (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L1053)
663
- * [sets the error reason on each channel](./spec/acceptance/realtime/connection_failures_spec.rb#L1091)
664
- * [resets the client_serial (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L1106)
668
+ * [updates the connection_id and connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L1040)
669
+ * [issue a reattach for all attached channels and fail all message awaiting an ACK (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L1055)
670
+ * [issue a reattach for all attaching channels and fail all queued messages (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L1093)
671
+ * [issue a attach for all suspended channels (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L1129)
672
+ * [sets the error reason on each channel](./spec/acceptance/realtime/connection_failures_spec.rb#L1167)
673
+ * [continues to use the client_msg_serial (#RTN15c3)](./spec/acceptance/realtime/connection_failures_spec.rb#L1182)
665
674
  * as the DISCONNECTED window to resume has passed
666
- * [starts a new connection automatically and does not try and resume](./spec/acceptance/realtime/connection_failures_spec.rb#L1143)
675
+ * [starts a new connection automatically and does not try and resume](./spec/acceptance/realtime/connection_failures_spec.rb#L1219)
667
676
  * when an ERROR protocol message is received
668
677
  * whilst connecting
669
678
  * with a token error code in the range 40140 <= code < 40150 (#RTN14b)
670
- * [triggers a re-authentication](./spec/acceptance/realtime/connection_failures_spec.rb#L1174)
679
+ * [triggers a re-authentication](./spec/acceptance/realtime/connection_failures_spec.rb#L1250)
671
680
  * with an error code indicating an error other than a token failure (#RTN14g, #RTN15i)
672
- * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L1190)
681
+ * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L1266)
673
682
  * with no error code indicating an error other than a token failure (#RTN14g, #RTN15i)
674
- * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L1203)
683
+ * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L1279)
675
684
  * whilst connected
676
685
  * with a token error code in the range 40140 <= code < 40150 (#RTN14b)
677
- * [triggers a re-authentication](./spec/acceptance/realtime/connection_failures_spec.rb#L1174)
686
+ * [triggers a re-authentication](./spec/acceptance/realtime/connection_failures_spec.rb#L1250)
678
687
  * with an error code indicating an error other than a token failure (#RTN14g, #RTN15i)
679
- * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L1190)
688
+ * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L1266)
680
689
  * with no error code indicating an error other than a token failure (#RTN14g, #RTN15i)
681
- * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L1203)
690
+ * [causes the connection to fail](./spec/acceptance/realtime/connection_failures_spec.rb#L1279)
682
691
  * whilst resuming
683
692
  * with a token error code in the region 40140 <= code < 40150 (RTN15c5)
684
- * [triggers a re-authentication and then resumes the connection](./spec/acceptance/realtime/connection_failures_spec.rb#L1247)
693
+ * [triggers a re-authentication and then resumes the connection](./spec/acceptance/realtime/connection_failures_spec.rb#L1323)
685
694
  * with any other error (#RTN15c4)
686
- * [moves the connection to the failed state](./spec/acceptance/realtime/connection_failures_spec.rb#L1279)
695
+ * [moves the connection to the failed state](./spec/acceptance/realtime/connection_failures_spec.rb#L1355)
687
696
  * fallback host feature
688
697
  * with custom realtime websocket host option
689
- * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L1323)
698
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L1399)
690
699
  * with custom realtime websocket port option
691
- * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L1341)
700
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L1417)
692
701
  * with non-production environment
693
- * [does not use a fallback host by default](./spec/acceptance/realtime/connection_failures_spec.rb#L1360)
702
+ * :fallback_hosts_use_default is unset
703
+ * [uses fallback hosts by default](./spec/acceptance/realtime/connection_failures_spec.rb#L1441)
694
704
  * :fallback_hosts_use_default is true
695
- * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k7)](./spec/acceptance/realtime/connection_failures_spec.rb#L1378)
696
- * [does not use a fallback host if the connection connects on the default host and then later becomes disconnected](./spec/acceptance/realtime/connection_failures_spec.rb#L1396)
705
+ * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k7)](./spec/acceptance/realtime/connection_failures_spec.rb#L1459)
706
+ * [does not use a fallback host if the connection connects on the default host and then later becomes disconnected](./spec/acceptance/realtime/connection_failures_spec.rb#L1477)
697
707
  * :fallback_hosts array is provided
698
- * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6)](./spec/acceptance/realtime/connection_failures_spec.rb#L1424)
708
+ * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6)](./spec/acceptance/realtime/connection_failures_spec.rb#L1505)
699
709
  * with production environment
700
710
  * when the Internet is down
701
- * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L1460)
711
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L1541)
702
712
  * when the Internet is up
703
713
  * and default options
704
- * [uses a fallback host + the original host once on every subsequent disconnected attempt until suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L1483)
705
- * [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#L1502)
706
- * [uses the correct host name for the WebSocket requests to the fallback hosts](./spec/acceptance/realtime/connection_failures_spec.rb#L1525)
714
+ * [uses a fallback host + the original host once on every subsequent disconnected attempt until suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L1564)
715
+ * [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#L1583)
716
+ * [uses the correct host name for the WebSocket requests to the fallback hosts](./spec/acceptance/realtime/connection_failures_spec.rb#L1606)
707
717
  * :fallback_hosts array is provided by an empty array
708
- * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6)](./spec/acceptance/realtime/connection_failures_spec.rb#L1555)
718
+ * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6)](./spec/acceptance/realtime/connection_failures_spec.rb#L1636)
709
719
  * :fallback_hosts array is provided
710
- * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6)](./spec/acceptance/realtime/connection_failures_spec.rb#L1575)
720
+ * [uses a fallback host on every subsequent disconnected attempt until suspended (#RTN17b, #TO3k6)](./spec/acceptance/realtime/connection_failures_spec.rb#L1656)
711
721
 
712
722
  ### Ably::Realtime::Connection
713
723
  _(see [spec/acceptance/realtime/connection_spec.rb](./spec/acceptance/realtime/connection_spec.rb))_
714
724
  * using JSON protocol
715
725
  * intialization
716
726
  * [connects automatically](./spec/acceptance/realtime/connection_spec.rb#L23)
727
+ * current_host
728
+ * [is available immediately after the client is instanced](./spec/acceptance/realtime/connection_spec.rb#L31)
717
729
  * with :auto_connect option set to false
718
- * [does not connect automatically](./spec/acceptance/realtime/connection_spec.rb#L35)
719
- * [connects when method #connect is called](./spec/acceptance/realtime/connection_spec.rb#L43)
730
+ * [does not connect automatically](./spec/acceptance/realtime/connection_spec.rb#L42)
731
+ * [connects when method #connect is called](./spec/acceptance/realtime/connection_spec.rb#L50)
720
732
  * with token auth
721
733
  * for renewable tokens
722
734
  * that are valid for the duration of the test
723
735
  * with valid pre authorized token expiring in the future
724
- * [uses the existing token created by Auth](./spec/acceptance/realtime/connection_spec.rb#L65)
725
- * with implicit authorisation
726
- * [uses the token created by the implicit authorisation](./spec/acceptance/realtime/connection_spec.rb#L77)
736
+ * [uses the existing token created by Auth](./spec/acceptance/realtime/connection_spec.rb#L72)
727
737
  * that expire
728
738
  * opening a new connection
729
739
  * with almost expired tokens
730
- * [renews token every time after it expires](./spec/acceptance/realtime/connection_spec.rb#L111)
731
- * with immediately expired token
732
- * [renews the token on connect, and makes one immediate subsequent attempt to obtain a new token (#RSA4b)](./spec/acceptance/realtime/connection_spec.rb#L141)
740
+ * [renews token every time after it expires](./spec/acceptance/realtime/connection_spec.rb#L106)
741
+ * with immediately expired token and no fallback hosts
742
+ * [renews the token on connect, and makes one immediate subsequent attempt to obtain a new token (#RSA4b)](./spec/acceptance/realtime/connection_spec.rb#L136)
733
743
  * when disconnected_retry_timeout is 0.5 seconds
734
- * [renews the token on connect, and continues to attempt renew based on the retry schedule](./spec/acceptance/realtime/connection_spec.rb#L156)
744
+ * [renews the token on connect, and continues to attempt renew based on the retry schedule](./spec/acceptance/realtime/connection_spec.rb#L151)
735
745
  * using implicit token auth
736
- * [uses the primary host for subsequent connection and auth requests](./spec/acceptance/realtime/connection_spec.rb#L186)
746
+ * [uses the primary host for subsequent connection and auth requests](./spec/acceptance/realtime/connection_spec.rb#L181)
737
747
  * when connected with a valid non-expired token
738
748
  * that then expires following the connection being opened
739
749
  * the server
740
- * [disconnects the client, and the client automatically renews the token and then reconnects](./spec/acceptance/realtime/connection_spec.rb#L217)
750
+ * [disconnects the client, and the client automatically renews the token and then reconnects](./spec/acceptance/realtime/connection_spec.rb#L212)
741
751
  * connection state
742
- * [retains messages published when disconnected three times during authentication](./spec/acceptance/realtime/connection_spec.rb#L277)
752
+ * [retains messages published when disconnected three times during authentication](./spec/acceptance/realtime/connection_spec.rb#L272)
743
753
  * and subsequent token is invalid
744
- * [transitions the connection to the failed state](./spec/acceptance/realtime/connection_spec.rb#L312)
754
+ * [transitions the connection to the failed state](./spec/acceptance/realtime/connection_spec.rb#L307)
745
755
  * for non-renewable tokens
746
756
  * that are expired
747
757
  * opening a new connection
748
- * [transitions state to failed (#RSA4a)](./spec/acceptance/realtime/connection_spec.rb#L342)
758
+ * [transitions state to failed (#RSA4a)](./spec/acceptance/realtime/connection_spec.rb#L337)
749
759
  * when connected
750
- * [transitions state to failed (#RSA4a)](./spec/acceptance/realtime/connection_spec.rb#L358)
760
+ * [transitions state to failed (#RSA4a)](./spec/acceptance/realtime/connection_spec.rb#L353)
751
761
  * with opaque token string that contain an implicit client_id
752
762
  * string
753
- * [sets the Client#client_id and Auth#client_id once CONNECTED](./spec/acceptance/realtime/connection_spec.rb#L378)
763
+ * [sets the Client#client_id and Auth#client_id once CONNECTED](./spec/acceptance/realtime/connection_spec.rb#L373)
754
764
  * that is incompatible with the current client client_id
755
- * [fails the connection](./spec/acceptance/realtime/connection_spec.rb#L390)
765
+ * [fails the connection](./spec/acceptance/realtime/connection_spec.rb#L385)
756
766
  * wildcard
757
- * [configures the Client#client_id and Auth#client_id with a wildcard once CONNECTED](./spec/acceptance/realtime/connection_spec.rb#L404)
767
+ * [configures the Client#client_id and Auth#client_id with a wildcard once CONNECTED](./spec/acceptance/realtime/connection_spec.rb#L399)
758
768
  * initialization state changes
759
769
  * with implicit #connect
760
- * [are emitted in order](./spec/acceptance/realtime/connection_spec.rb#L436)
770
+ * [are emitted in order](./spec/acceptance/realtime/connection_spec.rb#L431)
761
771
  * with explicit #connect
762
- * [are emitted in order](./spec/acceptance/realtime/connection_spec.rb#L442)
763
- * #connect
764
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/connection_spec.rb#L450)
765
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L455)
766
- * [calls the provided block on success even if state changes to disconnected first](./spec/acceptance/realtime/connection_spec.rb#L462)
772
+ * [are emitted in order](./spec/acceptance/realtime/connection_spec.rb#L437)
773
+ * #connect with no fallbacks
774
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/connection_spec.rb#L447)
775
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L452)
776
+ * [calls the provided block on success even if state changes to disconnected first](./spec/acceptance/realtime/connection_spec.rb#L459)
767
777
  * with invalid auth details
768
- * [calls the Deferrable errback only once on connection failure](./spec/acceptance/realtime/connection_spec.rb#L491)
778
+ * [calls the Deferrable errback only once on connection failure](./spec/acceptance/realtime/connection_spec.rb#L488)
769
779
  * when already connected
770
- * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L507)
780
+ * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L504)
771
781
  * connection#id
772
- * [is null before connecting](./spec/acceptance/realtime/connection_spec.rb#L521)
782
+ * [is null before connecting](./spec/acceptance/realtime/connection_spec.rb#L518)
773
783
  * connection#key
774
- * [is null before connecting](./spec/acceptance/realtime/connection_spec.rb#L528)
784
+ * [is null before connecting](./spec/acceptance/realtime/connection_spec.rb#L525)
775
785
  * once connected
776
786
  * connection#id
777
- * [is a string](./spec/acceptance/realtime/connection_spec.rb#L539)
778
- * [is unique from the connection#key](./spec/acceptance/realtime/connection_spec.rb#L546)
779
- * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L553)
787
+ * [is a string](./spec/acceptance/realtime/connection_spec.rb#L536)
788
+ * [is unique from the connection#key](./spec/acceptance/realtime/connection_spec.rb#L543)
789
+ * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L550)
780
790
  * connection#key
781
- * [is a string](./spec/acceptance/realtime/connection_spec.rb#L562)
782
- * [is unique from the connection#id](./spec/acceptance/realtime/connection_spec.rb#L569)
783
- * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L576)
791
+ * [is a string](./spec/acceptance/realtime/connection_spec.rb#L559)
792
+ * [is unique from the connection#id](./spec/acceptance/realtime/connection_spec.rb#L566)
793
+ * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L573)
784
794
  * following a previous connection being opened and closed
785
- * [reconnects and is provided with a new connection ID and connection key from the server](./spec/acceptance/realtime/connection_spec.rb#L586)
795
+ * [reconnects and is provided with a new connection ID and connection key from the server](./spec/acceptance/realtime/connection_spec.rb#L583)
786
796
  * when closing
787
- * [fails the deferrable before the connection is closed](./spec/acceptance/realtime/connection_spec.rb#L603)
797
+ * [fails the deferrable before the connection is closed](./spec/acceptance/realtime/connection_spec.rb#L600)
788
798
  * #serial connection serial
789
- * [is set to -1 when a new connection is opened](./spec/acceptance/realtime/connection_spec.rb#L620)
790
- * [is set to 0 when a message is received back](./spec/acceptance/realtime/connection_spec.rb#L643)
791
- * [is set to 1 when the second message is received](./spec/acceptance/realtime/connection_spec.rb#L651)
799
+ * [is set to -1 when a new connection is opened](./spec/acceptance/realtime/connection_spec.rb#L617)
800
+ * FAILED: ~~[is set to 0 when a message is received back](./spec/acceptance/realtime/connection_spec.rb#L640)~~
801
+ * [is set to 1 when the second message is received](./spec/acceptance/realtime/connection_spec.rb#L648)
792
802
  * when a message is sent but the ACK has not yet been received
793
- * [the sent message msgSerial is 0 but the connection serial remains at -1](./spec/acceptance/realtime/connection_spec.rb#L628)
803
+ * [the sent message msgSerial is 0 but the connection serial remains at -1](./spec/acceptance/realtime/connection_spec.rb#L625)
804
+ * #msgSerial
805
+ * when messages are queued for publish before a connection is established
806
+ * [the msgSerial is always incrementing (and not reset when the new connection is established) ensuring messages are never de-duped by the realtime service](./spec/acceptance/realtime/connection_spec.rb#L676)
794
807
  * #close
795
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/connection_spec.rb#L668)
796
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L675)
808
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/connection_spec.rb#L696)
809
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L703)
797
810
  * when already closed
798
- * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L686)
811
+ * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L714)
799
812
  * when connection state is
800
813
  * :initialized
801
- * [changes the connection state to :closing and then immediately :closed without sending a ProtocolMessage CLOSE](./spec/acceptance/realtime/connection_spec.rb#L713)
814
+ * [changes the connection state to :closing and then immediately :closed without sending a ProtocolMessage CLOSE](./spec/acceptance/realtime/connection_spec.rb#L741)
802
815
  * :connected
803
- * [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#L730)
816
+ * [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#L758)
804
817
  * with an unresponsive connection
805
- * [force closes the connection when a :closed ProtocolMessage response is not received](./spec/acceptance/realtime/connection_spec.rb#L757)
818
+ * [force closes the connection when a :closed ProtocolMessage response is not received](./spec/acceptance/realtime/connection_spec.rb#L785)
806
819
  * #ping
807
- * [echoes a heart beat (#RTN13a)](./spec/acceptance/realtime/connection_spec.rb#L779)
808
- * [sends a unique ID in each protocol message (#RTN13e)](./spec/acceptance/realtime/connection_spec.rb#L789)
809
- * [waits until the connection becomes CONNECTED when in the CONNETING state](./spec/acceptance/realtime/connection_spec.rb#L813)
820
+ * [echoes a heart beat (#RTN13a)](./spec/acceptance/realtime/connection_spec.rb#L807)
821
+ * [sends a unique ID in each protocol message (#RTN13e)](./spec/acceptance/realtime/connection_spec.rb#L817)
822
+ * [waits until the connection becomes CONNECTED when in the CONNETING state](./spec/acceptance/realtime/connection_spec.rb#L841)
810
823
  * with incompatible states
811
824
  * when not connected
812
- * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L826)
825
+ * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L854)
813
826
  * when suspended
814
- * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L835)
827
+ * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L863)
815
828
  * when failed
816
- * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L847)
829
+ * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L875)
817
830
  * when closed
818
- * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L859)
831
+ * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L887)
819
832
  * when it becomes closed
820
- * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L873)
833
+ * [fails the deferrable (#RTN13b)](./spec/acceptance/realtime/connection_spec.rb#L901)
821
834
  * with a success block that raises an exception
822
- * [catches the exception and logs the error](./spec/acceptance/realtime/connection_spec.rb#L886)
835
+ * [catches the exception and logs the error](./spec/acceptance/realtime/connection_spec.rb#L914)
823
836
  * when ping times out
824
- * [fails the deferrable logs a warning (#RTN13a, #RTN13c)](./spec/acceptance/realtime/connection_spec.rb#L900)
825
- * [yields to the block with a nil value](./spec/acceptance/realtime/connection_spec.rb#L919)
837
+ * [fails the deferrable logs a warning (#RTN13a, #RTN13c)](./spec/acceptance/realtime/connection_spec.rb#L928)
838
+ * [yields to the block with a nil value](./spec/acceptance/realtime/connection_spec.rb#L947)
826
839
  * Heartbeats (#RTN23)
827
840
  * heartbeat interval
828
841
  * when reduced artificially
829
- * [is the sum of the max_idle_interval and realtime_request_timeout (#RTN23a)](./spec/acceptance/realtime/connection_spec.rb#L946)
830
- * [disconnects the transport if no heartbeat received since connected (#RTN23a)](./spec/acceptance/realtime/connection_spec.rb#L956)
831
- * [disconnects the transport if no heartbeat received since last event received (#RTN23a)](./spec/acceptance/realtime/connection_spec.rb#L967)
842
+ * [is the sum of the max_idle_interval and realtime_request_timeout (#RTN23a)](./spec/acceptance/realtime/connection_spec.rb#L974)
843
+ * [disconnects the transport if no heartbeat received since connected (#RTN23a)](./spec/acceptance/realtime/connection_spec.rb#L984)
844
+ * [disconnects the transport if no heartbeat received since last event received (#RTN23a)](./spec/acceptance/realtime/connection_spec.rb#L995)
832
845
  * transport-level heartbeats are supported in the websocket transport
833
- * [provides the heartbeats argument in the websocket connection params (#RTN23b)](./spec/acceptance/realtime/connection_spec.rb#L982)
834
- * [receives websocket heartbeat messages (#RTN23b) [slow test as need to wait for heartbeat]](./spec/acceptance/realtime/connection_spec.rb#L991)
846
+ * [provides the heartbeats argument in the websocket connection params (#RTN23b)](./spec/acceptance/realtime/connection_spec.rb#L1010)
847
+ * [receives websocket heartbeat messages (#RTN23b) [slow test as need to wait for heartbeat]](./spec/acceptance/realtime/connection_spec.rb#L1019)
835
848
  * with websocket heartbeats disabled (undocumented)
836
- * PENDING: *[does not provide the heartbeats argument in the websocket connection params (#RTN23b)](./spec/acceptance/realtime/connection_spec.rb#L1007)*
837
- * [receives websocket protocol messages (#RTN23b) [slow test as need to wait for heartbeat]](./spec/acceptance/realtime/connection_spec.rb#L1017)
849
+ * [does not provide the heartbeats argument in the websocket connection params (#RTN23b)](./spec/acceptance/realtime/connection_spec.rb#L1035)
850
+ * [receives websocket protocol messages (#RTN23b) [slow test as need to wait for heartbeat]](./spec/acceptance/realtime/connection_spec.rb#L1044)
838
851
  * #details
839
- * [is nil before connected](./spec/acceptance/realtime/connection_spec.rb#L1035)
840
- * [contains the ConnectionDetails object once connected (#RTN21)](./spec/acceptance/realtime/connection_spec.rb#L1042)
841
- * [contains the new ConnectionDetails object once a subsequent connection is created (#RTN21)](./spec/acceptance/realtime/connection_spec.rb#L1051)
852
+ * [is nil before connected](./spec/acceptance/realtime/connection_spec.rb#L1062)
853
+ * [contains the ConnectionDetails object once connected (#RTN21)](./spec/acceptance/realtime/connection_spec.rb#L1069)
854
+ * [contains the new ConnectionDetails object once a subsequent connection is created (#RTN21)](./spec/acceptance/realtime/connection_spec.rb#L1078)
842
855
  * with a different default connection_state_ttl
843
- * [updates the private Connection#connection_state_ttl when received from Ably in ConnectionDetails](./spec/acceptance/realtime/connection_spec.rb#L1072)
856
+ * [updates the private Connection#connection_state_ttl when received from Ably in ConnectionDetails](./spec/acceptance/realtime/connection_spec.rb#L1099)
844
857
  * recovery
845
858
  * #recovery_key
846
- * [is composed of connection key and serial that is kept up to date with each message ACK received](./spec/acceptance/realtime/connection_spec.rb#L1109)
847
- * [is available when connection is in one of the states: connecting, connected, disconnected](./spec/acceptance/realtime/connection_spec.rb#L1137)
848
- * [is nil when connection is explicitly CLOSED](./spec/acceptance/realtime/connection_spec.rb#L1166)
859
+ * [is composed of connection key and serial that is kept up to date with each message ACK received](./spec/acceptance/realtime/connection_spec.rb#L1136)
860
+ * [is available when connection is in one of the states: connecting, connected, disconnected](./spec/acceptance/realtime/connection_spec.rb#L1164)
861
+ * [is nil when connection is explicitly CLOSED](./spec/acceptance/realtime/connection_spec.rb#L1194)
849
862
  * opening a new connection using a recently disconnected connection's #recovery_key
850
863
  * connection#id after recovery
851
- * [remains the same](./spec/acceptance/realtime/connection_spec.rb#L1178)
864
+ * [remains the same](./spec/acceptance/realtime/connection_spec.rb#L1206)
852
865
  * when messages have been sent whilst the old connection is disconnected
853
866
  * the new connection
854
- * [recovers server-side queued messages](./spec/acceptance/realtime/connection_spec.rb#L1214)
867
+ * [recovers server-side queued messages](./spec/acceptance/realtime/connection_spec.rb#L1242)
868
+ * when messages have been published
869
+ * the new connection
870
+ * [uses the correct msgSerial from the old connection](./spec/acceptance/realtime/connection_spec.rb#L1271)
871
+ * when messages are published before the new connection is recovered
872
+ * the new connection
873
+ * [uses the correct msgSerial from the old connection for the queued messages](./spec/acceptance/realtime/connection_spec.rb#L1301)
855
874
  * with :recover option
856
875
  * with invalid syntax
857
- * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L1246)
876
+ * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L1348)
858
877
  * with invalid formatted value sent to server
859
- * [sets the #error_reason and moves the connection to FAILED](./spec/acceptance/realtime/connection_spec.rb#L1255)
878
+ * [sets the #error_reason and moves the connection to FAILED](./spec/acceptance/realtime/connection_spec.rb#L1357)
860
879
  * with expired (missing) value sent to server
861
- * [connects but sets the error reason and includes the reason in the state change](./spec/acceptance/realtime/connection_spec.rb#L1270)
880
+ * [connects but sets the error reason and includes the reason in the state change](./spec/acceptance/realtime/connection_spec.rb#L1372)
862
881
  * with many connections simultaneously
863
- * [opens each with a unique connection#id and connection#key](./spec/acceptance/realtime/connection_spec.rb#L1289)
882
+ * [opens each with a unique connection#id and connection#key](./spec/acceptance/realtime/connection_spec.rb#L1391)
864
883
  * when a state transition is unsupported
865
- * [logs the invalid state change as fatal](./spec/acceptance/realtime/connection_spec.rb#L1309)
884
+ * [logs the invalid state change as fatal](./spec/acceptance/realtime/connection_spec.rb#L1411)
866
885
  * protocol failure
867
886
  * receiving an invalid ProtocolMessage
868
- * [emits an error on the connection and logs a fatal error message](./spec/acceptance/realtime/connection_spec.rb#L1325)
887
+ * [emits an error on the connection and logs a fatal error message](./spec/acceptance/realtime/connection_spec.rb#L1427)
869
888
  * undocumented method
870
889
  * #internet_up?
871
- * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1343)
890
+ * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1445)
872
891
  * internet up URL protocol
873
892
  * when using TLS for the connection
874
- * [uses TLS for the Internet check to https://internet-up.ably-realtime.com/is-the-internet-up.txt](./spec/acceptance/realtime/connection_spec.rb#L1354)
893
+ * [uses TLS for the Internet check to https://internet-up.ably-realtime.com/is-the-internet-up.txt](./spec/acceptance/realtime/connection_spec.rb#L1456)
875
894
  * when using a non-secured connection
876
- * [uses TLS for the Internet check to http://internet-up.ably-realtime.com/is-the-internet-up.txt](./spec/acceptance/realtime/connection_spec.rb#L1364)
895
+ * [uses TLS for the Internet check to http://internet-up.ably-realtime.com/is-the-internet-up.txt](./spec/acceptance/realtime/connection_spec.rb#L1466)
877
896
  * when the Internet is up
878
- * [calls the block with true](./spec/acceptance/realtime/connection_spec.rb#L1395)
879
- * [calls the success callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1402)
897
+ * [calls the block with true](./spec/acceptance/realtime/connection_spec.rb#L1497)
898
+ * [calls the success callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1504)
880
899
  * with a TLS connection
881
- * [checks the Internet up URL over TLS](./spec/acceptance/realtime/connection_spec.rb#L1378)
900
+ * [checks the Internet up URL over TLS](./spec/acceptance/realtime/connection_spec.rb#L1480)
882
901
  * with a non-TLS connection
883
- * [checks the Internet up URL over TLS](./spec/acceptance/realtime/connection_spec.rb#L1388)
902
+ * [checks the Internet up URL over TLS](./spec/acceptance/realtime/connection_spec.rb#L1490)
884
903
  * when the Internet is down
885
- * [calls the block with false](./spec/acceptance/realtime/connection_spec.rb#L1417)
886
- * [calls the failure callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1424)
904
+ * [calls the block with false](./spec/acceptance/realtime/connection_spec.rb#L1519)
905
+ * [calls the failure callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L1526)
887
906
  * state change side effects
888
907
  * when connection enters the :disconnected state
889
- * [queues messages to be sent and all channels remain attached](./spec/acceptance/realtime/connection_spec.rb#L1438)
908
+ * [queues messages to be sent and all channels remain attached](./spec/acceptance/realtime/connection_spec.rb#L1540)
890
909
  * when connection enters the :suspended state
891
- * [moves the channels into the suspended state and prevents publishing of messages on those channels](./spec/acceptance/realtime/connection_spec.rb#L1471)
910
+ * [moves the channels into the suspended state and prevents publishing of messages on those channels](./spec/acceptance/realtime/connection_spec.rb#L1573)
892
911
  * when connection enters the :failed state
893
- * [sets all channels to failed and prevents publishing of messages on those channels](./spec/acceptance/realtime/connection_spec.rb#L1502)
912
+ * [sets all channels to failed and prevents publishing of messages on those channels](./spec/acceptance/realtime/connection_spec.rb#L1604)
894
913
  * connection state change
895
- * [emits event to all and single subscribers](./spec/acceptance/realtime/connection_spec.rb#L1516)
896
- * [emits a ConnectionStateChange object](./spec/acceptance/realtime/connection_spec.rb#L1531)
914
+ * [emits event to all and single subscribers](./spec/acceptance/realtime/connection_spec.rb#L1618)
915
+ * [emits a ConnectionStateChange object](./spec/acceptance/realtime/connection_spec.rb#L1633)
897
916
  * ConnectionStateChange object
898
- * [has current state](./spec/acceptance/realtime/connection_spec.rb#L1539)
899
- * [has a previous state](./spec/acceptance/realtime/connection_spec.rb#L1547)
900
- * [has the event that generated the state change (#TH5)](./spec/acceptance/realtime/connection_spec.rb#L1555)
901
- * [has an empty reason when there is no error](./spec/acceptance/realtime/connection_spec.rb#L1571)
917
+ * [has current state](./spec/acceptance/realtime/connection_spec.rb#L1641)
918
+ * [has a previous state](./spec/acceptance/realtime/connection_spec.rb#L1649)
919
+ * [has the event that generated the state change (#TH5)](./spec/acceptance/realtime/connection_spec.rb#L1657)
920
+ * [has an empty reason when there is no error](./spec/acceptance/realtime/connection_spec.rb#L1673)
902
921
  * on failure
903
- * [has a reason Error object when there is an error on the connection](./spec/acceptance/realtime/connection_spec.rb#L1584)
922
+ * [has a reason Error object when there is an error on the connection](./spec/acceptance/realtime/connection_spec.rb#L1686)
904
923
  * retry_in
905
- * [is nil when a retry is not required](./spec/acceptance/realtime/connection_spec.rb#L1599)
906
- * [is 0 when first attempt to connect fails](./spec/acceptance/realtime/connection_spec.rb#L1606)
907
- * [is 0 when an immediate reconnect will occur](./spec/acceptance/realtime/connection_spec.rb#L1616)
908
- * [contains the next retry period when an immediate reconnect will not occur](./spec/acceptance/realtime/connection_spec.rb#L1626)
924
+ * [is nil when a retry is not required](./spec/acceptance/realtime/connection_spec.rb#L1701)
925
+ * [is 0 when first attempt to connect fails](./spec/acceptance/realtime/connection_spec.rb#L1708)
926
+ * [is 0 when an immediate reconnect will occur](./spec/acceptance/realtime/connection_spec.rb#L1718)
927
+ * [contains the next retry period when an immediate reconnect will not occur](./spec/acceptance/realtime/connection_spec.rb#L1728)
909
928
  * whilst CONNECTED
910
929
  * when a CONNECTED message is received (#RTN24)
911
- * [emits an UPDATE event](./spec/acceptance/realtime/connection_spec.rb#L1661)
912
- * [updates the ConnectionDetail and Connection attributes (#RTC8a1)](./spec/acceptance/realtime/connection_spec.rb#L1676)
930
+ * [emits an UPDATE event](./spec/acceptance/realtime/connection_spec.rb#L1763)
931
+ * [updates the ConnectionDetail and Connection attributes (#RTC8a1)](./spec/acceptance/realtime/connection_spec.rb#L1778)
913
932
  * when a CONNECTED message with an error is received
914
- * [emits an UPDATE event](./spec/acceptance/realtime/connection_spec.rb#L1711)
933
+ * [emits an UPDATE event](./spec/acceptance/realtime/connection_spec.rb#L1813)
915
934
  * version params
916
- * [sends the protocol version param v (#G4, #RTN2f)](./spec/acceptance/realtime/connection_spec.rb#L1732)
917
- * [sends the lib version param lib (#RTN2g)](./spec/acceptance/realtime/connection_spec.rb#L1741)
935
+ * [sends the protocol version param v (#G4, #RTN2f)](./spec/acceptance/realtime/connection_spec.rb#L1834)
936
+ * [sends the lib version param lib (#RTN2g)](./spec/acceptance/realtime/connection_spec.rb#L1843)
918
937
  * with variant
919
- * [sends the lib version param lib with the variant (#RTN2g + #RSC7b)](./spec/acceptance/realtime/connection_spec.rb#L1761)
938
+ * [sends the lib version param lib with the variant (#RTN2g + #RSC7b)](./spec/acceptance/realtime/connection_spec.rb#L1863)
939
+ * transport_params (#RTC1f)
940
+ * [pases transport_params to query](./spec/acceptance/realtime/connection_spec.rb#L1877)
941
+ * when changing default param
942
+ * [overrides default param (#RTC1f1)](./spec/acceptance/realtime/connection_spec.rb#L1890)
920
943
 
921
944
  ### Ably::Realtime::Channel Message
922
945
  _(see [spec/acceptance/realtime/message_spec.rb](./spec/acceptance/realtime/message_spec.rb))_
@@ -935,102 +958,102 @@ _(see [spec/acceptance/realtime/message_spec.rb](./spec/acceptance/realtime/mess
935
958
  * JSON Object (Hash)
936
959
  * [is encoded and decoded to the same hash](./spec/acceptance/realtime/message_spec.rb#L93)
937
960
  * JSON Array
938
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/message_spec.rb#L102)
961
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/message_spec.rb#L101)
939
962
  * nil
940
- * [is encoded and decoded to the same Array](./spec/acceptance/realtime/message_spec.rb#L108)
963
+ * [is encoded and decoded to the same Array](./spec/acceptance/realtime/message_spec.rb#L107)
941
964
  * with unsupported data payload content type
942
965
  * Integer
943
- * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/realtime/message_spec.rb#L119)
966
+ * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/realtime/message_spec.rb#L118)
944
967
  * Float
945
- * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/realtime/message_spec.rb#L128)
968
+ * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/realtime/message_spec.rb#L127)
946
969
  * Boolean
947
- * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/realtime/message_spec.rb#L137)
970
+ * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/realtime/message_spec.rb#L136)
948
971
  * False
949
- * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/realtime/message_spec.rb#L146)
972
+ * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/realtime/message_spec.rb#L145)
950
973
  * with ASCII_8BIT message name
951
- * [is converted into UTF_8](./spec/acceptance/realtime/message_spec.rb#L155)
974
+ * [is converted into UTF_8](./spec/acceptance/realtime/message_spec.rb#L154)
952
975
  * when the message publisher has a client_id
953
- * [contains a #client_id attribute](./spec/acceptance/realtime/message_spec.rb#L171)
976
+ * [contains a #client_id attribute](./spec/acceptance/realtime/message_spec.rb#L170)
954
977
  * #connection_id attribute
955
978
  * over realtime
956
- * [matches the sender connection#id](./spec/acceptance/realtime/message_spec.rb#L184)
979
+ * [matches the sender connection#id](./spec/acceptance/realtime/message_spec.rb#L183)
957
980
  * when retrieved over REST
958
- * [matches the sender connection#id](./spec/acceptance/realtime/message_spec.rb#L196)
981
+ * [matches the sender connection#id](./spec/acceptance/realtime/message_spec.rb#L195)
959
982
  * local echo when published
960
- * [is enabled by default](./spec/acceptance/realtime/message_spec.rb#L208)
983
+ * [is enabled by default](./spec/acceptance/realtime/message_spec.rb#L207)
961
984
  * with :echo_messages option set to false
962
- * [will not echo messages to the client but will still broadcast messages to other connected clients](./spec/acceptance/realtime/message_spec.rb#L228)
963
- * [will not echo messages to the client from other REST clients publishing using that connection_key](./spec/acceptance/realtime/message_spec.rb#L247)
964
- * [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#L260)
985
+ * [will not echo messages to the client but will still broadcast messages to other connected clients](./spec/acceptance/realtime/message_spec.rb#L227)
986
+ * [will not echo messages to the client from other REST clients publishing using that connection_key](./spec/acceptance/realtime/message_spec.rb#L246)
987
+ * [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)
965
988
  * publishing lots of messages across two connections
966
- * [sends and receives the messages on both opened connections and calls the success callbacks for each message published](./spec/acceptance/realtime/message_spec.rb#L286)
989
+ * [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)
967
990
  * without suitable publishing permissions
968
- * [calls the error callback](./spec/acceptance/realtime/message_spec.rb#L331)
991
+ * [calls the error callback](./spec/acceptance/realtime/message_spec.rb#L330)
969
992
  * server incorrectly resends a message that was already received by the client library
970
- * [discards the message and logs it as an error to the channel](./spec/acceptance/realtime/message_spec.rb#L350)
993
+ * [discards the message and logs it as an error to the channel](./spec/acceptance/realtime/message_spec.rb#L349)
971
994
  * encoding and decoding encrypted messages
972
995
  * with AES-128-CBC using crypto-data-128.json fixtures (#RTL7d)
973
996
  * item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
974
997
  * behaves like an Ably encrypter and decrypter
975
998
  * with #publish and #subscribe
976
- * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L415)
977
- * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L435)
999
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L416)
1000
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L436)
978
1001
  * item 1 with encrypted encoding cipher+aes-128-cbc/base64
979
1002
  * behaves like an Ably encrypter and decrypter
980
1003
  * with #publish and #subscribe
981
- * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L415)
982
- * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L435)
1004
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L416)
1005
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L436)
983
1006
  * item 2 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
984
1007
  * behaves like an Ably encrypter and decrypter
985
1008
  * with #publish and #subscribe
986
- * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L415)
987
- * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L435)
1009
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L416)
1010
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L436)
988
1011
  * item 3 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
989
1012
  * behaves like an Ably encrypter and decrypter
990
1013
  * with #publish and #subscribe
991
- * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L415)
992
- * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L435)
1014
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L416)
1015
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L436)
993
1016
  * with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d)
994
1017
  * item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
995
1018
  * behaves like an Ably encrypter and decrypter
996
1019
  * with #publish and #subscribe
997
- * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L415)
998
- * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L435)
1020
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L416)
1021
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L436)
999
1022
  * item 1 with encrypted encoding cipher+aes-256-cbc/base64
1000
1023
  * behaves like an Ably encrypter and decrypter
1001
1024
  * with #publish and #subscribe
1002
- * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L415)
1003
- * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L435)
1025
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L416)
1026
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L436)
1004
1027
  * item 2 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
1005
1028
  * behaves like an Ably encrypter and decrypter
1006
1029
  * with #publish and #subscribe
1007
- * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L415)
1008
- * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L435)
1030
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L416)
1031
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L436)
1009
1032
  * item 3 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
1010
1033
  * behaves like an Ably encrypter and decrypter
1011
1034
  * with #publish and #subscribe
1012
- * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L415)
1013
- * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L435)
1035
+ * [encrypts message automatically before they are pushed to the server (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L416)
1036
+ * [sends and receives messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/realtime/message_spec.rb#L436)
1014
1037
  * with multiple sends from one client to another
1015
- * [encrypts and decrypts all messages](./spec/acceptance/realtime/message_spec.rb#L474)
1016
- * [receives raw messages with the correct encoding](./spec/acceptance/realtime/message_spec.rb#L491)
1038
+ * [encrypts and decrypts all messages](./spec/acceptance/realtime/message_spec.rb#L475)
1039
+ * [receives raw messages with the correct encoding](./spec/acceptance/realtime/message_spec.rb#L492)
1017
1040
  * subscribing with a different transport protocol
1018
- * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L525)
1019
- * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L525)
1020
- * [delivers a Hash payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L525)
1041
+ * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L526)
1042
+ * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L526)
1043
+ * [delivers a Hash payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L526)
1021
1044
  * publishing on an unencrypted channel and subscribing on an encrypted channel with another client
1022
- * [does not attempt to decrypt the message](./spec/acceptance/realtime/message_spec.rb#L546)
1045
+ * [does not attempt to decrypt the message](./spec/acceptance/realtime/message_spec.rb#L547)
1023
1046
  * publishing on an encrypted channel and subscribing on an unencrypted channel with another client
1024
- * [delivers the message but still encrypted with a value in the #encoding attribute (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L564)
1025
- * [logs a Cipher error (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L575)
1047
+ * [delivers the message but still encrypted with a value in the #encoding attribute (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L565)
1048
+ * [logs a Cipher error (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L576)
1026
1049
  * publishing on an encrypted channel and subscribing with a different algorithm on another client
1027
- * [delivers the message but still encrypted with the cipher detials in the #encoding attribute (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L595)
1028
- * [emits a Cipher error on the channel (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L604)
1050
+ * [delivers the message but still encrypted with the cipher detials in the #encoding attribute (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L596)
1051
+ * [emits a Cipher error on the channel (#RTL7e)](./spec/acceptance/realtime/message_spec.rb#L605)
1029
1052
  * publishing on an encrypted channel and subscribing with a different key on another client
1030
- * [delivers the message but still encrypted with the cipher details in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L624)
1031
- * [emits a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L635)
1053
+ * [delivers the message but still encrypted with the cipher details in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L625)
1054
+ * [emits a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L636)
1032
1055
  * when message is published, the connection disconnects before the ACK is received, and the connection is resumed
1033
- * [publishes the message again, later receives the ACK and only one message is ever received from Ably](./spec/acceptance/realtime/message_spec.rb#L654)
1056
+ * [publishes the message again, later receives the ACK and only one message is ever received from Ably](./spec/acceptance/realtime/message_spec.rb#L655)
1034
1057
  * when message is published, the connection disconnects before the ACK is received
1035
1058
  * the connection is not resumed
1036
1059
  * [calls the errback for all messages](./spec/acceptance/realtime/message_spec.rb#L697)
@@ -1087,11 +1110,6 @@ _(see [spec/acceptance/realtime/presence_history_spec.rb](./spec/acceptance/real
1087
1110
  * using JSON protocol
1088
1111
  * [provides up to the moment presence history](./spec/acceptance/realtime/presence_history_spec.rb#L21)
1089
1112
  * [ensures REST presence history message IDs match ProtocolMessage wrapped message and connection IDs via Realtime](./spec/acceptance/realtime/presence_history_spec.rb#L42)
1090
- * with option until_attach: true
1091
- * [retrieves all presence messages before channel was attached](./spec/acceptance/realtime/presence_history_spec.rb#L61)
1092
- * [fails with an exception unless state is attached](./spec/acceptance/realtime/presence_history_spec.rb#L106)
1093
- * and two pages of messages
1094
- * [retrieves two pages of messages before channel was attached](./spec/acceptance/realtime/presence_history_spec.rb#L81)
1095
1113
 
1096
1114
  ### Ably::Realtime::Presence
1097
1115
  _(see [spec/acceptance/realtime/presence_spec.rb](./spec/acceptance/realtime/presence_spec.rb))_
@@ -1171,7 +1189,7 @@ _(see [spec/acceptance/realtime/presence_spec.rb](./spec/acceptance/realtime/pre
1171
1189
  * #update
1172
1190
  * [without previous #enter automatically enters](./spec/acceptance/realtime/presence_spec.rb#L1105)
1173
1191
  * [updates the data if :data argument provided](./spec/acceptance/realtime/presence_spec.rb#L1130)
1174
- * [updates the data to nil if :data argument is not provided (assumes nil value)](./spec/acceptance/realtime/presence_spec.rb#L1140)
1192
+ * [updates the data to nil if :data argument is not provided (assumes nil value)](./spec/acceptance/realtime/presence_spec.rb#L1142)
1175
1193
  * when ENTERED
1176
1194
  * [has no effect on the state](./spec/acceptance/realtime/presence_spec.rb#L1115)
1177
1195
  * it should behave like a public presence method
@@ -1214,16 +1232,16 @@ _(see [spec/acceptance/realtime/presence_spec.rb](./spec/acceptance/realtime/pre
1214
1232
  * if connection fails before success
1215
1233
  * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L331)
1216
1234
  * #leave
1217
- * [succeeds and does not emit an event (#RTP10d)](./spec/acceptance/realtime/presence_spec.rb#L1224)
1235
+ * [succeeds and does not emit an event (#RTP10d)](./spec/acceptance/realtime/presence_spec.rb#L1236)
1218
1236
  * :data option
1219
1237
  * when set to a string
1220
- * [emits the new data for the leave event](./spec/acceptance/realtime/presence_spec.rb#L1159)
1238
+ * [emits the new data for the leave event](./spec/acceptance/realtime/presence_spec.rb#L1163)
1221
1239
  * when set to nil
1222
- * [emits the last value for the data attribute when leaving](./spec/acceptance/realtime/presence_spec.rb#L1172)
1240
+ * [emits the last value for the data attribute when leaving](./spec/acceptance/realtime/presence_spec.rb#L1178)
1223
1241
  * when not passed as an argument (i.e. nil)
1224
- * [emits the previous value for the data attribute when leaving](./spec/acceptance/realtime/presence_spec.rb#L1185)
1242
+ * [emits the previous value for the data attribute when leaving](./spec/acceptance/realtime/presence_spec.rb#L1193)
1225
1243
  * and sync is complete
1226
- * [does not cache members that have left](./spec/acceptance/realtime/presence_spec.rb#L1198)
1244
+ * [does not cache members that have left](./spec/acceptance/realtime/presence_spec.rb#L1208)
1227
1245
  * it should behave like a public presence method
1228
1246
  * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L293)
1229
1247
  * [allows a block to be passed in that is executed upon success](./spec/acceptance/realtime/presence_spec.rb#L300)
@@ -1250,17 +1268,17 @@ _(see [spec/acceptance/realtime/presence_spec.rb](./spec/acceptance/realtime/pre
1250
1268
  * if connection fails before success
1251
1269
  * [calls the Deferrable errback if channel is detached](./spec/acceptance/realtime/presence_spec.rb#L331)
1252
1270
  * :left event
1253
- * [emits the data defined in enter](./spec/acceptance/realtime/presence_spec.rb#L1240)
1254
- * [emits the data defined in update](./spec/acceptance/realtime/presence_spec.rb#L1251)
1271
+ * [emits the data defined in enter](./spec/acceptance/realtime/presence_spec.rb#L1254)
1272
+ * [emits the data defined in update](./spec/acceptance/realtime/presence_spec.rb#L1267)
1255
1273
  * entering/updating/leaving presence state on behalf of another client_id
1256
1274
  * #enter_client
1257
1275
  * multiple times on the same channel with different client_ids
1258
- * [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#L1274)
1259
- * [enters a channel and sets the data based on the provided :data option](./spec/acceptance/realtime/presence_spec.rb#L1288)
1276
+ * [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#L1292)
1277
+ * [enters a channel and sets the data based on the provided :data option](./spec/acceptance/realtime/presence_spec.rb#L1306)
1260
1278
  * message #connection_id
1261
- * [matches the current client connection_id](./spec/acceptance/realtime/presence_spec.rb#L1307)
1279
+ * [matches the current client connection_id](./spec/acceptance/realtime/presence_spec.rb#L1327)
1262
1280
  * without necessary capabilities to enter on behalf of another client
1263
- * [calls the Deferrable errback on capabilities failure](./spec/acceptance/realtime/presence_spec.rb#L1327)
1281
+ * [calls the Deferrable errback on capabilities failure](./spec/acceptance/realtime/presence_spec.rb#L1347)
1264
1282
  * it should behave like a public presence method
1265
1283
  * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L63)
1266
1284
  * [raise an exception if the channel becomes detached](./spec/acceptance/realtime/presence_spec.rb#L81)
@@ -1332,9 +1350,9 @@ _(see [spec/acceptance/realtime/presence_spec.rb](./spec/acceptance/realtime/pre
1332
1350
  * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L470)
1333
1351
  * #update_client
1334
1352
  * multiple times on the same channel with different client_ids
1335
- * [updates the data attribute for the member when :data option provided](./spec/acceptance/realtime/presence_spec.rb#L1341)
1336
- * [updates the data attribute to null for the member when :data option is not provided (assumed null)](./spec/acceptance/realtime/presence_spec.rb#L1365)
1337
- * [enters if not already entered](./spec/acceptance/realtime/presence_spec.rb#L1377)
1353
+ * [updates the data attribute for the member when :data option provided](./spec/acceptance/realtime/presence_spec.rb#L1361)
1354
+ * [updates the data attribute to null for the member when :data option is not provided (assumed null)](./spec/acceptance/realtime/presence_spec.rb#L1387)
1355
+ * [enters if not already entered](./spec/acceptance/realtime/presence_spec.rb#L1401)
1338
1356
  * it should behave like a public presence method
1339
1357
  * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L63)
1340
1358
  * [raise an exception if the channel becomes detached](./spec/acceptance/realtime/presence_spec.rb#L81)
@@ -1407,14 +1425,14 @@ _(see [spec/acceptance/realtime/presence_spec.rb](./spec/acceptance/realtime/pre
1407
1425
  * #leave_client
1408
1426
  * leaves a channel
1409
1427
  * multiple times on the same channel with different client_ids
1410
- * [emits the :leave event for each client_id](./spec/acceptance/realtime/presence_spec.rb#L1407)
1411
- * [succeeds if that client_id has not previously entered the channel](./spec/acceptance/realtime/presence_spec.rb#L1431)
1428
+ * [emits the :leave event for each client_id](./spec/acceptance/realtime/presence_spec.rb#L1433)
1429
+ * [succeeds if that client_id has not previously entered the channel](./spec/acceptance/realtime/presence_spec.rb#L1459)
1412
1430
  * with a new value in :data option
1413
- * [emits the leave event with the new data value](./spec/acceptance/realtime/presence_spec.rb#L1455)
1431
+ * [emits the leave event with the new data value](./spec/acceptance/realtime/presence_spec.rb#L1485)
1414
1432
  * with a nil value in :data option
1415
- * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L1468)
1433
+ * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L1500)
1416
1434
  * with no :data option
1417
- * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L1481)
1435
+ * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L1515)
1418
1436
  * it should behave like a public presence method
1419
1437
  * [raise an exception if the channel is detached](./spec/acceptance/realtime/presence_spec.rb#L63)
1420
1438
  * [raise an exception if the channel becomes detached](./spec/acceptance/realtime/presence_spec.rb#L81)
@@ -1485,162 +1503,165 @@ _(see [spec/acceptance/realtime/presence_spec.rb](./spec/acceptance/realtime/pre
1485
1503
  * and an empty client_id
1486
1504
  * [throws an exception](./spec/acceptance/realtime/presence_spec.rb#L470)
1487
1505
  * #get
1488
- * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L1500)
1489
- * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L1505)
1490
- * [catches exceptions in the provided method block](./spec/acceptance/realtime/presence_spec.rb#L1512)
1491
- * [implicitly attaches the channel (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1520)
1492
- * [fails if the connection is DETACHED (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1555)
1493
- * [fails if the connection is FAILED (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1570)
1494
- * [returns the current members on the channel (#RTP11a)](./spec/acceptance/realtime/presence_spec.rb#L1654)
1495
- * [filters by connection_id option if provided (#RTP11c3)](./spec/acceptance/realtime/presence_spec.rb#L1671)
1496
- * [filters by client_id option if provided (#RTP11c2)](./spec/acceptance/realtime/presence_spec.rb#L1693)
1497
- * [does not wait for SYNC to complete if :wait_for_sync option is false (#RTP11c1)](./spec/acceptance/realtime/presence_spec.rb#L1717)
1498
- * [returns the list of members and waits for SYNC to complete by default (#RTP11a)](./spec/acceptance/realtime/presence_spec.rb#L1729)
1506
+ * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/presence_spec.rb#L1536)
1507
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L1541)
1508
+ * [catches exceptions in the provided method block](./spec/acceptance/realtime/presence_spec.rb#L1548)
1509
+ * [implicitly attaches the channel (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1556)
1510
+ * [fails if the connection is DETACHED (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1591)
1511
+ * [fails if the connection is FAILED (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1606)
1512
+ * [returns the current members on the channel (#RTP11a)](./spec/acceptance/realtime/presence_spec.rb#L1690)
1513
+ * [filters by connection_id option if provided (#RTP11c3)](./spec/acceptance/realtime/presence_spec.rb#L1707)
1514
+ * [filters by client_id option if provided (#RTP11c2)](./spec/acceptance/realtime/presence_spec.rb#L1729)
1515
+ * [does not wait for SYNC to complete if :wait_for_sync option is false (#RTP11c1)](./spec/acceptance/realtime/presence_spec.rb#L1753)
1516
+ * [returns the list of members and waits for SYNC to complete by default (#RTP11a)](./spec/acceptance/realtime/presence_spec.rb#L1765)
1499
1517
  * when the channel is SUSPENDED
1500
1518
  * with wait_for_sync: true
1501
- * [results in an error with @code@ @91005@ and a @message@ stating that the presence state is out of sync (#RTP11d)](./spec/acceptance/realtime/presence_spec.rb#L1530)
1519
+ * [results in an error with @code@ @91005@ and a @message@ stating that the presence state is out of sync (#RTP11d)](./spec/acceptance/realtime/presence_spec.rb#L1566)
1502
1520
  * with wait_for_sync: false
1503
- * [returns the current PresenceMap and does not wait for the channel to change to the ATTACHED state (#RTP11d)](./spec/acceptance/realtime/presence_spec.rb#L1543)
1521
+ * [returns the current PresenceMap and does not wait for the channel to change to the ATTACHED state (#RTP11d)](./spec/acceptance/realtime/presence_spec.rb#L1579)
1504
1522
  * during a sync
1505
1523
  * when :wait_for_sync is true
1506
- * [fails if the connection becomes FAILED (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1607)
1507
- * [fails if the channel becomes detached (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1630)
1524
+ * [fails if the connection becomes FAILED (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1643)
1525
+ * [fails if the channel becomes detached (#RTP11b)](./spec/acceptance/realtime/presence_spec.rb#L1666)
1508
1526
  * when a member enters and then leaves
1509
- * [has no members](./spec/acceptance/realtime/presence_spec.rb#L1742)
1527
+ * [has no members](./spec/acceptance/realtime/presence_spec.rb#L1778)
1510
1528
  * when a member enters and the presence map is updated
1511
- * [adds the member as being :present (#RTP2d)](./spec/acceptance/realtime/presence_spec.rb#L1757)
1529
+ * [adds the member as being :present (#RTP2d)](./spec/acceptance/realtime/presence_spec.rb#L1793)
1512
1530
  * with lots of members on different clients
1513
- * [returns a complete list of members on all clients](./spec/acceptance/realtime/presence_spec.rb#L1778)
1531
+ * [returns a complete list of members on all clients](./spec/acceptance/realtime/presence_spec.rb#L1814)
1514
1532
  * #subscribe
1515
- * [implicitly attaches](./spec/acceptance/realtime/presence_spec.rb#L1853)
1533
+ * [implicitly attaches](./spec/acceptance/realtime/presence_spec.rb#L1889)
1516
1534
  * with no arguments
1517
- * [calls the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L1814)
1535
+ * [calls the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L1850)
1518
1536
  * with event name
1519
- * [calls the callback for specified presence event](./spec/acceptance/realtime/presence_spec.rb#L1834)
1537
+ * [calls the callback for specified presence event](./spec/acceptance/realtime/presence_spec.rb#L1870)
1520
1538
  * with a callback that raises an exception
1521
- * [logs the error and continues](./spec/acceptance/realtime/presence_spec.rb#L1866)
1539
+ * [logs the error and continues](./spec/acceptance/realtime/presence_spec.rb#L1902)
1522
1540
  * #unsubscribe
1523
1541
  * with no arguments
1524
- * [removes the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L1887)
1542
+ * [removes the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L1923)
1525
1543
  * with event name
1526
- * [removes the callback for specified presence event](./spec/acceptance/realtime/presence_spec.rb#L1905)
1544
+ * [removes the callback for specified presence event](./spec/acceptance/realtime/presence_spec.rb#L1941)
1527
1545
  * REST #get
1528
- * [returns current members](./spec/acceptance/realtime/presence_spec.rb#L1924)
1529
- * [returns no members once left](./spec/acceptance/realtime/presence_spec.rb#L1940)
1546
+ * [returns current members](./spec/acceptance/realtime/presence_spec.rb#L1960)
1547
+ * [returns no members once left](./spec/acceptance/realtime/presence_spec.rb#L1976)
1530
1548
  * client_id with ASCII_8BIT
1531
1549
  * in connection set up
1532
- * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L1960)
1550
+ * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L1996)
1533
1551
  * in channel options
1534
- * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L1973)
1552
+ * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L2009)
1535
1553
  * encoding and decoding of presence message data
1536
- * [encrypts presence message data](./spec/acceptance/realtime/presence_spec.rb#L1999)
1554
+ * [encrypts presence message data](./spec/acceptance/realtime/presence_spec.rb#L2035)
1537
1555
  * #subscribe
1538
- * [emits decrypted enter events](./spec/acceptance/realtime/presence_spec.rb#L2018)
1539
- * [emits decrypted update events](./spec/acceptance/realtime/presence_spec.rb#L2030)
1540
- * [emits previously set data for leave events](./spec/acceptance/realtime/presence_spec.rb#L2044)
1556
+ * [emits decrypted enter events](./spec/acceptance/realtime/presence_spec.rb#L2054)
1557
+ * [emits decrypted update events](./spec/acceptance/realtime/presence_spec.rb#L2066)
1558
+ * [emits previously set data for leave events](./spec/acceptance/realtime/presence_spec.rb#L2080)
1541
1559
  * #get
1542
- * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L2060)
1560
+ * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L2096)
1543
1561
  * REST #get
1544
- * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L2074)
1562
+ * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L2110)
1545
1563
  * when cipher settings do not match publisher
1546
- * [delivers an unencoded presence message left with encoding value](./spec/acceptance/realtime/presence_spec.rb#L2090)
1547
- * [emits an error when cipher does not match and presence data cannot be decoded](./spec/acceptance/realtime/presence_spec.rb#L2103)
1564
+ * [delivers an unencoded presence message left with encoding value](./spec/acceptance/realtime/presence_spec.rb#L2126)
1565
+ * [emits an error when cipher does not match and presence data cannot be decoded](./spec/acceptance/realtime/presence_spec.rb#L2139)
1548
1566
  * leaving
1549
- * [expect :left event once underlying connection is closed](./spec/acceptance/realtime/presence_spec.rb#L2119)
1550
- * [expect :left event with client data from enter event](./spec/acceptance/realtime/presence_spec.rb#L2129)
1567
+ * [expect :left event once underlying connection is closed](./spec/acceptance/realtime/presence_spec.rb#L2155)
1568
+ * [expect :left event with client data from enter event](./spec/acceptance/realtime/presence_spec.rb#L2165)
1551
1569
  * connection failure mid-way through a large member sync
1552
- * [resumes the SYNC operation (#RTP3)](./spec/acceptance/realtime/presence_spec.rb#L2148)
1570
+ * [resumes the SYNC operation (#RTP3)](./spec/acceptance/realtime/presence_spec.rb#L2184)
1553
1571
  * server-initiated sync
1554
1572
  * with multiple SYNC pages
1555
- * [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#L2186)
1573
+ * [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#L2222)
1556
1574
  * with a single SYNC page
1557
- * [is initiated and completed with a single SYNC message (and no channelSerial) (#RTP18a, #RTP18c) ](./spec/acceptance/realtime/presence_spec.rb#L2237)
1575
+ * [is initiated and completed with a single SYNC message (and no channelSerial) (#RTP18a, #RTP18c) ](./spec/acceptance/realtime/presence_spec.rb#L2273)
1558
1576
  * when members exist in the PresenceMap before a SYNC completes
1559
- * [removes the members that are no longer present (#RTP19)](./spec/acceptance/realtime/presence_spec.rb#L2285)
1577
+ * [removes the members that are no longer present (#RTP19)](./spec/acceptance/realtime/presence_spec.rb#L2321)
1560
1578
  * when the client does not have presence subscribe privileges but is present on the channel
1561
- * 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#L2343)*
1579
+ * [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#L2379)
1562
1580
  * local PresenceMap for presence members entered by this client
1563
- * [maintains a copy of the member map for any member that shares this connection's connection ID (#RTP17)](./spec/acceptance/realtime/presence_spec.rb#L2393)
1581
+ * [maintains a copy of the member map for any member that shares this connection's connection ID (#RTP17)](./spec/acceptance/realtime/presence_spec.rb#L2427)
1582
+ * #RTP17b
1583
+ * [updates presence members on leave](./spec/acceptance/realtime/presence_spec.rb#L2455)
1584
+ * [does no update presence members on fabricated leave](./spec/acceptance/realtime/presence_spec.rb#L2480)
1564
1585
  * when a channel becomes attached again
1565
1586
  * and the resume flag is true
1566
1587
  * and the presence flag is false
1567
- * [does not send any presence events as the PresenceMap is in sync (#RTP5c1)](./spec/acceptance/realtime/presence_spec.rb#L2439)
1588
+ * [does not send any presence events as the PresenceMap is in sync (#RTP5c1)](./spec/acceptance/realtime/presence_spec.rb#L2527)
1568
1589
  * and the presence flag is true
1569
1590
  * and following the SYNC all local MemberMap members are present in the PresenceMap
1570
- * [does nothing as MemberMap is in sync (#RTP5c2)](./spec/acceptance/realtime/presence_spec.rb#L2469)
1591
+ * [does nothing as MemberMap is in sync (#RTP5c2)](./spec/acceptance/realtime/presence_spec.rb#L2557)
1571
1592
  * and following the SYNC a local MemberMap member is not present in the PresenceMap
1572
- * [re-enters the missing members automatically (#RTP5c2)](./spec/acceptance/realtime/presence_spec.rb#L2508)
1593
+ * [re-enters the missing members automatically (#RTP5c2)](./spec/acceptance/realtime/presence_spec.rb#L2596)
1573
1594
  * and the resume flag is false
1574
1595
  * and the presence flag is false
1575
- * [immediately resends all local presence members (#RTP5c2, #RTP19a)](./spec/acceptance/realtime/presence_spec.rb#L2591)
1596
+ * [immediately resends all local presence members (#RTP5c2, #RTP19a)](./spec/acceptance/realtime/presence_spec.rb#L2679)
1576
1597
  * when re-entering a client automatically, if the re-enter fails for any reason
1577
- * [should emit an ErrorInfo with error code 91004 (#RTP5c3)](./spec/acceptance/realtime/presence_spec.rb#L2642)
1598
+ * [should emit an ErrorInfo with error code 91004 (#RTP5c3)](./spec/acceptance/realtime/presence_spec.rb#L2730)
1578
1599
  * channel state side effects
1579
1600
  * channel transitions to the FAILED state
1580
- * [clears the PresenceMap and local member map copy and does not emit any presence events (#RTP5a)](./spec/acceptance/realtime/presence_spec.rb#L2699)
1601
+ * [clears the PresenceMap and local member map copy and does not emit any presence events (#RTP5a)](./spec/acceptance/realtime/presence_spec.rb#L2787)
1581
1602
  * channel transitions to the DETACHED state
1582
- * [clears the PresenceMap and local member map copy and does not emit any presence events (#RTP5a)](./spec/acceptance/realtime/presence_spec.rb#L2726)
1603
+ * [clears the PresenceMap and local member map copy and does not emit any presence events (#RTP5a)](./spec/acceptance/realtime/presence_spec.rb#L2814)
1583
1604
  * channel transitions to the SUSPENDED state
1584
- * [maintains the PresenceMap and only publishes presence event changes since the last attached state (#RTP5f)](./spec/acceptance/realtime/presence_spec.rb#L2762)
1605
+ * [maintains the PresenceMap and only publishes presence event changes since the last attached state (#RTP5f)](./spec/acceptance/realtime/presence_spec.rb#L2850)
1585
1606
 
1586
1607
  ### Ably::Realtime::Push::Admin
1587
1608
  _(see [spec/acceptance/realtime/push_admin_spec.rb](./spec/acceptance/realtime/push_admin_spec.rb))_
1588
1609
  * using JSON protocol
1589
1610
  * #publish
1590
1611
  * [returns a SafeDeferrable that catches exceptions in callbacks and logs them](./spec/acceptance/realtime/push_admin_spec.rb#L35)
1591
- * [accepts valid push data and recipient](./spec/acceptance/realtime/push_admin_spec.rb#L139)
1612
+ * [accepts valid push data and recipient](./spec/acceptance/realtime/push_admin_spec.rb#L125)
1592
1613
  * invalid arguments
1593
1614
  * [raises an exception with a nil recipient](./spec/acceptance/realtime/push_admin_spec.rb#L44)
1594
1615
  * [raises an exception with a empty recipient](./spec/acceptance/realtime/push_admin_spec.rb#L49)
1595
1616
  * [raises an exception with a nil recipient](./spec/acceptance/realtime/push_admin_spec.rb#L54)
1596
1617
  * [raises an exception with a empty recipient](./spec/acceptance/realtime/push_admin_spec.rb#L59)
1597
1618
  * invalid recipient
1598
- * PENDING: *[raises an error after receiving a 40x realtime response](./spec/acceptance/realtime/push_admin_spec.rb#L66)*
1619
+ * [raises an error after receiving a 40x realtime response](./spec/acceptance/realtime/push_admin_spec.rb#L68)
1599
1620
  * invalid push data
1600
- * PENDING: *[raises an error after receiving a 40x realtime response](./spec/acceptance/realtime/push_admin_spec.rb#L76)*
1621
+ * [raises an error after receiving a 40x realtime response](./spec/acceptance/realtime/push_admin_spec.rb#L79)
1601
1622
  * recipient variable case
1602
- * [is converted to snakeCase](./spec/acceptance/realtime/push_admin_spec.rb#L131)
1623
+ * [is converted to snakeCase](./spec/acceptance/realtime/push_admin_spec.rb#L117)
1603
1624
  * using test environment channel recipient (#RSH1a)
1604
- * [triggers a push notification](./spec/acceptance/realtime/push_admin_spec.rb#L169)
1625
+ * [triggers a push notification](./spec/acceptance/realtime/push_admin_spec.rb#L155)
1605
1626
  * #device_registrations
1606
1627
  * without permissions
1607
- * [raises a permissions not authorized exception](./spec/acceptance/realtime/push_admin_spec.rb#L197)
1628
+ * [raises a permissions not authorized exception](./spec/acceptance/realtime/push_admin_spec.rb#L183)
1608
1629
  * #list
1609
- * [returns a PaginatedResult object containing DeviceDetails objects](./spec/acceptance/realtime/push_admin_spec.rb#L241)
1610
- * [supports paging](./spec/acceptance/realtime/push_admin_spec.rb#L249)
1611
- * [raises an exception if params are invalid](./spec/acceptance/realtime/push_admin_spec.rb#L265)
1630
+ * [returns a PaginatedResult object containing DeviceDetails objects](./spec/acceptance/realtime/push_admin_spec.rb#L233)
1631
+ * [supports paging](./spec/acceptance/realtime/push_admin_spec.rb#L241)
1632
+ * [raises an exception if params are invalid](./spec/acceptance/realtime/push_admin_spec.rb#L257)
1612
1633
  * #get
1613
- * [returns a DeviceDetails object if a device ID string is provided](./spec/acceptance/realtime/push_admin_spec.rb#L298)
1634
+ * [returns a DeviceDetails object if a device ID string is provided](./spec/acceptance/realtime/push_admin_spec.rb#L296)
1614
1635
  * with a failed request
1615
- * [raises a ResourceMissing exception if device ID does not exist](./spec/acceptance/realtime/push_admin_spec.rb#L315)
1636
+ * [raises a ResourceMissing exception if device ID does not exist](./spec/acceptance/realtime/push_admin_spec.rb#L313)
1616
1637
  * #save
1617
- * [saves the new DeviceDetails Hash object](./spec/acceptance/realtime/push_admin_spec.rb#L358)
1638
+ * [saves the new DeviceDetails Hash object](./spec/acceptance/realtime/push_admin_spec.rb#L362)
1618
1639
  * with a failed request
1619
- * [fails if data is invalid](./spec/acceptance/realtime/push_admin_spec.rb#L376)
1640
+ * [fails if data is invalid](./spec/acceptance/realtime/push_admin_spec.rb#L380)
1620
1641
  * #remove_where
1621
- * [removes all matching device registrations by client_id](./spec/acceptance/realtime/push_admin_spec.rb#L408)
1642
+ * [removes all matching device registrations by client_id](./spec/acceptance/realtime/push_admin_spec.rb#L418)
1622
1643
  * #remove
1623
- * [removes the provided device id string](./spec/acceptance/realtime/push_admin_spec.rb#L441)
1644
+ * [removes the provided device id string](./spec/acceptance/realtime/push_admin_spec.rb#L457)
1624
1645
  * #channel_subscriptions
1625
1646
  * #list
1626
- * [returns a PaginatedResult object containing DeviceDetails objects](./spec/acceptance/realtime/push_admin_spec.rb#L511)
1627
- * [supports paging](./spec/acceptance/realtime/push_admin_spec.rb#L519)
1628
- * [raises an exception if none of the required filters are provided](./spec/acceptance/realtime/push_admin_spec.rb#L535)
1647
+ * [returns a PaginatedResult object containing DeviceDetails objects](./spec/acceptance/realtime/push_admin_spec.rb#L533)
1648
+ * [supports paging](./spec/acceptance/realtime/push_admin_spec.rb#L541)
1649
+ * [raises an exception if none of the required filters are provided](./spec/acceptance/realtime/push_admin_spec.rb#L557)
1629
1650
  * #list_channels
1630
- * [returns a PaginatedResult object containing String objects](./spec/acceptance/realtime/push_admin_spec.rb#L560)
1651
+ * [returns a PaginatedResult object containing String objects](./spec/acceptance/realtime/push_admin_spec.rb#L584)
1631
1652
  * #save
1632
- * [saves the new client_id PushChannelSubscription Hash object](./spec/acceptance/realtime/push_admin_spec.rb#L575)
1633
- * [raises an exception for invalid params](./spec/acceptance/realtime/push_admin_spec.rb#L586)
1653
+ * [saves the new client_id PushChannelSubscription Hash object](./spec/acceptance/realtime/push_admin_spec.rb#L599)
1654
+ * [raises an exception for invalid params](./spec/acceptance/realtime/push_admin_spec.rb#L610)
1634
1655
  * failed requests
1635
- * [fails for invalid requests](./spec/acceptance/realtime/push_admin_spec.rb#L599)
1656
+ * [fails for invalid requests](./spec/acceptance/realtime/push_admin_spec.rb#L623)
1636
1657
  * #remove_where
1637
- * [removes matching client_ids](./spec/acceptance/realtime/push_admin_spec.rb#L626)
1638
- * [succeeds on no match](./spec/acceptance/realtime/push_admin_spec.rb#L653)
1658
+ * [removes matching client_ids](./spec/acceptance/realtime/push_admin_spec.rb#L650)
1659
+ * [succeeds on no match](./spec/acceptance/realtime/push_admin_spec.rb#L677)
1639
1660
  * failed requests
1640
- * [device_id and client_id filters in the same request are not supported](./spec/acceptance/realtime/push_admin_spec.rb#L645)
1661
+ * [device_id and client_id filters in the same request are not supported](./spec/acceptance/realtime/push_admin_spec.rb#L669)
1641
1662
  * #remove
1642
- * [removes match for Hash object by channel and client_id](./spec/acceptance/realtime/push_admin_spec.rb#L673)
1643
- * [succeeds even if there is no match](./spec/acceptance/realtime/push_admin_spec.rb#L685)
1663
+ * [removes match for Hash object by channel and client_id](./spec/acceptance/realtime/push_admin_spec.rb#L697)
1664
+ * [succeeds even if there is no match](./spec/acceptance/realtime/push_admin_spec.rb#L709)
1644
1665
 
1645
1666
  ### Ably::Realtime::Push
1646
1667
  _(see [spec/acceptance/realtime/push_spec.rb](./spec/acceptance/realtime/push_spec.rb))_
@@ -1671,213 +1692,205 @@ _(see [spec/acceptance/realtime/time_spec.rb](./spec/acceptance/realtime/time_sp
1671
1692
  ### Ably::Auth
1672
1693
  _(see [spec/acceptance/rest/auth_spec.rb](./spec/acceptance/rest/auth_spec.rb))_
1673
1694
  * using JSON protocol
1674
- * [has immutable options](./spec/acceptance/rest/auth_spec.rb#L60)
1695
+ * [has immutable options](./spec/acceptance/rest/auth_spec.rb#L48)
1675
1696
  * #request_token
1676
- * [creates a TokenRequest automatically and sends it to Ably to obtain a token](./spec/acceptance/rest/auth_spec.rb#L75)
1677
- * [returns a valid TokenDetails object in the expected format with valid issued and expires attributes](./spec/acceptance/rest/auth_spec.rb#L84)
1697
+ * [creates a TokenRequest automatically and sends it to Ably to obtain a token](./spec/acceptance/rest/auth_spec.rb#L63)
1698
+ * [returns a valid TokenDetails object in the expected format with valid issued and expires attributes](./spec/acceptance/rest/auth_spec.rb#L72)
1678
1699
  * with token_param :client_id
1679
- * [overrides default and uses camelCase notation for attributes](./spec/acceptance/rest/auth_spec.rb#L117)
1700
+ * [overrides default and uses camelCase notation for attributes](./spec/acceptance/rest/auth_spec.rb#L105)
1680
1701
  * with token_param :capability
1681
- * [overrides default and uses camelCase notation for attributes](./spec/acceptance/rest/auth_spec.rb#L117)
1702
+ * [overrides default and uses camelCase notation for attributes](./spec/acceptance/rest/auth_spec.rb#L105)
1682
1703
  * with token_param :nonce
1683
- * [overrides default and uses camelCase notation for attributes](./spec/acceptance/rest/auth_spec.rb#L117)
1704
+ * [overrides default and uses camelCase notation for attributes](./spec/acceptance/rest/auth_spec.rb#L105)
1684
1705
  * with token_param :timestamp
1685
- * [overrides default and uses camelCase notation for attributes](./spec/acceptance/rest/auth_spec.rb#L117)
1706
+ * [overrides default and uses camelCase notation for attributes](./spec/acceptance/rest/auth_spec.rb#L105)
1686
1707
  * with token_param :ttl
1687
- * [overrides default and uses camelCase notation for attributes](./spec/acceptance/rest/auth_spec.rb#L117)
1708
+ * [overrides default and uses camelCase notation for attributes](./spec/acceptance/rest/auth_spec.rb#L105)
1688
1709
  * with :key option
1689
- * [key_name is used in request and signing uses key_secret](./spec/acceptance/rest/auth_spec.rb#L147)
1710
+ * [key_name is used in request and signing uses key_secret](./spec/acceptance/rest/auth_spec.rb#L135)
1690
1711
  * with :key_name & :key_secret options
1691
- * [key_name is used in request and signing uses key_secret](./spec/acceptance/rest/auth_spec.rb#L177)
1712
+ * [key_name is used in request and signing uses key_secret](./spec/acceptance/rest/auth_spec.rb#L165)
1692
1713
  * with :query_time option
1693
- * [queries the server for the time (#RSA10k)](./spec/acceptance/rest/auth_spec.rb#L185)
1714
+ * [queries the server for the time (#RSA10k)](./spec/acceptance/rest/auth_spec.rb#L173)
1694
1715
  * without :query_time option
1695
- * [does not query the server for the time](./spec/acceptance/rest/auth_spec.rb#L194)
1716
+ * [does not query the server for the time](./spec/acceptance/rest/auth_spec.rb#L182)
1696
1717
  * with :auth_url option merging
1697
1718
  * with existing configured auth options
1698
1719
  * using unspecified :auth_method
1699
- * [requests a token using a GET request with provided headers, and merges client_id into auth_params](./spec/acceptance/rest/auth_spec.rb#L234)
1720
+ * [requests a token using a GET request with provided headers, and merges client_id into auth_params](./spec/acceptance/rest/auth_spec.rb#L222)
1700
1721
  * with provided token_params
1701
- * [merges provided token_params with existing auth_params and client_id](./spec/acceptance/rest/auth_spec.rb#L242)
1722
+ * [merges provided token_params with existing auth_params and client_id](./spec/acceptance/rest/auth_spec.rb#L230)
1702
1723
  * with provided auth option auth_params and auth_headers
1703
- * [replaces any preconfigured auth_params](./spec/acceptance/rest/auth_spec.rb#L250)
1724
+ * [replaces any preconfigured auth_params](./spec/acceptance/rest/auth_spec.rb#L238)
1704
1725
  * using :get :auth_method and query params in the URL
1705
- * [requests a token using a GET request with provided headers, and merges client_id into auth_params and existing URL querystring into new URL querystring](./spec/acceptance/rest/auth_spec.rb#L261)
1726
+ * [requests a token using a GET request with provided headers, and merges client_id into auth_params and existing URL querystring into new URL querystring](./spec/acceptance/rest/auth_spec.rb#L249)
1706
1727
  * using :post :auth_method
1707
- * [requests a token using a POST request with provided headers, and merges client_id into auth_params as form-encoded post data](./spec/acceptance/rest/auth_spec.rb#L271)
1728
+ * [requests a token using a POST request with provided headers, and merges client_id into auth_params as form-encoded post data](./spec/acceptance/rest/auth_spec.rb#L259)
1708
1729
  * with :auth_url option
1709
1730
  * when response from :auth_url is a valid token request
1710
- * [requests a token from :auth_url using an HTTP GET request](./spec/acceptance/rest/auth_spec.rb#L321)
1711
- * [returns a valid token generated from the token request](./spec/acceptance/rest/auth_spec.rb#L326)
1731
+ * [requests a token from :auth_url using an HTTP GET request](./spec/acceptance/rest/auth_spec.rb#L309)
1732
+ * [returns a valid token generated from the token request](./spec/acceptance/rest/auth_spec.rb#L314)
1712
1733
  * with :query_params
1713
- * [requests a token from :auth_url with the :query_params](./spec/acceptance/rest/auth_spec.rb#L333)
1734
+ * [requests a token from :auth_url with the :query_params](./spec/acceptance/rest/auth_spec.rb#L321)
1714
1735
  * with :headers
1715
- * [requests a token from :auth_url with the HTTP headers set](./spec/acceptance/rest/auth_spec.rb#L341)
1736
+ * [requests a token from :auth_url with the HTTP headers set](./spec/acceptance/rest/auth_spec.rb#L329)
1716
1737
  * with POST
1717
- * [requests a token from :auth_url using an HTTP POST instead of the default GET](./spec/acceptance/rest/auth_spec.rb#L349)
1738
+ * [requests a token from :auth_url using an HTTP POST instead of the default GET](./spec/acceptance/rest/auth_spec.rb#L337)
1718
1739
  * when response from :auth_url is a token details object
1719
- * [returns TokenDetails created from the token JSON](./spec/acceptance/rest/auth_spec.rb#L374)
1740
+ * [returns TokenDetails created from the token JSON](./spec/acceptance/rest/auth_spec.rb#L362)
1720
1741
  * when response from :auth_url is text/plain content type and a token string
1721
- * [returns TokenDetails created from the token JSON](./spec/acceptance/rest/auth_spec.rb#L392)
1742
+ * [returns TokenDetails created from the token JSON](./spec/acceptance/rest/auth_spec.rb#L380)
1722
1743
  * when response is invalid
1723
1744
  * 500
1724
- * [raises ServerError](./spec/acceptance/rest/auth_spec.rb#L406)
1745
+ * [raises ServerError](./spec/acceptance/rest/auth_spec.rb#L394)
1725
1746
  * XML
1726
- * [raises InvalidResponseBody](./spec/acceptance/rest/auth_spec.rb#L417)
1747
+ * [raises InvalidResponseBody](./spec/acceptance/rest/auth_spec.rb#L405)
1727
1748
  * with a Proc for the :auth_callback option
1728
1749
  * that returns a TokenRequest
1729
- * [calls the Proc with token_params when authenticating to obtain the request token](./spec/acceptance/rest/auth_spec.rb#L440)
1730
- * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L444)
1750
+ * [calls the Proc with token_params when authenticating to obtain the request token](./spec/acceptance/rest/auth_spec.rb#L428)
1751
+ * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L432)
1731
1752
  * when authorized
1732
- * [sets Auth#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L451)
1733
- * [sets Client#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L455)
1753
+ * [sets Auth#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L439)
1754
+ * [sets Client#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L443)
1734
1755
  * that returns a TokenDetails JSON object
1735
- * [calls the lambda when authenticating to obtain the request token](./spec/acceptance/rest/auth_spec.rb#L489)
1736
- * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L494)
1756
+ * [calls the lambda when authenticating to obtain the request token](./spec/acceptance/rest/auth_spec.rb#L477)
1757
+ * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L482)
1737
1758
  * when authorized
1738
- * [sets Auth#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L506)
1739
- * [sets Client#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L510)
1759
+ * [sets Auth#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L494)
1760
+ * [sets Client#client_id to the new token's client_id](./spec/acceptance/rest/auth_spec.rb#L498)
1740
1761
  * that returns a TokenDetails object
1741
- * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L525)
1762
+ * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L513)
1742
1763
  * that returns a Token string
1743
- * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L541)
1764
+ * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L529)
1744
1765
  * with auth_option :client_id
1745
- * [returns a token with the client_id](./spec/acceptance/rest/auth_spec.rb#L571)
1766
+ * [returns a token with the client_id](./spec/acceptance/rest/auth_spec.rb#L559)
1746
1767
  * with token_param :client_id
1747
- * [returns a token with the client_id](./spec/acceptance/rest/auth_spec.rb#L580)
1768
+ * [returns a token with the client_id](./spec/acceptance/rest/auth_spec.rb#L568)
1748
1769
  * before #authorize has been called
1749
- * [has no current_token_details](./spec/acceptance/rest/auth_spec.rb#L587)
1770
+ * [has no current_token_details](./spec/acceptance/rest/auth_spec.rb#L575)
1750
1771
  * #authorize (#RSA10, #RSA10j)
1751
- * [updates the persisted token params that are then used for subsequent authorize requests](./spec/acceptance/rest/auth_spec.rb#L754)
1752
- * [updates the persisted auth options that are then used for subsequent authorize requests](./spec/acceptance/rest/auth_spec.rb#L760)
1772
+ * [updates the persisted token params that are then used for subsequent authorize requests](./spec/acceptance/rest/auth_spec.rb#L742)
1773
+ * [updates the persisted auth options that are then used for subsequent authorize requests](./spec/acceptance/rest/auth_spec.rb#L748)
1753
1774
  * when called for the first time since the client has been instantiated
1754
- * [passes all auth_options and token_params to #request_token](./spec/acceptance/rest/auth_spec.rb#L601)
1755
- * [returns a valid token](./spec/acceptance/rest/auth_spec.rb#L606)
1756
- * [issues a new token every time (#RSA10a)](./spec/acceptance/rest/auth_spec.rb#L610)
1775
+ * [passes all auth_options and token_params to #request_token](./spec/acceptance/rest/auth_spec.rb#L589)
1776
+ * [returns a valid token](./spec/acceptance/rest/auth_spec.rb#L594)
1777
+ * [issues a new token every time (#RSA10a)](./spec/acceptance/rest/auth_spec.rb#L598)
1757
1778
  * query_time: true with authorize
1758
- * [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)
1779
+ * [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#L612)
1759
1780
  * query_time: true ClientOption when instanced
1760
- * [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)
1781
+ * [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#L632)
1761
1782
  * TokenParams argument
1762
- * [has no effect on the defaults when null and TokenParam defaults remain the same](./spec/acceptance/rest/auth_spec.rb#L661)
1763
- * [updates defaults when present and all previous configured TokenParams are discarded (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L668)
1764
- * [updates Auth#token_params attribute with an immutable hash](./spec/acceptance/rest/auth_spec.rb#L676)
1765
- * [uses TokenParams#timestamp for this request but obtains a new timestamp for subsequence requests (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L681)
1783
+ * [has no effect on the defaults when null and TokenParam defaults remain the same](./spec/acceptance/rest/auth_spec.rb#L649)
1784
+ * [updates defaults when present and all previous configured TokenParams are discarded (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L656)
1785
+ * [updates Auth#token_params attribute with an immutable hash](./spec/acceptance/rest/auth_spec.rb#L664)
1786
+ * [uses TokenParams#timestamp for this request but obtains a new timestamp for subsequence requests (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L669)
1766
1787
  * AuthOptions argument
1767
- * [has no effect on the defaults when null and AuthOptions defaults remain the same](./spec/acceptance/rest/auth_spec.rb#L706)
1768
- * [updates defaults when present and all previous configured AuthOptions are discarded (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L712)
1769
- * [updates Auth#options attribute with an immutable hash](./spec/acceptance/rest/auth_spec.rb#L719)
1770
- * [uses AuthOptions#query_time for this request and will not query_time for subsequent requests (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L724)
1771
- * [uses AuthOptions#query_time for this request and will query_time again if provided subsequently](./spec/acceptance/rest/auth_spec.rb#L730)
1788
+ * [has no effect on the defaults when null and AuthOptions defaults remain the same](./spec/acceptance/rest/auth_spec.rb#L694)
1789
+ * [updates defaults when present and all previous configured AuthOptions are discarded (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L700)
1790
+ * [updates Auth#options attribute with an immutable hash](./spec/acceptance/rest/auth_spec.rb#L707)
1791
+ * [uses AuthOptions#query_time for this request and will not query_time for subsequent requests (#RSA10g)](./spec/acceptance/rest/auth_spec.rb#L712)
1792
+ * [uses AuthOptions#query_time for this request and will query_time again if provided subsequently](./spec/acceptance/rest/auth_spec.rb#L718)
1772
1793
  * with previous authorisation
1773
- * [requests a new token if token is expired](./spec/acceptance/rest/auth_spec.rb#L743)
1774
- * [issues a new token every time #authorize is called](./spec/acceptance/rest/auth_spec.rb#L749)
1794
+ * [requests a new token if token is expired](./spec/acceptance/rest/auth_spec.rb#L731)
1795
+ * [issues a new token every time #authorize is called](./spec/acceptance/rest/auth_spec.rb#L737)
1775
1796
  * with a lambda for the :auth_callback option
1776
- * [calls the lambda](./spec/acceptance/rest/auth_spec.rb#L777)
1777
- * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L781)
1797
+ * [calls the lambda](./spec/acceptance/rest/auth_spec.rb#L765)
1798
+ * [uses the token request returned from the callback when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L769)
1778
1799
  * for every subsequent #request_token
1779
1800
  * without a :auth_callback lambda
1780
- * [calls the originally provided block](./spec/acceptance/rest/auth_spec.rb#L787)
1801
+ * [calls the originally provided block](./spec/acceptance/rest/auth_spec.rb#L775)
1781
1802
  * with a provided block
1782
- * [does not call the originally provided lambda and calls the new #request_token :auth_callback lambda](./spec/acceptance/rest/auth_spec.rb#L794)
1803
+ * [does not call the originally provided lambda and calls the new #request_token :auth_callback lambda](./spec/acceptance/rest/auth_spec.rb#L782)
1783
1804
  * with an explicit token string that expires
1784
1805
  * and a lambda for the :auth_callback option to provide a means to renew the token
1785
- * [calls the lambda once the token has expired and the new token is used](./spec/acceptance/rest/auth_spec.rb#L821)
1806
+ * [calls the lambda once the token has expired and the new token is used](./spec/acceptance/rest/auth_spec.rb#L809)
1786
1807
  * with an explicit ClientOptions client_id
1787
1808
  * and an incompatible client_id in a TokenDetails object passed to the auth callback
1788
- * [rejects a TokenDetails object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L839)
1809
+ * [rejects a TokenDetails object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L827)
1789
1810
  * and an incompatible client_id in a TokenRequest object passed to the auth callback and raises an exception
1790
- * [rejects a TokenRequests object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L847)
1811
+ * [rejects a TokenRequests object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L835)
1791
1812
  * and a token string without any retrievable client_id
1792
- * [rejects a TokenRequests object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L855)
1813
+ * [rejects a TokenRequests object with an incompatible client_id and raises an exception](./spec/acceptance/rest/auth_spec.rb#L843)
1793
1814
  * #create_token_request
1794
- * [returns a TokenRequest object](./spec/acceptance/rest/auth_spec.rb#L870)
1795
- * [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#L874)
1796
- * [uses the key name from the client](./spec/acceptance/rest/auth_spec.rb#L881)
1797
- * [specifies no TTL (#RSA5)](./spec/acceptance/rest/auth_spec.rb#L885)
1798
- * [specifies no capability (#RSA6)](./spec/acceptance/rest/auth_spec.rb#L899)
1815
+ * [returns a TokenRequest object](./spec/acceptance/rest/auth_spec.rb#L858)
1816
+ * [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#L862)
1817
+ * [uses the key name from the client](./spec/acceptance/rest/auth_spec.rb#L869)
1818
+ * [specifies no TTL (#RSA5)](./spec/acceptance/rest/auth_spec.rb#L873)
1819
+ * [specifies no capability (#RSA6)](./spec/acceptance/rest/auth_spec.rb#L887)
1799
1820
  * with a :ttl option below the Token expiry buffer that ensures tokens are renewed 15s before they expire as they are considered expired
1800
- * [uses the Token expiry buffer default + 10s to allow for a token request in flight](./spec/acceptance/rest/auth_spec.rb#L893)
1821
+ * [uses the Token expiry buffer default + 10s to allow for a token request in flight](./spec/acceptance/rest/auth_spec.rb#L881)
1801
1822
  * the nonce
1802
- * [is unique for every request](./spec/acceptance/rest/auth_spec.rb#L904)
1803
- * [is at least 16 characters](./spec/acceptance/rest/auth_spec.rb#L909)
1823
+ * [is unique for every request](./spec/acceptance/rest/auth_spec.rb#L892)
1824
+ * [is at least 16 characters](./spec/acceptance/rest/auth_spec.rb#L897)
1804
1825
  * with token param :ttl
1805
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L920)
1826
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L908)
1806
1827
  * with token param :nonce
1807
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L920)
1828
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L908)
1808
1829
  * with token param :client_id
1809
- * [overrides default](./spec/acceptance/rest/auth_spec.rb#L920)
1830
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L908)
1810
1831
  * when specifying capability
1811
- * [overrides the default](./spec/acceptance/rest/auth_spec.rb#L931)
1812
- * [uses these capabilities when Ably issues an actual token](./spec/acceptance/rest/auth_spec.rb#L935)
1832
+ * [overrides the default](./spec/acceptance/rest/auth_spec.rb#L919)
1833
+ * [uses these capabilities when Ably issues an actual token](./spec/acceptance/rest/auth_spec.rb#L923)
1813
1834
  * with additional invalid attributes
1814
- * [are ignored](./spec/acceptance/rest/auth_spec.rb#L945)
1835
+ * [are ignored](./spec/acceptance/rest/auth_spec.rb#L933)
1815
1836
  * when required fields are missing
1816
- * [should raise an exception if key secret is missing](./spec/acceptance/rest/auth_spec.rb#L956)
1817
- * [should raise an exception if key name is missing](./spec/acceptance/rest/auth_spec.rb#L960)
1837
+ * [should raise an exception if key secret is missing](./spec/acceptance/rest/auth_spec.rb#L944)
1838
+ * [should raise an exception if key name is missing](./spec/acceptance/rest/auth_spec.rb#L948)
1818
1839
  * timestamp attribute
1819
- * [is a Time object in Ruby and is set to the local time](./spec/acceptance/rest/auth_spec.rb#L987)
1840
+ * [is a Time object in Ruby and is set to the local time](./spec/acceptance/rest/auth_spec.rb#L975)
1820
1841
  * with :query_time auth_option
1821
- * [queries the server for the timestamp](./spec/acceptance/rest/auth_spec.rb#L972)
1842
+ * [queries the server for the timestamp](./spec/acceptance/rest/auth_spec.rb#L960)
1822
1843
  * with :timestamp option
1823
- * [uses the provided timestamp in the token request](./spec/acceptance/rest/auth_spec.rb#L982)
1844
+ * [uses the provided timestamp in the token request](./spec/acceptance/rest/auth_spec.rb#L970)
1824
1845
  * signing
1825
- * [generates a valid HMAC](./spec/acceptance/rest/auth_spec.rb#L1011)
1846
+ * [generates a valid HMAC](./spec/acceptance/rest/auth_spec.rb#L999)
1826
1847
  * lexicographic ordering of channels and operations
1827
- * [HMAC is lexicographic ordered and thus the HMAC is identical](./spec/acceptance/rest/auth_spec.rb#L1038)
1828
- * [is valid when used for authentication](./spec/acceptance/rest/auth_spec.rb#L1044)
1848
+ * [HMAC is lexicographic ordered and thus the HMAC is identical](./spec/acceptance/rest/auth_spec.rb#L1026)
1849
+ * [is valid when used for authentication](./spec/acceptance/rest/auth_spec.rb#L1032)
1829
1850
  * using token authentication
1830
1851
  * with :token option
1831
- * [authenticates successfully using the provided :token](./spec/acceptance/rest/auth_spec.rb#L1071)
1832
- * [disallows publishing on unspecified capability channels](./spec/acceptance/rest/auth_spec.rb#L1075)
1833
- * [fails if timestamp is invalid](./spec/acceptance/rest/auth_spec.rb#L1083)
1834
- * [cannot be renewed automatically](./spec/acceptance/rest/auth_spec.rb#L1091)
1852
+ * [authenticates successfully using the provided :token](./spec/acceptance/rest/auth_spec.rb#L1059)
1853
+ * [disallows publishing on unspecified capability channels](./spec/acceptance/rest/auth_spec.rb#L1063)
1854
+ * [fails if timestamp is invalid](./spec/acceptance/rest/auth_spec.rb#L1071)
1855
+ * [cannot be renewed automatically](./spec/acceptance/rest/auth_spec.rb#L1079)
1835
1856
  * and the token expires
1836
- * [should indicate an error and not retry the request (#RSA4a)](./spec/acceptance/rest/auth_spec.rb#L1125)
1837
- * when implicit as a result of using :client_id
1838
- * and requests to the Ably server are mocked
1839
- * [will send a token request to the server](./spec/acceptance/rest/auth_spec.rb#L1155)
1840
- * a token is created
1841
- * [before a request is made](./spec/acceptance/rest/auth_spec.rb#L1164)
1842
- * [when a message is published](./spec/acceptance/rest/auth_spec.rb#L1168)
1843
- * [with capability and TTL defaults (#TK2a, #TK2b)](./spec/acceptance/rest/auth_spec.rb#L1172)
1844
- * [#client_id contains the client_id](./spec/acceptance/rest/auth_spec.rb#L1183)
1857
+ * [should indicate an error and not retry the request (#RSA4a)](./spec/acceptance/rest/auth_spec.rb#L1113)
1845
1858
  * when token expires
1846
- * [automatically renews the token (#RSA4b)](./spec/acceptance/rest/auth_spec.rb#L1212)
1847
- * [fails if the token renewal fails (#RSA4b)](./spec/acceptance/rest/auth_spec.rb#L1222)
1859
+ * [automatically renews the token (#RSA4b)](./spec/acceptance/rest/auth_spec.rb#L1143)
1860
+ * [fails if the token renewal fails (#RSA4b)](./spec/acceptance/rest/auth_spec.rb#L1153)
1848
1861
  * when :client_id is provided in a token
1849
- * [#client_id contains the client_id](./spec/acceptance/rest/auth_spec.rb#L1246)
1862
+ * [#client_id contains the client_id](./spec/acceptance/rest/auth_spec.rb#L1177)
1850
1863
  * #client_id_validated?
1851
1864
  * when using basic auth
1852
- * [is false as basic auth users do not have an identity](./spec/acceptance/rest/auth_spec.rb#L1258)
1865
+ * [is false as basic auth users do not have an identity](./spec/acceptance/rest/auth_spec.rb#L1189)
1853
1866
  * when using a token auth string for a token with a client_id
1854
- * [is false as identification is not possible from an opaque token string](./spec/acceptance/rest/auth_spec.rb#L1266)
1867
+ * [is false as identification is not possible from an opaque token string](./spec/acceptance/rest/auth_spec.rb#L1197)
1855
1868
  * when using a token
1856
1869
  * with a client_id
1857
- * [is true](./spec/acceptance/rest/auth_spec.rb#L1275)
1870
+ * [is true](./spec/acceptance/rest/auth_spec.rb#L1206)
1858
1871
  * with no client_id (anonymous)
1859
- * [is true](./spec/acceptance/rest/auth_spec.rb#L1283)
1872
+ * [is true](./spec/acceptance/rest/auth_spec.rb#L1214)
1860
1873
  * with a wildcard client_id (anonymous)
1861
- * [is false](./spec/acceptance/rest/auth_spec.rb#L1291)
1874
+ * [is false](./spec/acceptance/rest/auth_spec.rb#L1222)
1862
1875
  * when using a token request with a client_id
1863
- * [is not true as identification is not confirmed until authenticated](./spec/acceptance/rest/auth_spec.rb#L1300)
1876
+ * [is not true as identification is not confirmed until authenticated](./spec/acceptance/rest/auth_spec.rb#L1231)
1864
1877
  * after authentication
1865
- * [is true as identification is completed during implicit authentication](./spec/acceptance/rest/auth_spec.rb#L1307)
1878
+ * [is true as identification is completed during implicit authentication](./spec/acceptance/rest/auth_spec.rb#L1238)
1866
1879
  * when using a :key and basic auth
1867
- * [#using_token_auth? is false](./spec/acceptance/rest/auth_spec.rb#L1315)
1868
- * [#key attribute contains the key string](./spec/acceptance/rest/auth_spec.rb#L1319)
1869
- * [#using_basic_auth? is true](./spec/acceptance/rest/auth_spec.rb#L1323)
1880
+ * [#using_token_auth? is false](./spec/acceptance/rest/auth_spec.rb#L1246)
1881
+ * [#key attribute contains the key string](./spec/acceptance/rest/auth_spec.rb#L1250)
1882
+ * [#using_basic_auth? is true](./spec/acceptance/rest/auth_spec.rb#L1254)
1870
1883
  * deprecated #authorise
1871
- * [logs a deprecation warning (#RSA10l)](./spec/acceptance/rest/auth_spec.rb#L1332)
1872
- * [returns a valid token (#RSA10l)](./spec/acceptance/rest/auth_spec.rb#L1337)
1884
+ * [logs a deprecation warning (#RSA10l)](./spec/acceptance/rest/auth_spec.rb#L1263)
1885
+ * [returns a valid token (#RSA10l)](./spec/acceptance/rest/auth_spec.rb#L1268)
1873
1886
  * when using JWT
1874
- * [authenticates correctly using the JWT token generated by the echo server](./spec/acceptance/rest/auth_spec.rb#L1349)
1887
+ * [authenticates correctly using the JWT token generated by the echo server](./spec/acceptance/rest/auth_spec.rb#L1280)
1875
1888
  * when the JWT embeds an Ably token
1876
- * [authenticates correctly using the embedded token](./spec/acceptance/rest/auth_spec.rb#L1356)
1889
+ * [authenticates correctly using the embedded token](./spec/acceptance/rest/auth_spec.rb#L1287)
1877
1890
  * and the requested token is encrypted
1878
- * [authenticates correctly using the embedded token](./spec/acceptance/rest/auth_spec.rb#L1363)
1891
+ * [authenticates correctly using the embedded token](./spec/acceptance/rest/auth_spec.rb#L1294)
1879
1892
  * when the token requested is returned with application/jwt content type
1880
- * [authenticates correctly and pulls stats](./spec/acceptance/rest/auth_spec.rb#L1374)
1893
+ * [authenticates correctly and pulls stats](./spec/acceptance/rest/auth_spec.rb#L1305)
1881
1894
 
1882
1895
  ### Ably::Rest
1883
1896
  _(see [spec/acceptance/rest/base_spec.rb](./spec/acceptance/rest/base_spec.rb))_
@@ -1897,14 +1910,14 @@ _(see [spec/acceptance/rest/base_spec.rb](./spec/acceptance/rest/base_spec.rb))_
1897
1910
  * due to invalid Auth
1898
1911
  * [should raise an InvalidRequest exception with a valid error message and code](./spec/acceptance/rest/base_spec.rb#L75)
1899
1912
  * server error with JSON error response body
1900
- * [should raise a ServerError exception](./spec/acceptance/rest/base_spec.rb#L94)
1913
+ * [should raise a ServerError exception](./spec/acceptance/rest/base_spec.rb#L96)
1901
1914
  * 500 server error without a valid JSON response body
1902
- * [should raise a ServerError exception](./spec/acceptance/rest/base_spec.rb#L105)
1915
+ * [should raise a ServerError exception](./spec/acceptance/rest/base_spec.rb#L109)
1903
1916
  * token authentication failures
1904
1917
  * when auth#token_renewable?
1905
- * [should automatically reissue a token](./spec/acceptance/rest/base_spec.rb#L143)
1918
+ * [should automatically reissue a token](./spec/acceptance/rest/base_spec.rb#L147)
1906
1919
  * when NOT auth#token_renewable?
1907
- * [should raise an TokenExpired exception](./spec/acceptance/rest/base_spec.rb#L158)
1920
+ * [should raise an TokenExpired exception](./spec/acceptance/rest/base_spec.rb#L162)
1908
1921
 
1909
1922
  ### Ably::Rest::Channel
1910
1923
  _(see [spec/acceptance/rest/channel_spec.rb](./spec/acceptance/rest/channel_spec.rb))_
@@ -1921,78 +1934,88 @@ _(see [spec/acceptance/rest/channel_spec.rb](./spec/acceptance/rest/channel_spec
1921
1934
  * [publishes an array of messages in one HTTP request](./spec/acceptance/rest/channel_spec.rb#L62)
1922
1935
  * with an array of Message objects
1923
1936
  * [publishes an array of messages in one HTTP request](./spec/acceptance/rest/channel_spec.rb#L77)
1937
+ * with a Message object
1938
+ * [publishes the message](./spec/acceptance/rest/channel_spec.rb#L92)
1939
+ * with a Message object and query params
1940
+ * [should fail to publish the message (RSL1l1)](./spec/acceptance/rest/channel_spec.rb#L104)
1941
+ * with Messages and query params
1942
+ * [should fail to publish the message (RSL1l1)](./spec/acceptance/rest/channel_spec.rb#L117)
1924
1943
  * without adequate permissions on the channel
1925
- * [raises a permission error when publishing](./spec/acceptance/rest/channel_spec.rb#L89)
1944
+ * [raises a permission error when publishing](./spec/acceptance/rest/channel_spec.rb#L127)
1926
1945
  * null attributes
1927
1946
  * when name is null
1928
- * [publishes the message without a name attribute in the payload](./spec/acceptance/rest/channel_spec.rb#L98)
1947
+ * [publishes the message without a name attribute in the payload](./spec/acceptance/rest/channel_spec.rb#L136)
1929
1948
  * when data is null
1930
- * [publishes the message without a data attribute in the payload](./spec/acceptance/rest/channel_spec.rb#L109)
1949
+ * [publishes the message without a data attribute in the payload](./spec/acceptance/rest/channel_spec.rb#L147)
1931
1950
  * with neither name or data attributes
1932
- * [publishes the message without any attributes in the payload](./spec/acceptance/rest/channel_spec.rb#L120)
1951
+ * [publishes the message without any attributes in the payload](./spec/acceptance/rest/channel_spec.rb#L158)
1933
1952
  * identified clients
1934
1953
  * when authenticated with a wildcard client_id
1935
1954
  * with a valid client_id in the message
1936
- * [succeeds](./spec/acceptance/rest/channel_spec.rb#L137)
1955
+ * [succeeds](./spec/acceptance/rest/channel_spec.rb#L175)
1937
1956
  * with a wildcard client_id in the message
1938
- * [throws an exception](./spec/acceptance/rest/channel_spec.rb#L146)
1957
+ * [throws an exception](./spec/acceptance/rest/channel_spec.rb#L184)
1939
1958
  * with an empty client_id in the message
1940
- * [succeeds and publishes without a client_id](./spec/acceptance/rest/channel_spec.rb#L152)
1959
+ * [succeeds and publishes without a client_id](./spec/acceptance/rest/channel_spec.rb#L190)
1941
1960
  * when authenticated with a Token string with an implicit client_id
1942
1961
  * without having a confirmed identity
1943
1962
  * with a valid client_id in the message
1944
- * [succeeds](./spec/acceptance/rest/channel_spec.rb#L169)
1963
+ * [succeeds](./spec/acceptance/rest/channel_spec.rb#L207)
1945
1964
  * with an invalid client_id in the message
1946
- * [succeeds in the client library but then fails when published to Ably](./spec/acceptance/rest/channel_spec.rb#L178)
1965
+ * [succeeds in the client library but then fails when published to Ably](./spec/acceptance/rest/channel_spec.rb#L216)
1947
1966
  * with an empty client_id in the message
1948
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/rest/channel_spec.rb#L184)
1967
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/rest/channel_spec.rb#L222)
1949
1968
  * when authenticated with TokenDetails with a valid client_id
1950
1969
  * with a valid client_id in the message
1951
- * [succeeds](./spec/acceptance/rest/channel_spec.rb#L201)
1970
+ * [succeeds](./spec/acceptance/rest/channel_spec.rb#L239)
1952
1971
  * with a wildcard client_id in the message
1953
- * [throws an exception](./spec/acceptance/rest/channel_spec.rb#L210)
1972
+ * [throws an exception](./spec/acceptance/rest/channel_spec.rb#L248)
1954
1973
  * with an invalid client_id in the message
1955
- * [throws an exception](./spec/acceptance/rest/channel_spec.rb#L216)
1974
+ * [throws an exception](./spec/acceptance/rest/channel_spec.rb#L254)
1956
1975
  * with an empty client_id in the message
1957
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/rest/channel_spec.rb#L222)
1976
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/rest/channel_spec.rb#L260)
1958
1977
  * when anonymous and no client_id
1959
1978
  * with a client_id in the message
1960
- * [throws an exception](./spec/acceptance/rest/channel_spec.rb#L238)
1979
+ * [throws an exception](./spec/acceptance/rest/channel_spec.rb#L276)
1961
1980
  * with a wildcard client_id in the message
1962
- * [throws an exception](./spec/acceptance/rest/channel_spec.rb#L244)
1981
+ * [throws an exception](./spec/acceptance/rest/channel_spec.rb#L282)
1963
1982
  * with an empty client_id in the message
1964
- * [succeeds and publishes with an implicit client_id](./spec/acceptance/rest/channel_spec.rb#L250)
1983
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/rest/channel_spec.rb#L288)
1965
1984
  * with a non ASCII channel name
1966
1985
  * stubbed
1967
- * [correctly encodes the channel name](./spec/acceptance/rest/channel_spec.rb#L272)
1986
+ * [correctly encodes the channel name](./spec/acceptance/rest/channel_spec.rb#L310)
1987
+ * with a frozen message event name
1988
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/rest/channel_spec.rb#L320)
1989
+ * with a frozen payload
1990
+ * [succeeds and publishes with an implicit client_id](./spec/acceptance/rest/channel_spec.rb#L342)
1968
1991
  * #history
1969
- * [returns a PaginatedResult model](./spec/acceptance/rest/channel_spec.rb#L297)
1970
- * [returns the current message history for the channel](./spec/acceptance/rest/channel_spec.rb#L301)
1971
- * [returns paged history using the PaginatedResult model](./spec/acceptance/rest/channel_spec.rb#L329)
1992
+ * [returns a PaginatedResult model](./spec/acceptance/rest/channel_spec.rb#L372)
1993
+ * [returns the current message history for the channel](./spec/acceptance/rest/channel_spec.rb#L376)
1994
+ * [returns paged history using the PaginatedResult model](./spec/acceptance/rest/channel_spec.rb#L404)
1972
1995
  * message timestamps
1973
- * [are after the messages were published](./spec/acceptance/rest/channel_spec.rb#L314)
1996
+ * [are after the messages were published](./spec/acceptance/rest/channel_spec.rb#L389)
1974
1997
  * message IDs
1975
- * [is unique](./spec/acceptance/rest/channel_spec.rb#L322)
1998
+ * [is unique](./spec/acceptance/rest/channel_spec.rb#L397)
1976
1999
  * direction
1977
- * [returns paged history backwards by default](./spec/acceptance/rest/channel_spec.rb#L356)
1978
- * [returns history forward if specified in the options](./spec/acceptance/rest/channel_spec.rb#L362)
2000
+ * [returns paged history backwards by default](./spec/acceptance/rest/channel_spec.rb#L431)
2001
+ * [returns history forward if specified in the options](./spec/acceptance/rest/channel_spec.rb#L437)
1979
2002
  * limit
1980
- * [defaults to 100](./spec/acceptance/rest/channel_spec.rb#L374)
2003
+ * [defaults to 100](./spec/acceptance/rest/channel_spec.rb#L449)
1981
2004
  * #history option
1982
2005
  * :start
1983
2006
  * with milliseconds since epoch value
1984
- * [uses this value in the history request](./spec/acceptance/rest/channel_spec.rb#L414)
2007
+ * [uses this value in the history request](./spec/acceptance/rest/channel_spec.rb#L489)
1985
2008
  * with a Time object value
1986
- * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/channel_spec.rb#L424)
2009
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/channel_spec.rb#L499)
1987
2010
  * :end
1988
2011
  * with milliseconds since epoch value
1989
- * [uses this value in the history request](./spec/acceptance/rest/channel_spec.rb#L414)
2012
+ * [uses this value in the history request](./spec/acceptance/rest/channel_spec.rb#L489)
1990
2013
  * with a Time object value
1991
- * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/channel_spec.rb#L424)
2014
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/channel_spec.rb#L499)
1992
2015
  * when argument start is after end
1993
- * [should raise an exception](./spec/acceptance/rest/channel_spec.rb#L434)
2016
+ * [should raise an exception](./spec/acceptance/rest/channel_spec.rb#L509)
1994
2017
  * #presence
1995
- * [returns a REST Presence object](./spec/acceptance/rest/channel_spec.rb#L444)
2018
+ * [returns a REST Presence object](./spec/acceptance/rest/channel_spec.rb#L519)
1996
2019
 
1997
2020
  ### Ably::Rest::Channels
1998
2021
  _(see [spec/acceptance/rest/channels_spec.rb](./spec/acceptance/rest/channels_spec.rb))_
@@ -2013,6 +2036,10 @@ _(see [spec/acceptance/rest/channels_spec.rb](./spec/acceptance/rest/channels_sp
2013
2036
  * behaves like a channel
2014
2037
  * [returns a channel object](./spec/acceptance/rest/channels_spec.rb#L6)
2015
2038
  * [returns channel object and passes the provided options](./spec/acceptance/rest/channels_spec.rb#L11)
2039
+ * using a frozen channel name
2040
+ * behaves like a channel
2041
+ * [returns a channel object](./spec/acceptance/rest/channels_spec.rb#L6)
2042
+ * [returns channel object and passes the provided options](./spec/acceptance/rest/channels_spec.rb#L11)
2016
2043
 
2017
2044
  ### Ably::Rest::Client
2018
2045
  _(see [spec/acceptance/rest/client_spec.rb](./spec/acceptance/rest/client_spec.rb))_
@@ -2026,162 +2053,173 @@ _(see [spec/acceptance/rest/client_spec.rb](./spec/acceptance/rest/client_spec.r
2026
2053
  * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L46)
2027
2054
  * with :use_token_auth set to true
2028
2055
  * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L54)
2029
- * with a :client_id configured
2030
- * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L62)
2031
2056
  * with a non string :client_id
2032
- * [raises an ArgumentError](./spec/acceptance/rest/client_spec.rb#L70)
2057
+ * [raises an ArgumentError](./spec/acceptance/rest/client_spec.rb#L62)
2033
2058
  * with an invalid wildcard "*" :client_id
2034
- * [raises an exception](./spec/acceptance/rest/client_spec.rb#L76)
2059
+ * [raises an exception](./spec/acceptance/rest/client_spec.rb#L68)
2035
2060
  * with an :auth_callback lambda
2036
- * [calls the auth lambda to get a new token](./spec/acceptance/rest/client_spec.rb#L84)
2037
- * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L89)
2061
+ * [calls the auth lambda to get a new token](./spec/acceptance/rest/client_spec.rb#L76)
2062
+ * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L81)
2038
2063
  * with :default_token_params
2039
- * [overides the default token params (#TO3j11)](./spec/acceptance/rest/client_spec.rb#L103)
2064
+ * [overides the default token params (#TO3j11)](./spec/acceptance/rest/client_spec.rb#L95)
2040
2065
  * with an :auth_callback lambda (clientId provided in library options instead of as a token_request param)
2041
- * [correctly sets the clientId on the token](./spec/acceptance/rest/client_spec.rb#L113)
2066
+ * [correctly sets the clientId on the token](./spec/acceptance/rest/client_spec.rb#L105)
2042
2067
  * with an auth URL
2043
- * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L123)
2068
+ * [uses token authentication](./spec/acceptance/rest/client_spec.rb#L115)
2044
2069
  * before any REST request
2045
- * [sends an HTTP request to the provided auth URL to get a new token](./spec/acceptance/rest/client_spec.rb#L134)
2070
+ * [sends an HTTP request to the provided auth URL to get a new token](./spec/acceptance/rest/client_spec.rb#L126)
2046
2071
  * auth headers
2047
2072
  * with basic auth
2048
- * [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#L154)
2073
+ * [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#L147)
2049
2074
  * with token auth
2050
2075
  * without specifying protocol
2051
- * [sends the token string over HTTPS in the Authorization Bearer header with Base64 encoding](./spec/acceptance/rest/client_spec.rb#L173)
2076
+ * [sends the token string over HTTPS in the Authorization Bearer header with Base64 encoding](./spec/acceptance/rest/client_spec.rb#L166)
2052
2077
  * when setting constructor ClientOption :tls to false
2053
- * [sends the token string over HTTP in the Authorization Bearer header with Base64 encoding](./spec/acceptance/rest/client_spec.rb#L183)
2078
+ * [sends the token string over HTTP in the Authorization Bearer header with Base64 encoding](./spec/acceptance/rest/client_spec.rb#L176)
2054
2079
  * using tokens
2055
2080
  * when expired
2056
- * [creates a new token automatically when the old token expires](./spec/acceptance/rest/client_spec.rb#L216)
2081
+ * [creates a new token automatically when the old token expires](./spec/acceptance/rest/client_spec.rb#L209)
2057
2082
  * with a different client_id in the subsequent token
2058
- * [fails to authenticate and raises an exception](./spec/acceptance/rest/client_spec.rb#L229)
2083
+ * [fails to authenticate and raises an exception](./spec/acceptance/rest/client_spec.rb#L222)
2059
2084
  * when token has not expired
2060
- * [reuses the existing token for every request](./spec/acceptance/rest/client_spec.rb#L240)
2085
+ * [reuses the existing token for every request](./spec/acceptance/rest/client_spec.rb#L233)
2061
2086
  * connection transport
2062
2087
  * defaults
2063
2088
  * for default host
2064
- * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L257)
2065
- * [is configured to timeout connection requests in 10 seconds](./spec/acceptance/rest/client_spec.rb#L261)
2089
+ * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L250)
2090
+ * [is configured to timeout connection requests in 10 seconds](./spec/acceptance/rest/client_spec.rb#L254)
2066
2091
  * for the fallback hosts
2067
- * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L267)
2068
- * [is configured to timeout connection requests in 10 seconds](./spec/acceptance/rest/client_spec.rb#L271)
2092
+ * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L260)
2093
+ * [is configured to timeout connection requests in 10 seconds](./spec/acceptance/rest/client_spec.rb#L264)
2069
2094
  * with custom http_open_timeout and http_request_timeout options
2070
2095
  * for default host
2071
- * [is configured to use custom open timeout](./spec/acceptance/rest/client_spec.rb#L283)
2072
- * [is configured to use custom request timeout](./spec/acceptance/rest/client_spec.rb#L287)
2096
+ * [is configured to use custom open timeout](./spec/acceptance/rest/client_spec.rb#L276)
2097
+ * [is configured to use custom request timeout](./spec/acceptance/rest/client_spec.rb#L280)
2073
2098
  * for the fallback hosts
2074
- * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L293)
2075
- * [is configured to timeout connection requests in 10 seconds](./spec/acceptance/rest/client_spec.rb#L297)
2099
+ * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L286)
2100
+ * [is configured to timeout connection requests in 10 seconds](./spec/acceptance/rest/client_spec.rb#L290)
2076
2101
  * fallback hosts
2077
2102
  * configured
2078
- * [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#L311)
2103
+ * [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#L304)
2079
2104
  * when environment is NOT production (#RSC15b)
2080
- * [does not retry failed requests with fallback hosts when there is a connection error](./spec/acceptance/rest/client_spec.rb#L328)
2105
+ * and custom fallback hosts are empty
2106
+ * [does not retry failed requests with fallback hosts when there is a connection error](./spec/acceptance/rest/client_spec.rb#L322)
2107
+ * and no custom fallback hosts are provided
2108
+ * [should make connection attempts to sandbox-a-fallback.ably-realtime.com, sandbox-b-fallback.ably-realtime.com, sandbox-c-fallback.ably-realtime.com, sandbox-d-fallback.ably-realtime.com, sandbox-e-fallback.ably-realtime.com (#RSC15a)](./spec/acceptance/rest/client_spec.rb#L330)
2081
2109
  * when environment is production
2082
2110
  * and connection times out
2083
- * [tries fallback hosts 3 times (#RSC15b, #RSC15b)](./spec/acceptance/rest/client_spec.rb#L367)
2111
+ * [tries fallback hosts 3 times (#RSC15b, #RSC15b)](./spec/acceptance/rest/client_spec.rb#L374)
2084
2112
  * and the total request time exeeds 15 seconds
2085
- * [makes no further attempts to any fallback hosts](./spec/acceptance/rest/client_spec.rb#L382)
2113
+ * [makes no further attempts to any fallback hosts](./spec/acceptance/rest/client_spec.rb#L389)
2086
2114
  * and connection fails
2087
- * [tries fallback hosts 3 times](./spec/acceptance/rest/client_spec.rb#L398)
2115
+ * [tries fallback hosts 3 times](./spec/acceptance/rest/client_spec.rb#L405)
2088
2116
  * and first request to primary endpoint fails
2089
- * [tries a fallback host, and for the next request tries the primary endpoint again (#RSC15e)](./spec/acceptance/rest/client_spec.rb#L432)
2117
+ * [tries a fallback host, and for the next request tries the primary endpoint again (#RSC15e)](./spec/acceptance/rest/client_spec.rb#L439)
2090
2118
  * and basic authentication fails
2091
- * [does not attempt the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L459)
2119
+ * [does not attempt the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L466)
2092
2120
  * and server returns a 50x error
2093
- * [attempts the fallback hosts as this is an authentication failure (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L481)
2121
+ * [attempts the fallback hosts as this is an authentication failure (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L488)
2094
2122
  * when environment is production and server returns a 50x error
2095
2123
  * with custom fallback hosts provided
2096
- * [attempts the fallback hosts as this is an authentication failure (#RSC15b, #RSC15a, #TO3k6)](./spec/acceptance/rest/client_spec.rb#L530)
2124
+ * [attempts the fallback hosts as this is an authentication failure (#RSC15b, #RSC15a, #TO3k6)](./spec/acceptance/rest/client_spec.rb#L537)
2097
2125
  * with an empty array of fallback hosts provided (#RSC15b, #RSC15a, #TO3k6)
2098
- * [does not attempt the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L543)
2126
+ * [does not attempt the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L550)
2099
2127
  * using a local web-server
2100
2128
  * and timing out the primary host
2101
2129
  * POST with request timeout less than max_retry_duration
2102
- * [tries the primary host, then both fallback hosts (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L607)
2130
+ * [tries the primary host, then both fallback hosts (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L614)
2103
2131
  * GET with request timeout less than max_retry_duration
2104
- * [tries the primary host, then both fallback hosts (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L630)
2132
+ * [tries the primary host, then both fallback hosts (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L637)
2105
2133
  * POST with request timeout more than max_retry_duration
2106
- * [does not try any fallback hosts (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L653)
2134
+ * [does not try any fallback hosts (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L660)
2107
2135
  * GET with request timeout more than max_retry_duration
2108
- * [does not try any fallback hosts (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L675)
2136
+ * [does not try any fallback hosts (#RSC15d)](./spec/acceptance/rest/client_spec.rb#L682)
2109
2137
  * and failing the primary host
2110
- * [tries one of the fallback hosts](./spec/acceptance/rest/client_spec.rb#L720)
2138
+ * [tries one of the fallback hosts](./spec/acceptance/rest/client_spec.rb#L727)
2111
2139
  * to fail the primary host, allow a fallback to succeed, then later trigger a fallback to the primary host (#RSC15f)
2112
- * [succeeds and remembers fallback host preferences across requests](./spec/acceptance/rest/client_spec.rb#L776)
2140
+ * [succeeds and remembers fallback host preferences across requests](./spec/acceptance/rest/client_spec.rb#L783)
2113
2141
  * with custom :fallback_retry_timeout
2114
- * [stops using the preferred fallback after this time](./spec/acceptance/rest/client_spec.rb#L813)
2142
+ * [stops using the preferred fallback after this time](./spec/acceptance/rest/client_spec.rb#L820)
2115
2143
  * when environment is not production and server returns a 50x error
2144
+ * with no fallback hosts provided (#TBC, see https://github.com/ably/wiki/issues/361)
2145
+ * [uses the default fallback hosts for that environment as this is not an authentication failure](./spec/acceptance/rest/client_spec.rb#L874)
2116
2146
  * with custom fallback hosts provided (#RSC15b, #TO3k6)
2117
- * [attempts the fallback hosts as this is not an authentication failure](./spec/acceptance/rest/client_spec.rb#L874)
2147
+ * [attempts the fallback hosts as this is not an authentication failure](./spec/acceptance/rest/client_spec.rb#L902)
2118
2148
  * with an empty array of fallback hosts provided (#RSC15b, #TO3k6)
2119
- * [does not attempt the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L887)
2149
+ * [does not attempt the fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L915)
2120
2150
  * with fallback_hosts_use_default: true (#RSC15b, #TO3k7)
2121
- * [attempts the default fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L912)
2151
+ * [attempts the default fallback hosts as this is an authentication failure](./spec/acceptance/rest/client_spec.rb#L940)
2122
2152
  * with a custom host
2123
2153
  * that does not exist
2124
- * [fails immediately and raises a Faraday Error](./spec/acceptance/rest/client_spec.rb#L928)
2154
+ * [fails immediately and raises a Faraday Error](./spec/acceptance/rest/client_spec.rb#L956)
2125
2155
  * fallback hosts
2126
- * [are never used](./spec/acceptance/rest/client_spec.rb#L949)
2156
+ * [are never used](./spec/acceptance/rest/client_spec.rb#L977)
2127
2157
  * that times out
2128
- * [fails immediately and raises a Faraday Error](./spec/acceptance/rest/client_spec.rb#L964)
2158
+ * [fails immediately and raises a Faraday Error](./spec/acceptance/rest/client_spec.rb#L992)
2129
2159
  * fallback hosts
2130
- * [are never used](./spec/acceptance/rest/client_spec.rb#L977)
2160
+ * [are never used](./spec/acceptance/rest/client_spec.rb#L1005)
2131
2161
  * HTTP configuration options
2132
- * [is frozen](./spec/acceptance/rest/client_spec.rb#L1034)
2162
+ * [is frozen](./spec/acceptance/rest/client_spec.rb#L1062)
2133
2163
  * defaults
2134
- * [#http_open_timeout is 4s](./spec/acceptance/rest/client_spec.rb#L989)
2135
- * [#http_request_timeout is 10s](./spec/acceptance/rest/client_spec.rb#L993)
2136
- * [#http_max_retry_count is 3](./spec/acceptance/rest/client_spec.rb#L997)
2137
- * [#http_max_retry_duration is 15s](./spec/acceptance/rest/client_spec.rb#L1001)
2164
+ * [#http_open_timeout is 4s](./spec/acceptance/rest/client_spec.rb#L1017)
2165
+ * [#http_request_timeout is 10s](./spec/acceptance/rest/client_spec.rb#L1021)
2166
+ * [#http_max_retry_count is 3](./spec/acceptance/rest/client_spec.rb#L1025)
2167
+ * [#http_max_retry_duration is 15s](./spec/acceptance/rest/client_spec.rb#L1029)
2138
2168
  * configured
2139
- * [#http_open_timeout uses provided value](./spec/acceptance/rest/client_spec.rb#L1017)
2140
- * [#http_request_timeout uses provided value](./spec/acceptance/rest/client_spec.rb#L1021)
2141
- * [#http_max_retry_count uses provided value](./spec/acceptance/rest/client_spec.rb#L1025)
2142
- * [#http_max_retry_duration uses provided value](./spec/acceptance/rest/client_spec.rb#L1029)
2169
+ * [#http_open_timeout uses provided value](./spec/acceptance/rest/client_spec.rb#L1045)
2170
+ * [#http_request_timeout uses provided value](./spec/acceptance/rest/client_spec.rb#L1049)
2171
+ * [#http_max_retry_count uses provided value](./spec/acceptance/rest/client_spec.rb#L1053)
2172
+ * [#http_max_retry_duration uses provided value](./spec/acceptance/rest/client_spec.rb#L1057)
2143
2173
  * #auth
2144
- * [is provides access to the Auth object](./spec/acceptance/rest/client_spec.rb#L1045)
2145
- * [configures the Auth object with all ClientOptions passed to client in the initializer](./spec/acceptance/rest/client_spec.rb#L1049)
2174
+ * [is provides access to the Auth object](./spec/acceptance/rest/client_spec.rb#L1073)
2175
+ * [configures the Auth object with all ClientOptions passed to client in the initializer](./spec/acceptance/rest/client_spec.rb#L1077)
2146
2176
  * version headers
2147
2177
  * with variant none
2148
- * [sends a protocol version and lib version header (#G4, #RSC7a, #RSC7b)](./spec/acceptance/rest/client_spec.rb#L1083)
2178
+ * [sends a protocol version and lib version header (#G4, #RSC7a, #RSC7b)](./spec/acceptance/rest/client_spec.rb#L1111)
2149
2179
  * with variant foo
2150
- * [sends a protocol version and lib version header (#G4, #RSC7a, #RSC7b)](./spec/acceptance/rest/client_spec.rb#L1083)
2180
+ * [sends a protocol version and lib version header (#G4, #RSC7a, #RSC7b)](./spec/acceptance/rest/client_spec.rb#L1111)
2151
2181
  * #request (#RSC19*)
2152
2182
  * get
2153
- * [returns an HttpPaginatedResponse object](./spec/acceptance/rest/client_spec.rb#L1096)
2183
+ * [returns an HttpPaginatedResponse object](./spec/acceptance/rest/client_spec.rb#L1126)
2154
2184
  * 404 request to invalid URL
2155
- * [returns an object with 404 status code and error message](./spec/acceptance/rest/client_spec.rb#L1103)
2185
+ * [returns an object with 404 status code and error message](./spec/acceptance/rest/client_spec.rb#L1133)
2156
2186
  * paged results
2157
- * [provides paging](./spec/acceptance/rest/client_spec.rb#L1115)
2187
+ * [provides paging](./spec/acceptance/rest/client_spec.rb#L1145)
2188
+ * post
2189
+ * [supports post](./spec/acceptance/rest/client_spec.rb#L1170)
2190
+ * delete
2191
+ * [supports delete](./spec/acceptance/rest/client_spec.rb#L1183)
2192
+ * patch
2193
+ * [supports patch](./spec/acceptance/rest/client_spec.rb#L1199)
2194
+ * put
2195
+ * [supports put](./spec/acceptance/rest/client_spec.rb#L1222)
2158
2196
  * request_id generation
2159
2197
  * Timeout error
2160
- * with option add_request_ids: true
2161
- * [has an error with the same request_id of the request](./spec/acceptance/rest/client_spec.rb#L1150)
2198
+ * with option add_request_ids: true and no fallback hosts
2199
+ * [has an error with the same request_id of the request](./spec/acceptance/rest/client_spec.rb#L1245)
2162
2200
  * with option add_request_ids: true and REST operations with a message body
2163
2201
  * with mocks to inspect the params
2164
2202
  * with a single publish
2165
- * [succeeds and sends the request_id as a param](./spec/acceptance/rest/client_spec.rb#L1172)
2203
+ * [succeeds and sends the request_id as a param](./spec/acceptance/rest/client_spec.rb#L1267)
2166
2204
  * with an array publish
2167
- * [succeeds and sends the request_id as a param](./spec/acceptance/rest/client_spec.rb#L1179)
2205
+ * [succeeds and sends the request_id as a param](./spec/acceptance/rest/client_spec.rb#L1274)
2168
2206
  * without mocks to ensure the requests are accepted
2169
2207
  * with a single publish
2170
- * [succeeds and sends the request_id as a param](./spec/acceptance/rest/client_spec.rb#L1188)
2208
+ * [succeeds and sends the request_id as a param](./spec/acceptance/rest/client_spec.rb#L1283)
2171
2209
  * with an array publish
2172
- * [succeeds and sends the request_id as a param](./spec/acceptance/rest/client_spec.rb#L1195)
2210
+ * [succeeds and sends the request_id as a param](./spec/acceptance/rest/client_spec.rb#L1290)
2173
2211
  * option add_request_ids: true and specified fallback hosts
2174
- * [request_id is the same across retries](./spec/acceptance/rest/client_spec.rb#L1220)
2175
- * without request_id
2176
- * [does not include request_id in ConnectionTimeout error](./spec/acceptance/rest/client_spec.rb#L1232)
2212
+ * [request_id is the same across retries](./spec/acceptance/rest/client_spec.rb#L1315)
2213
+ * without request_id and no fallback hosts
2214
+ * [does not include request_id in ConnectionTimeout error](./spec/acceptance/rest/client_spec.rb#L1327)
2177
2215
  * UnauthorizedRequest nonce error
2178
- * [includes request_id in UnauthorizedRequest error due to replayed nonce](./spec/acceptance/rest/client_spec.rb#L1245)
2216
+ * [includes request_id in UnauthorizedRequest error due to replayed nonce](./spec/acceptance/rest/client_spec.rb#L1340)
2179
2217
  * failed request logging
2180
- * [is absent when requests do not fail](./spec/acceptance/rest/client_spec.rb#L1262)
2218
+ * [is absent when requests do not fail](./spec/acceptance/rest/client_spec.rb#L1357)
2181
2219
  * with the first request failing
2182
- * [is present with success message when requests do not actually fail](./spec/acceptance/rest/client_spec.rb#L1277)
2220
+ * [is present with success message when requests do not actually fail](./spec/acceptance/rest/client_spec.rb#L1372)
2183
2221
  * with all requests failing
2184
- * [is present when all requests fail](./spec/acceptance/rest/client_spec.rb#L1294)
2222
+ * [is present when all requests fail](./spec/acceptance/rest/client_spec.rb#L1389)
2185
2223
 
2186
2224
  ### Ably::Models::MessageEncoders
2187
2225
  _(see [spec/acceptance/rest/encoders_spec.rb](./spec/acceptance/rest/encoders_spec.rb))_
@@ -2234,99 +2272,99 @@ _(see [spec/acceptance/rest/message_spec.rb](./spec/acceptance/rest/message_spec
2234
2272
  * JSON Object (Hash)
2235
2273
  * [is encoded and decoded to the same hash](./spec/acceptance/rest/message_spec.rb#L71)
2236
2274
  * JSON Array
2237
- * [is encoded and decoded to the same deep multi-type object](./spec/acceptance/rest/message_spec.rb#L81)
2275
+ * [is encoded and decoded to the same deep multi-type object](./spec/acceptance/rest/message_spec.rb#L80)
2238
2276
  * nil
2239
- * [is encoded and decoded to the same Array](./spec/acceptance/rest/message_spec.rb#L88)
2277
+ * [is encoded and decoded to the same Array](./spec/acceptance/rest/message_spec.rb#L87)
2240
2278
  * idempotency (#RSL1k)
2241
- * [idempotent publishing is disabled by default with 1.1 (#TO3n)](./spec/acceptance/rest/message_spec.rb#L165)
2242
- * [idempotent publishing is enabled by default with 1.2 (#TO3n)](./spec/acceptance/rest/message_spec.rb#L170)
2279
+ * [idempotent publishing is disabled by default with 1.1 (#TO3n)](./spec/acceptance/rest/message_spec.rb#L156)
2280
+ * [idempotent publishing is enabled by default with 1.2 (#TO3n)](./spec/acceptance/rest/message_spec.rb#L161)
2243
2281
  * when ID is not included (#RSL1k2)
2244
2282
  * with Message object
2245
- * [publishes the same message three times](./spec/acceptance/rest/message_spec.rb#L104)
2283
+ * [publishes the same message three times](./spec/acceptance/rest/message_spec.rb#L103)
2246
2284
  * with #publish arguments only
2247
- * [publishes the same message three times](./spec/acceptance/rest/message_spec.rb#L111)
2285
+ * [publishes the same message three times](./spec/acceptance/rest/message_spec.rb#L110)
2248
2286
  * when ID is included (#RSL1k2, #RSL1k5)
2249
- * [the ID provided is used for the published messages](./spec/acceptance/rest/message_spec.rb#L140)
2250
- * PENDING: *[for multiple messages in one publish operation (#RSL1k3)](./spec/acceptance/rest/message_spec.rb#L145)*
2251
- * PENDING: *[for multiple messages in one publish operation with IDs following the required format described in RSL1k1 (#RSL1k3)](./spec/acceptance/rest/message_spec.rb#L154)*
2287
+ * [the ID provided is used for the published messages](./spec/acceptance/rest/message_spec.rb#L135)
2288
+ * [for multiple messages in one publish operation (#RSL1k3)](./spec/acceptance/rest/message_spec.rb#L140)
2289
+ * [for multiple messages in one publish operation with IDs following the required format described in RSL1k1 (#RSL1k3)](./spec/acceptance/rest/message_spec.rb#L147)
2252
2290
  * with Message object
2253
- * PENDING: *[three REST publishes result in only one message being published](./spec/acceptance/rest/message_spec.rb#L122)*
2291
+ * [three REST publishes result in only one message being published](./spec/acceptance/rest/message_spec.rb#L121)
2254
2292
  * with #publish arguments only
2255
- * PENDING: *[three REST publishes result in only one message being published](./spec/acceptance/rest/message_spec.rb#L132)*
2293
+ * [three REST publishes result in only one message being published](./spec/acceptance/rest/message_spec.rb#L129)
2256
2294
  * when idempotent publishing is enabled in the client library ClientOptions (#TO3n)
2257
- * [the ID is populated with a random ID and serial 0 from this lib (#RSL1k1)](./spec/acceptance/rest/message_spec.rb#L242)
2295
+ * [the ID is populated with a random ID and serial 0 from this lib (#RSL1k1)](./spec/acceptance/rest/message_spec.rb#L225)
2258
2296
  * when there is a network failure triggering an automatic retry (#RSL1k4)
2259
- * PENDING: *[for multiple messages in one publish operation](./spec/acceptance/rest/message_spec.rb#L233)*
2297
+ * [for multiple messages in one publish operation](./spec/acceptance/rest/message_spec.rb#L218)
2260
2298
  * with Message object
2261
- * PENDING: *[two REST publish retries result in only one message being published](./spec/acceptance/rest/message_spec.rb#L197)*
2299
+ * [two REST publish retries result in only one message being published](./spec/acceptance/rest/message_spec.rb#L188)
2262
2300
  * with #publish arguments only
2263
- * PENDING: *[two REST publish retries result in only one message being published](./spec/acceptance/rest/message_spec.rb#L209)*
2301
+ * [two REST publish retries result in only one message being published](./spec/acceptance/rest/message_spec.rb#L198)
2264
2302
  * with explicitly provided message ID
2265
- * PENDING: *[two REST publish retries result in only one message being published](./spec/acceptance/rest/message_spec.rb#L223)*
2303
+ * [two REST publish retries result in only one message being published](./spec/acceptance/rest/message_spec.rb#L210)
2266
2304
  * when publishing a batch of messages
2267
- * PENDING: *[the ID is populated with a single random ID and sequence of serials from this lib (#RSL1k1)](./spec/acceptance/rest/message_spec.rb#L250)*
2305
+ * [the ID is populated with a single random ID and sequence of serials from this lib (#RSL1k1)](./spec/acceptance/rest/message_spec.rb#L233)
2268
2306
  * with unsupported data payload content type
2269
2307
  * Integer
2270
- * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/rest/message_spec.rb#L269)
2308
+ * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/rest/message_spec.rb#L250)
2271
2309
  * Float
2272
- * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/rest/message_spec.rb#L277)
2310
+ * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/rest/message_spec.rb#L258)
2273
2311
  * Boolean
2274
- * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/rest/message_spec.rb#L285)
2312
+ * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/rest/message_spec.rb#L266)
2275
2313
  * False
2276
- * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/rest/message_spec.rb#L293)
2314
+ * [is raises an UnsupportedDataType 40013 exception](./spec/acceptance/rest/message_spec.rb#L274)
2277
2315
  * encryption and encoding
2278
2316
  * with #publish and #history
2279
2317
  * with AES-128-CBC using crypto-data-128.json fixtures (#RTL7d)
2280
2318
  * item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
2281
2319
  * behaves like an Ably encrypter and decrypter
2282
- * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L338)
2283
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L353)
2320
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L319)
2321
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L334)
2284
2322
  * item 1 with encrypted encoding cipher+aes-128-cbc/base64
2285
2323
  * behaves like an Ably encrypter and decrypter
2286
- * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L338)
2287
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L353)
2324
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L319)
2325
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L334)
2288
2326
  * item 2 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
2289
2327
  * behaves like an Ably encrypter and decrypter
2290
- * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L338)
2291
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L353)
2328
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L319)
2329
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L334)
2292
2330
  * item 3 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
2293
2331
  * behaves like an Ably encrypter and decrypter
2294
- * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L338)
2295
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L353)
2332
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L319)
2333
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L334)
2296
2334
  * with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d)
2297
2335
  * item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
2298
2336
  * behaves like an Ably encrypter and decrypter
2299
- * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L338)
2300
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L353)
2337
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L319)
2338
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L334)
2301
2339
  * item 1 with encrypted encoding cipher+aes-256-cbc/base64
2302
2340
  * behaves like an Ably encrypter and decrypter
2303
- * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L338)
2304
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L353)
2341
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L319)
2342
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L334)
2305
2343
  * item 2 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
2306
2344
  * behaves like an Ably encrypter and decrypter
2307
- * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L338)
2308
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L353)
2345
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L319)
2346
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L334)
2309
2347
  * item 3 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
2310
2348
  * behaves like an Ably encrypter and decrypter
2311
- * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L338)
2312
- * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L353)
2349
+ * [encrypts message automatically when published (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L319)
2350
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library (#RTL7d)](./spec/acceptance/rest/message_spec.rb#L334)
2313
2351
  * when publishing lots of messages
2314
- * [encrypts on #publish and decrypts on #history](./spec/acceptance/rest/message_spec.rb#L386)
2352
+ * [encrypts on #publish and decrypts on #history](./spec/acceptance/rest/message_spec.rb#L367)
2315
2353
  * when retrieving #history with a different protocol
2316
- * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/rest/message_spec.rb#L413)
2317
- * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/rest/message_spec.rb#L413)
2318
- * [delivers a Hash payload to the receiver](./spec/acceptance/rest/message_spec.rb#L413)
2354
+ * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/rest/message_spec.rb#L394)
2355
+ * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/rest/message_spec.rb#L394)
2356
+ * [delivers a Hash payload to the receiver](./spec/acceptance/rest/message_spec.rb#L394)
2319
2357
  * when publishing on an unencrypted channel and retrieving with #history on an encrypted channel
2320
- * [does not attempt to decrypt the message](./spec/acceptance/rest/message_spec.rb#L429)
2358
+ * [does not attempt to decrypt the message](./spec/acceptance/rest/message_spec.rb#L410)
2321
2359
  * when publishing on an encrypted channel and retrieving with #history on an unencrypted channel
2322
- * [retrieves the message that remains encrypted with an encrypted encoding attribute (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L450)
2323
- * [logs a Cipher exception (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L456)
2360
+ * [retrieves the message that remains encrypted with an encrypted encoding attribute (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L431)
2361
+ * [logs a Cipher exception (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L437)
2324
2362
  * publishing on an encrypted channel and retrieving #history with a different algorithm on another client (#RTL7e)
2325
- * [retrieves the message that remains encrypted with an encrypted encoding attribute (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L477)
2326
- * [logs a Cipher exception (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L483)
2363
+ * [retrieves the message that remains encrypted with an encrypted encoding attribute (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L458)
2364
+ * [logs a Cipher exception (#RTL7e)](./spec/acceptance/rest/message_spec.rb#L464)
2327
2365
  * publishing on an encrypted channel and subscribing with a different key on another client
2328
- * [retrieves the message that remains encrypted with an encrypted encoding attribute](./spec/acceptance/rest/message_spec.rb#L504)
2329
- * [logs a Cipher exception](./spec/acceptance/rest/message_spec.rb#L510)
2366
+ * [retrieves the message that remains encrypted with an encrypted encoding attribute](./spec/acceptance/rest/message_spec.rb#L485)
2367
+ * [logs a Cipher exception](./spec/acceptance/rest/message_spec.rb#L491)
2330
2368
 
2331
2369
  ### Ably::Rest::Presence
2332
2370
  _(see [spec/acceptance/rest/presence_spec.rb](./spec/acceptance/rest/presence_spec.rb))_
@@ -2399,7 +2437,7 @@ _(see [spec/acceptance/rest/presence_spec.rb](./spec/acceptance/rest/presence_sp
2399
2437
  _(see [spec/acceptance/rest/push_admin_spec.rb](./spec/acceptance/rest/push_admin_spec.rb))_
2400
2438
  * using JSON protocol
2401
2439
  * #publish
2402
- * [accepts valid push data and recipient (#RSH1a)](./spec/acceptance/rest/push_admin_spec.rb#L127)
2440
+ * [accepts valid push data and recipient (#RSH1a)](./spec/acceptance/rest/push_admin_spec.rb#L111)
2403
2441
  * without publish permissions
2404
2442
  * [raises a permissions issue exception](./spec/acceptance/rest/push_admin_spec.rb#L40)
2405
2443
  * invalid arguments (#RHS1a)
@@ -2412,71 +2450,71 @@ _(see [spec/acceptance/rest/push_admin_spec.rb](./spec/acceptance/rest/push_admi
2412
2450
  * invalid push data (#RSH1a)
2413
2451
  * [raises an error after receiving a 40x realtime response](./spec/acceptance/rest/push_admin_spec.rb#L70)
2414
2452
  * recipient variable case
2415
- * [is converted to snakeCase](./spec/acceptance/rest/push_admin_spec.rb#L121)
2453
+ * [is converted to snakeCase](./spec/acceptance/rest/push_admin_spec.rb#L105)
2416
2454
  * using test environment channel recipient (#RSH1a)
2417
- * [triggers a push notification](./spec/acceptance/rest/push_admin_spec.rb#L152)
2455
+ * [triggers a push notification](./spec/acceptance/rest/push_admin_spec.rb#L136)
2418
2456
  * #device_registrations (#RSH1b)
2419
2457
  * without permissions
2420
- * [raises a permissions not authorized exception](./spec/acceptance/rest/push_admin_spec.rb#L172)
2458
+ * [raises a permissions not authorized exception](./spec/acceptance/rest/push_admin_spec.rb#L156)
2421
2459
  * #list (#RSH1b2)
2422
- * [returns a PaginatedResult object containing DeviceDetails objects](./spec/acceptance/rest/push_admin_spec.rb#L207)
2423
- * [returns an empty PaginatedResult if not params match](./spec/acceptance/rest/push_admin_spec.rb#L213)
2424
- * [supports paging](./spec/acceptance/rest/push_admin_spec.rb#L219)
2425
- * [provides filtering](./spec/acceptance/rest/push_admin_spec.rb#L231)
2460
+ * [returns a PaginatedResult object containing DeviceDetails objects](./spec/acceptance/rest/push_admin_spec.rb#L197)
2461
+ * [returns an empty PaginatedResult if not params match](./spec/acceptance/rest/push_admin_spec.rb#L203)
2462
+ * [supports paging](./spec/acceptance/rest/push_admin_spec.rb#L209)
2463
+ * [provides filtering](./spec/acceptance/rest/push_admin_spec.rb#L221)
2426
2464
  * #get (#RSH1b1)
2427
- * [returns a DeviceDetails object if a device ID string is provided](./spec/acceptance/rest/push_admin_spec.rb#L270)
2428
- * [returns a DeviceDetails object if a DeviceDetails object is provided](./spec/acceptance/rest/push_admin_spec.rb#L278)
2429
- * [raises a ResourceMissing exception if device ID does not exist](./spec/acceptance/rest/push_admin_spec.rb#L286)
2465
+ * [returns a DeviceDetails object if a device ID string is provided](./spec/acceptance/rest/push_admin_spec.rb#L266)
2466
+ * [returns a DeviceDetails object if a DeviceDetails object is provided](./spec/acceptance/rest/push_admin_spec.rb#L274)
2467
+ * [raises a ResourceMissing exception if device ID does not exist](./spec/acceptance/rest/push_admin_spec.rb#L282)
2430
2468
  * #save (#RSH1b3)
2431
- * [saves the new DeviceDetails Hash object](./spec/acceptance/rest/push_admin_spec.rb#L325)
2432
- * [saves the associated DevicePushDetails](./spec/acceptance/rest/push_admin_spec.rb#L340)
2433
- * [does not allow some fields to be configured](./spec/acceptance/rest/push_admin_spec.rb#L394)
2434
- * [allows device_secret to be configured](./spec/acceptance/rest/push_admin_spec.rb#L407)
2435
- * [saves the new DeviceDetails object](./spec/acceptance/rest/push_admin_spec.rb#L416)
2436
- * [allows arbitrary number of subsequent saves](./spec/acceptance/rest/push_admin_spec.rb#L425)
2437
- * [fails if data is invalid](./spec/acceptance/rest/push_admin_spec.rb#L438)
2469
+ * [saves the new DeviceDetails Hash object](./spec/acceptance/rest/push_admin_spec.rb#L327)
2470
+ * [saves the associated DevicePushDetails](./spec/acceptance/rest/push_admin_spec.rb#L342)
2471
+ * [does not allow some fields to be configured](./spec/acceptance/rest/push_admin_spec.rb#L396)
2472
+ * [allows device_secret to be configured](./spec/acceptance/rest/push_admin_spec.rb#L409)
2473
+ * [saves the new DeviceDetails object](./spec/acceptance/rest/push_admin_spec.rb#L418)
2474
+ * [allows arbitrary number of subsequent saves](./spec/acceptance/rest/push_admin_spec.rb#L427)
2475
+ * [fails if data is invalid](./spec/acceptance/rest/push_admin_spec.rb#L440)
2438
2476
  * with GCM target
2439
- * [saves the associated DevicePushDetails](./spec/acceptance/rest/push_admin_spec.rb#L354)
2477
+ * [saves the associated DevicePushDetails](./spec/acceptance/rest/push_admin_spec.rb#L356)
2440
2478
  * with web target
2441
- * [saves the associated DevicePushDetails](./spec/acceptance/rest/push_admin_spec.rb#L375)
2479
+ * [saves the associated DevicePushDetails](./spec/acceptance/rest/push_admin_spec.rb#L377)
2442
2480
  * #remove_where (#RSH1b5)
2443
- * [removes all matching device registrations by client_id](./spec/acceptance/rest/push_admin_spec.rb#L484)
2444
- * [removes device by device_id](./spec/acceptance/rest/push_admin_spec.rb#L489)
2445
- * [succeeds even if there is no match](./spec/acceptance/rest/push_admin_spec.rb#L494)
2481
+ * [removes all matching device registrations by client_id](./spec/acceptance/rest/push_admin_spec.rb#L492)
2482
+ * [removes device by device_id](./spec/acceptance/rest/push_admin_spec.rb#L497)
2483
+ * [succeeds even if there is no match](./spec/acceptance/rest/push_admin_spec.rb#L502)
2446
2484
  * #remove (#RSH1b4)
2447
- * [removes the provided device id string](./spec/acceptance/rest/push_admin_spec.rb#L541)
2448
- * [removes the provided DeviceDetails](./spec/acceptance/rest/push_admin_spec.rb#L546)
2449
- * [succeeds if the item does not exist](./spec/acceptance/rest/push_admin_spec.rb#L551)
2485
+ * [removes the provided device id string](./spec/acceptance/rest/push_admin_spec.rb#L555)
2486
+ * [removes the provided DeviceDetails](./spec/acceptance/rest/push_admin_spec.rb#L560)
2487
+ * [succeeds if the item does not exist](./spec/acceptance/rest/push_admin_spec.rb#L565)
2450
2488
  * #channel_subscriptions (#RSH1c)
2451
2489
  * #list (#RSH1c1)
2452
- * [returns a PaginatedResult object containing DeviceDetails objects](./spec/acceptance/rest/push_admin_spec.rb#L613)
2453
- * [returns an empty PaginatedResult if params do not match](./spec/acceptance/rest/push_admin_spec.rb#L619)
2454
- * [supports paging](./spec/acceptance/rest/push_admin_spec.rb#L625)
2455
- * [provides filtering](./spec/acceptance/rest/push_admin_spec.rb#L637)
2456
- * [raises an exception if none of the required filters are provided](./spec/acceptance/rest/push_admin_spec.rb#L665)
2490
+ * [returns a PaginatedResult object containing DeviceDetails objects](./spec/acceptance/rest/push_admin_spec.rb#L633)
2491
+ * [returns an empty PaginatedResult if params do not match](./spec/acceptance/rest/push_admin_spec.rb#L639)
2492
+ * [supports paging](./spec/acceptance/rest/push_admin_spec.rb#L645)
2493
+ * [provides filtering](./spec/acceptance/rest/push_admin_spec.rb#L657)
2494
+ * [raises an exception if none of the required filters are provided](./spec/acceptance/rest/push_admin_spec.rb#L685)
2457
2495
  * #list_channels (#RSH1c2)
2458
- * [returns a PaginatedResult object containing String objects](./spec/acceptance/rest/push_admin_spec.rb#L689)
2459
- * PENDING: *[supports paging](./spec/acceptance/rest/push_admin_spec.rb#L696)*
2460
- * [returns an accurate number of channels after devices are deleted](./spec/acceptance/rest/push_admin_spec.rb#L714)
2496
+ * [returns a PaginatedResult object containing String objects](./spec/acceptance/rest/push_admin_spec.rb#L712)
2497
+ * [supports paging](./spec/acceptance/rest/push_admin_spec.rb#L719)
2498
+ * [returns an accurate number of channels after devices are deleted](./spec/acceptance/rest/push_admin_spec.rb#L734)
2461
2499
  * #save (#RSH1c3)
2462
- * [saves the new client_id PushChannelSubscription Hash object](./spec/acceptance/rest/push_admin_spec.rb#L733)
2463
- * [saves the new device_id PushChannelSubscription Hash object](./spec/acceptance/rest/push_admin_spec.rb#L744)
2464
- * [saves the client_id PushChannelSubscription object](./spec/acceptance/rest/push_admin_spec.rb#L755)
2465
- * [saves the device_id PushChannelSubscription object](./spec/acceptance/rest/push_admin_spec.rb#L766)
2466
- * [allows arbitrary number of subsequent saves](./spec/acceptance/rest/push_admin_spec.rb#L777)
2467
- * [fails if data is invalid](./spec/acceptance/rest/push_admin_spec.rb#L790)
2500
+ * [saves the new client_id PushChannelSubscription Hash object](./spec/acceptance/rest/push_admin_spec.rb#L759)
2501
+ * [saves the new device_id PushChannelSubscription Hash object](./spec/acceptance/rest/push_admin_spec.rb#L770)
2502
+ * [saves the client_id PushChannelSubscription object](./spec/acceptance/rest/push_admin_spec.rb#L781)
2503
+ * [saves the device_id PushChannelSubscription object](./spec/acceptance/rest/push_admin_spec.rb#L792)
2504
+ * [allows arbitrary number of subsequent saves](./spec/acceptance/rest/push_admin_spec.rb#L803)
2505
+ * [fails if data is invalid](./spec/acceptance/rest/push_admin_spec.rb#L816)
2468
2506
  * #remove_where (#RSH1c5)
2469
- * PENDING: *[removes matching channels](./spec/acceptance/rest/push_admin_spec.rb#L817)*
2470
- * [removes matching client_ids](./spec/acceptance/rest/push_admin_spec.rb#L825)
2471
- * [removes matching device_ids](./spec/acceptance/rest/push_admin_spec.rb#L831)
2472
- * [device_id and client_id filters in the same request are not suppoorted](./spec/acceptance/rest/push_admin_spec.rb#L837)
2473
- * [succeeds on no match](./spec/acceptance/rest/push_admin_spec.rb#L841)
2507
+ * PENDING: *[removes matching channels](./spec/acceptance/rest/push_admin_spec.rb#L851)*
2508
+ * [removes matching client_ids](./spec/acceptance/rest/push_admin_spec.rb#L859)
2509
+ * [removes matching device_ids](./spec/acceptance/rest/push_admin_spec.rb#L865)
2510
+ * [device_id and client_id filters in the same request are not suppoorted](./spec/acceptance/rest/push_admin_spec.rb#L871)
2511
+ * [succeeds on no match](./spec/acceptance/rest/push_admin_spec.rb#L875)
2474
2512
  * #remove (#RSH1c4)
2475
- * [removes match for Hash object by channel and client_id](./spec/acceptance/rest/push_admin_spec.rb#L865)
2476
- * [removes match for PushChannelSubscription object by channel and client_id](./spec/acceptance/rest/push_admin_spec.rb#L870)
2477
- * [removes match for Hash object by channel and device_id](./spec/acceptance/rest/push_admin_spec.rb#L877)
2478
- * [removes match for PushChannelSubscription object by channel and client_id](./spec/acceptance/rest/push_admin_spec.rb#L882)
2479
- * [succeeds even if there is no match](./spec/acceptance/rest/push_admin_spec.rb#L889)
2513
+ * [removes match for Hash object by channel and client_id](./spec/acceptance/rest/push_admin_spec.rb#L905)
2514
+ * [removes match for PushChannelSubscription object by channel and client_id](./spec/acceptance/rest/push_admin_spec.rb#L910)
2515
+ * [removes match for Hash object by channel and device_id](./spec/acceptance/rest/push_admin_spec.rb#L917)
2516
+ * [removes match for PushChannelSubscription object by channel and client_id](./spec/acceptance/rest/push_admin_spec.rb#L922)
2517
+ * [succeeds even if there is no match](./spec/acceptance/rest/push_admin_spec.rb#L929)
2480
2518
 
2481
2519
  ### Ably::Rest::Push
2482
2520
  _(see [spec/acceptance/rest/push_spec.rb](./spec/acceptance/rest/push_spec.rb))_
@@ -3772,54 +3810,83 @@ _(see [spec/unit/realtime/client_spec.rb](./spec/unit/realtime/client_spec.rb))_
3772
3810
  * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L60)
3773
3811
  * key and key_secret
3774
3812
  * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L68)
3775
- * client_id as only option
3776
- * [requires a valid key](./spec/shared/client_initializer_behaviour.rb#L76)
3777
3813
  * with valid arguments
3778
3814
  * key only
3779
- * [connects to the Ably service](./spec/shared/client_initializer_behaviour.rb#L87)
3780
- * [uses basic auth](./spec/shared/client_initializer_behaviour.rb#L91)
3815
+ * [connects to the Ably service](./spec/shared/client_initializer_behaviour.rb#L79)
3816
+ * [uses basic auth](./spec/shared/client_initializer_behaviour.rb#L83)
3781
3817
  * with a string key instead of options hash
3782
- * [sets the key](./spec/shared/client_initializer_behaviour.rb#L111)
3783
- * [sets the key_name](./spec/shared/client_initializer_behaviour.rb#L115)
3784
- * [sets the key_secret](./spec/shared/client_initializer_behaviour.rb#L119)
3785
- * [uses basic auth](./spec/shared/client_initializer_behaviour.rb#L123)
3818
+ * [sets the key](./spec/shared/client_initializer_behaviour.rb#L103)
3819
+ * [sets the key_name](./spec/shared/client_initializer_behaviour.rb#L107)
3820
+ * [sets the key_secret](./spec/shared/client_initializer_behaviour.rb#L111)
3821
+ * [uses basic auth](./spec/shared/client_initializer_behaviour.rb#L115)
3786
3822
  * with a string token key instead of options hash
3787
- * [sets the token](./spec/shared/client_initializer_behaviour.rb#L135)
3823
+ * [sets the token](./spec/shared/client_initializer_behaviour.rb#L127)
3788
3824
  * with token
3789
- * [sets the token](./spec/shared/client_initializer_behaviour.rb#L143)
3825
+ * [sets the token](./spec/shared/client_initializer_behaviour.rb#L135)
3790
3826
  * with token_details
3791
- * [sets the token](./spec/shared/client_initializer_behaviour.rb#L151)
3827
+ * [sets the token](./spec/shared/client_initializer_behaviour.rb#L143)
3792
3828
  * with token_params
3793
- * [configures default_token_params](./spec/shared/client_initializer_behaviour.rb#L159)
3829
+ * [configures default_token_params](./spec/shared/client_initializer_behaviour.rb#L151)
3794
3830
  * endpoint
3795
- * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L170)
3831
+ * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L162)
3796
3832
  * with environment option
3797
- * [uses an alternate endpoint](./spec/shared/client_initializer_behaviour.rb#L177)
3833
+ * [uses an alternate endpoint](./spec/shared/client_initializer_behaviour.rb#L169)
3798
3834
  * with rest_host option
3799
- * PENDING: *[uses an alternate endpoint for REST clients](./spec/shared/client_initializer_behaviour.rb#L185)*
3835
+ * PENDING: *[uses an alternate endpoint for REST clients](./spec/shared/client_initializer_behaviour.rb#L177)*
3800
3836
  * with realtime_host option
3801
- * [uses an alternate endpoint for Realtime clients](./spec/shared/client_initializer_behaviour.rb#L194)
3837
+ * [uses an alternate endpoint for Realtime clients](./spec/shared/client_initializer_behaviour.rb#L186)
3802
3838
  * with port option and non-TLS connections
3803
- * [uses the custom port for non-TLS requests](./spec/shared/client_initializer_behaviour.rb#L203)
3839
+ * [uses the custom port for non-TLS requests](./spec/shared/client_initializer_behaviour.rb#L195)
3804
3840
  * with tls_port option and a TLS connection
3805
- * [uses the custom port for TLS requests](./spec/shared/client_initializer_behaviour.rb#L211)
3841
+ * [uses the custom port for TLS requests](./spec/shared/client_initializer_behaviour.rb#L203)
3806
3842
  * tls
3807
- * [defaults to TLS](./spec/shared/client_initializer_behaviour.rb#L234)
3843
+ * [defaults to TLS](./spec/shared/client_initializer_behaviour.rb#L226)
3808
3844
  * set to false
3809
- * [uses plain text](./spec/shared/client_initializer_behaviour.rb#L225)
3810
- * [uses HTTP](./spec/shared/client_initializer_behaviour.rb#L229)
3845
+ * [uses plain text](./spec/shared/client_initializer_behaviour.rb#L217)
3846
+ * [uses HTTP](./spec/shared/client_initializer_behaviour.rb#L221)
3811
3847
  * logger
3812
3848
  * default
3813
- * [uses Ruby Logger](./spec/shared/client_initializer_behaviour.rb#L245)
3814
- * [specifies Logger::WARN log level](./spec/shared/client_initializer_behaviour.rb#L249)
3849
+ * [uses Ruby Logger](./spec/shared/client_initializer_behaviour.rb#L237)
3850
+ * [specifies Logger::WARN log level](./spec/shared/client_initializer_behaviour.rb#L241)
3815
3851
  * with log_level :none
3816
- * [silences all logging with a NilLogger](./spec/shared/client_initializer_behaviour.rb#L257)
3852
+ * [silences all logging with a NilLogger](./spec/shared/client_initializer_behaviour.rb#L249)
3817
3853
  * with custom logger and log_level
3818
- * [uses the custom logger](./spec/shared/client_initializer_behaviour.rb#L267)
3819
- * [sets the custom log level](./spec/shared/client_initializer_behaviour.rb#L271)
3854
+ * [uses the custom logger](./spec/shared/client_initializer_behaviour.rb#L259)
3855
+ * [sets the custom log level](./spec/shared/client_initializer_behaviour.rb#L263)
3856
+ * environment
3857
+ * when set without custom fallback hosts configured
3858
+ * [sets the environment attribute](./spec/shared/client_initializer_behaviour.rb#L275)
3859
+ * [uses the default fallback hosts (#TBC, see https://github.com/ably/wiki/issues/361)](./spec/shared/client_initializer_behaviour.rb#L279)
3860
+ * when set with custom fallback hosts configured
3861
+ * [sets the environment attribute](./spec/shared/client_initializer_behaviour.rb#L289)
3862
+ * [uses the custom provided fallback hosts (#RSC15a)](./spec/shared/client_initializer_behaviour.rb#L293)
3863
+ * when set with fallback_hosts_use_default
3864
+ * [sets the environment attribute](./spec/shared/client_initializer_behaviour.rb#L304)
3865
+ * [uses the production default fallback hosts (#RTN17b)](./spec/shared/client_initializer_behaviour.rb#L308)
3866
+ * rest_host
3867
+ * when set without custom fallback hosts configured
3868
+ * [sets the custom_host attribute](./spec/shared/client_initializer_behaviour.rb#L319)
3869
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L323)
3870
+ * when set with environment and without custom fallback hosts configured
3871
+ * [sets the environment attribute](./spec/shared/client_initializer_behaviour.rb#L333)
3872
+ * [sets the custom_host attribute](./spec/shared/client_initializer_behaviour.rb#L337)
3873
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L341)
3874
+ * when set with custom fallback hosts configured
3875
+ * [sets the custom_host attribute](./spec/shared/client_initializer_behaviour.rb#L351)
3876
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L355)
3877
+ * realtime_host
3878
+ * when set without custom fallback hosts configured
3879
+ * [sets the realtime_host option](./spec/shared/client_initializer_behaviour.rb#L368)
3880
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L372)
3881
+ * custom port
3882
+ * when set without custom fallback hosts configured
3883
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L383)
3884
+ * custom TLS port
3885
+ * when set without custom fallback hosts configured
3886
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L394)
3820
3887
  * delegators
3821
- * [delegates :client_id to .auth](./spec/shared/client_initializer_behaviour.rb#L285)
3822
- * [delegates :auth_options to .auth](./spec/shared/client_initializer_behaviour.rb#L290)
3888
+ * [delegates :client_id to .auth](./spec/shared/client_initializer_behaviour.rb#L408)
3889
+ * [delegates :auth_options to .auth](./spec/shared/client_initializer_behaviour.rb#L413)
3823
3890
  * delegation to the REST Client
3824
3891
  * [passes on the options to the initializer](./spec/unit/realtime/client_spec.rb#L15)
3825
3892
  * for attribute
@@ -3827,9 +3894,11 @@ _(see [spec/unit/realtime/client_spec.rb](./spec/unit/realtime/client_spec.rb))_
3827
3894
  * [#use_tls?](./spec/unit/realtime/client_spec.rb#L23)
3828
3895
  * [#log_level](./spec/unit/realtime/client_spec.rb#L23)
3829
3896
  * [#custom_host](./spec/unit/realtime/client_spec.rb#L23)
3897
+ * when :transport_params option is passed
3898
+ * [converts options to strings](./spec/unit/realtime/client_spec.rb#L39)
3830
3899
  * push
3831
- * [#device is not supported and raises an exception](./spec/unit/realtime/client_spec.rb#L34)
3832
- * [#push returns a Push object](./spec/unit/realtime/client_spec.rb#L38)
3900
+ * [#device is not supported and raises an exception](./spec/unit/realtime/client_spec.rb#L47)
3901
+ * [#push returns a Push object](./spec/unit/realtime/client_spec.rb#L51)
3833
3902
 
3834
3903
  ### Ably::Realtime::Connection
3835
3904
  _(see [spec/unit/realtime/connection_spec.rb](./spec/unit/realtime/connection_spec.rb))_
@@ -3980,54 +4049,83 @@ _(see [spec/unit/rest/client_spec.rb](./spec/unit/rest/client_spec.rb))_
3980
4049
  * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L60)
3981
4050
  * key and key_secret
3982
4051
  * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L68)
3983
- * client_id as only option
3984
- * [requires a valid key](./spec/shared/client_initializer_behaviour.rb#L76)
3985
4052
  * with valid arguments
3986
4053
  * key only
3987
- * [connects to the Ably service](./spec/shared/client_initializer_behaviour.rb#L87)
3988
- * [uses basic auth](./spec/shared/client_initializer_behaviour.rb#L91)
4054
+ * [connects to the Ably service](./spec/shared/client_initializer_behaviour.rb#L79)
4055
+ * [uses basic auth](./spec/shared/client_initializer_behaviour.rb#L83)
3989
4056
  * with a string key instead of options hash
3990
- * [sets the key](./spec/shared/client_initializer_behaviour.rb#L111)
3991
- * [sets the key_name](./spec/shared/client_initializer_behaviour.rb#L115)
3992
- * [sets the key_secret](./spec/shared/client_initializer_behaviour.rb#L119)
3993
- * [uses basic auth](./spec/shared/client_initializer_behaviour.rb#L123)
4057
+ * [sets the key](./spec/shared/client_initializer_behaviour.rb#L103)
4058
+ * [sets the key_name](./spec/shared/client_initializer_behaviour.rb#L107)
4059
+ * [sets the key_secret](./spec/shared/client_initializer_behaviour.rb#L111)
4060
+ * [uses basic auth](./spec/shared/client_initializer_behaviour.rb#L115)
3994
4061
  * with a string token key instead of options hash
3995
- * [sets the token](./spec/shared/client_initializer_behaviour.rb#L135)
4062
+ * [sets the token](./spec/shared/client_initializer_behaviour.rb#L127)
3996
4063
  * with token
3997
- * [sets the token](./spec/shared/client_initializer_behaviour.rb#L143)
4064
+ * [sets the token](./spec/shared/client_initializer_behaviour.rb#L135)
3998
4065
  * with token_details
3999
- * [sets the token](./spec/shared/client_initializer_behaviour.rb#L151)
4066
+ * [sets the token](./spec/shared/client_initializer_behaviour.rb#L143)
4000
4067
  * with token_params
4001
- * [configures default_token_params](./spec/shared/client_initializer_behaviour.rb#L159)
4068
+ * [configures default_token_params](./spec/shared/client_initializer_behaviour.rb#L151)
4002
4069
  * endpoint
4003
- * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L170)
4070
+ * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L162)
4004
4071
  * with environment option
4005
- * [uses an alternate endpoint](./spec/shared/client_initializer_behaviour.rb#L177)
4072
+ * [uses an alternate endpoint](./spec/shared/client_initializer_behaviour.rb#L169)
4006
4073
  * with rest_host option
4007
- * [uses an alternate endpoint for REST clients](./spec/shared/client_initializer_behaviour.rb#L185)
4074
+ * [uses an alternate endpoint for REST clients](./spec/shared/client_initializer_behaviour.rb#L177)
4008
4075
  * with realtime_host option
4009
- * PENDING: *[uses an alternate endpoint for Realtime clients](./spec/shared/client_initializer_behaviour.rb#L194)*
4076
+ * PENDING: *[uses an alternate endpoint for Realtime clients](./spec/shared/client_initializer_behaviour.rb#L186)*
4010
4077
  * with port option and non-TLS connections
4011
- * [uses the custom port for non-TLS requests](./spec/shared/client_initializer_behaviour.rb#L203)
4078
+ * [uses the custom port for non-TLS requests](./spec/shared/client_initializer_behaviour.rb#L195)
4012
4079
  * with tls_port option and a TLS connection
4013
- * [uses the custom port for TLS requests](./spec/shared/client_initializer_behaviour.rb#L211)
4080
+ * [uses the custom port for TLS requests](./spec/shared/client_initializer_behaviour.rb#L203)
4014
4081
  * tls
4015
- * [defaults to TLS](./spec/shared/client_initializer_behaviour.rb#L234)
4082
+ * [defaults to TLS](./spec/shared/client_initializer_behaviour.rb#L226)
4016
4083
  * set to false
4017
- * [uses plain text](./spec/shared/client_initializer_behaviour.rb#L225)
4018
- * [uses HTTP](./spec/shared/client_initializer_behaviour.rb#L229)
4084
+ * [uses plain text](./spec/shared/client_initializer_behaviour.rb#L217)
4085
+ * [uses HTTP](./spec/shared/client_initializer_behaviour.rb#L221)
4019
4086
  * logger
4020
4087
  * default
4021
- * [uses Ruby Logger](./spec/shared/client_initializer_behaviour.rb#L245)
4022
- * [specifies Logger::WARN log level](./spec/shared/client_initializer_behaviour.rb#L249)
4088
+ * [uses Ruby Logger](./spec/shared/client_initializer_behaviour.rb#L237)
4089
+ * [specifies Logger::WARN log level](./spec/shared/client_initializer_behaviour.rb#L241)
4023
4090
  * with log_level :none
4024
- * [silences all logging with a NilLogger](./spec/shared/client_initializer_behaviour.rb#L257)
4091
+ * [silences all logging with a NilLogger](./spec/shared/client_initializer_behaviour.rb#L249)
4025
4092
  * with custom logger and log_level
4026
- * [uses the custom logger](./spec/shared/client_initializer_behaviour.rb#L267)
4027
- * [sets the custom log level](./spec/shared/client_initializer_behaviour.rb#L271)
4093
+ * [uses the custom logger](./spec/shared/client_initializer_behaviour.rb#L259)
4094
+ * [sets the custom log level](./spec/shared/client_initializer_behaviour.rb#L263)
4095
+ * environment
4096
+ * when set without custom fallback hosts configured
4097
+ * [sets the environment attribute](./spec/shared/client_initializer_behaviour.rb#L275)
4098
+ * [uses the default fallback hosts (#TBC, see https://github.com/ably/wiki/issues/361)](./spec/shared/client_initializer_behaviour.rb#L279)
4099
+ * when set with custom fallback hosts configured
4100
+ * [sets the environment attribute](./spec/shared/client_initializer_behaviour.rb#L289)
4101
+ * [uses the custom provided fallback hosts (#RSC15a)](./spec/shared/client_initializer_behaviour.rb#L293)
4102
+ * when set with fallback_hosts_use_default
4103
+ * [sets the environment attribute](./spec/shared/client_initializer_behaviour.rb#L304)
4104
+ * [uses the production default fallback hosts (#RTN17b)](./spec/shared/client_initializer_behaviour.rb#L308)
4105
+ * rest_host
4106
+ * when set without custom fallback hosts configured
4107
+ * [sets the custom_host attribute](./spec/shared/client_initializer_behaviour.rb#L319)
4108
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L323)
4109
+ * when set with environment and without custom fallback hosts configured
4110
+ * [sets the environment attribute](./spec/shared/client_initializer_behaviour.rb#L333)
4111
+ * [sets the custom_host attribute](./spec/shared/client_initializer_behaviour.rb#L337)
4112
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L341)
4113
+ * when set with custom fallback hosts configured
4114
+ * [sets the custom_host attribute](./spec/shared/client_initializer_behaviour.rb#L351)
4115
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L355)
4116
+ * realtime_host
4117
+ * when set without custom fallback hosts configured
4118
+ * [sets the realtime_host option](./spec/shared/client_initializer_behaviour.rb#L368)
4119
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L372)
4120
+ * custom port
4121
+ * when set without custom fallback hosts configured
4122
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L383)
4123
+ * custom TLS port
4124
+ * when set without custom fallback hosts configured
4125
+ * [has no default fallback hosts](./spec/shared/client_initializer_behaviour.rb#L394)
4028
4126
  * delegators
4029
- * [delegates :client_id to .auth](./spec/shared/client_initializer_behaviour.rb#L285)
4030
- * [delegates :auth_options to .auth](./spec/shared/client_initializer_behaviour.rb#L290)
4127
+ * [delegates :client_id to .auth](./spec/shared/client_initializer_behaviour.rb#L408)
4128
+ * [delegates :auth_options to .auth](./spec/shared/client_initializer_behaviour.rb#L413)
4031
4129
  * initializer options
4032
4130
  * TLS
4033
4131
  * disabled
@@ -4115,6 +4213,6 @@ _(see [spec/unit/util/pub_sub_spec.rb](./spec/unit/util/pub_sub_spec.rb))_
4115
4213
 
4116
4214
  ## Test summary
4117
4215
 
4118
- * Passing tests: 2045
4119
- * Pending tests: 19
4120
- * Failing tests: 2
4216
+ * Passing tests: 2109
4217
+ * Pending tests: 5
4218
+ * Failing tests: 1