You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Roll out e2e encryption of `data` payloads on annotations. They were previously a message type whose publish path deliberately did not apply the channel's encryption (and were documented accordingly), but the reasons for this no longer apply, so there is no reason now not to enable e2e encryption on annotation payloads. [#2277](https://github.com/ably/ably-js/pull/2277)
- Fall back to the base transport when a proxy rejects the WebSocket handshake outright, rather than reporting `disconnected` after exhausting every host [#2285](https://github.com/ably/ably-js/pull/2285)
20
+
- Move connection resumability decisions from the client to the server: `Connection#id`, `Connection#key` and a channel's `channelSerial` are retained through `SUSPENDED`, and reconnection always attempts a resume. `Connection#createRecoveryKey()` consequently returns a recovery key in `SUSPENDED`, where it previously returned `null`[#2273](https://github.com/ably/ably-js/pull/2273)
21
+
- Fix a resumed attach advancing the channel's attach serial, which broke the contiguity of `untilAttach` history with the realtime message stream [#2276](https://github.com/ably/ably-js/pull/2276)
22
+
- Fix stale presence members surviving when a new presence sync replaces one still in progress [#2261](https://github.com/ably/ably-js/pull/2261)
23
+
- Expand the docstrings on `Auth`, `RealtimeChannel`, `RealtimePresence`, `RealtimeAnnotations` and `RestAnnotations` to cover prerequisites, side effects and failure modes, and link the REST `Channel` and `Presence` members to their reference pages [#2242](https://github.com/ably/ably-js/pull/2242)[#2243](https://github.com/ably/ably-js/pull/2243)[#2244](https://github.com/ably/ably-js/pull/2244)[#2245](https://github.com/ably/ably-js/pull/2245)[#2282](https://github.com/ably/ably-js/pull/2282)
Copy file name to clipboardExpand all lines: CLAUDE.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,26 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full test-suite, debugging, and
22
22
23
23
## Coding Conventions
24
24
25
+
### Error codes
26
+
27
+
`ErrorInfo.code` is typed as `ErrorCode`, a union of every code registered in [ably-common](https://github.com/ably/ably-common/tree/main/errors/codes). It is generated into [errorcodes.ts](./src/common/lib/types/errorcodes.ts) from the pinned `ably-common` submodule and committed. CI regenerates it at that pin and fails on a diff, so never hand-edit it.
28
+
29
+
Pick the registered code whose `identifier` matches the failure, and pair it with the HTTP status that code's registry entry documents. `statusCode` is a plain `number`, so a wrong status still compiles — check it against the registry rather than copying a neighbouring call.
30
+
31
+
If the code you need is not in the union, `tsc` rejects it:
32
+
33
+
```text
34
+
error TS2345: Argument of type '40199' is not assignable to parameter of type 'ErrorCode'.
35
+
```
36
+
37
+
That means the code is not registered. Do not cast around it. Instead:
38
+
39
+
1. Add the code under `errors/codes/` in [ably-common](https://github.com/ably/ably-common) and get that merged.
40
+
2. Bump the `test/common/ably-common` submodule pin here to a commit that contains it.
41
+
3. Run `npm run generate:errorcodes-ts` and commit the regenerated `errorcodes.ts`.
42
+
43
+
Errors decoded from the server are exempt: the server chose the code and may use one this client version does not know about, so build those with `ErrorInfo.fromWireValues` instead of `ErrorInfo.fromValues`.
44
+
25
45
### Error messages and remediations
26
46
27
47
Errors constructed by the SDK (`ErrorInfo` / `PartialErrorInfo`) carry a `message` and, in most cases, a `remediation` (see the `ErrorInfo.remediation` docstring in [ably.d.ts](./ably.d.ts)). The two fields have distinct jobs:
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Contributing to ably-js
1
+
# Contributing to ably-pubsub-js
2
2
3
3
## Contributing
4
4
@@ -7,7 +7,7 @@
7
7
3. Create your feature branch (`git checkout -b my-new-feature`)
8
8
4. Commit your changes (`git commit -am 'Add some feature'`)
9
9
5. Ensure you have added suitable tests and the test suite is passing(`npm test`)
10
-
6. Ensure the [type definitions](https://github.com/ably/ably-js/blob/main/ably.d.ts) have been updated if the public API has changed
10
+
6. Ensure the [type definitions](https://github.com/ably/ably-pubsub-js/blob/main/ably.d.ts) have been updated if the public API has changed
11
11
7. Push the branch (`git push origin my-new-feature`)
12
12
8. Create a new Pull Request
13
13
@@ -23,7 +23,7 @@
23
23
8. Run `git tag <VERSION_NUMBER>` with the new version and push the tag to GitHub with `git push <REMOTE> <VERSION_NUMBER>` (usually `git push origin <VERSION_NUMBER>`)
24
24
9. Run `npm publish .` (should require OTP) - publishes to NPM
25
25
10. Run the GitHub action "Publish to CDN" with the new tag name
26
-
11. Visit https://github.com/ably/ably-js/tags and create a GitHub release based on the new tag (for release notes, you generally can just copy the notes you added to the CHANGELOG)
26
+
11. Visit https://github.com/ably/ably-pubsub-js/tags and create a GitHub release based on the new tag (for release notes, you generally can just copy the notes you added to the CHANGELOG)
27
27
12. Update the [Ably Changelog](https://changelog.ably.com/) (via [headwayapp](https://headwayapp.co/)) with these changes (again, you can just copy the notes you added to the CHANGELOG)
28
28
29
29
## Building the library
@@ -34,7 +34,7 @@ Since webpack builds are slow, commands are also available to only build the out
34
34
35
35
## Coding conventions
36
36
37
-
Coding conventions, including how to write `ErrorInfo` error messages and remediations, are documented in [CLAUDE.md](./CLAUDE.md).
37
+
Coding conventions, including how to choose an `ErrorInfo` error code and how to write error messages and remediations, are documented in [CLAUDE.md](./CLAUDE.md).
| Node.js | See `engines` in [package.json](https://github.com/ably/ably-pubsub-js/blob/main/package.json). |
42
+
| React | >=16.8.x |
43
+
| TypeScript | Type definitions are included in the package. |
44
+
| Web Workers | Browser bundle and [modular](#modular-variant) support. |
45
45
46
46
> [!NOTE]
47
47
> Versions 1.2.x of the SDK support Internet Explorer >=9 and other older browsers, as well as Node.js >=8.17.
@@ -133,7 +133,7 @@ In order to further reduce bundle size, the modular variant of the SDK performs
133
133
134
134
If you require more verbose logging, use the default variant of the SDK.
135
135
136
-
For more information view the [TypeDoc references](https://sdk.ably.com/builds/ably/ably-js/main/typedoc/modules/modular.html).
136
+
For more information view the [TypeDoc references](https://sdk.ably.com/builds/ably/ably-pubsub-js/main/typedoc/modules/modular.html).
137
137
138
138
</details>
139
139
@@ -147,13 +147,13 @@ Read the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines to contribute to Ably.
147
147
148
148
## Releases
149
149
150
-
The [CHANGELOG.md](/ably/ably-js/blob/main/CHANGELOG.md) contains details of the latest releases for this SDK. You can also view all Ably releases on [changelog.ably.com](https://changelog.ably.com).
150
+
The [CHANGELOG.md](/ably/ably-pubsub-js/blob/main/CHANGELOG.md) contains details of the latest releases for this SDK. You can also view all Ably releases on [changelog.ably.com](https://changelog.ably.com).
151
151
152
152
---
153
153
154
154
## Support, feedback, and troubleshooting
155
155
156
-
For help or technical support, visit Ably's [support page](https://ably.com/support) or [GitHub Issues](https://github.com/ably/ably-js-nativescript/issues) for community-reported bugs and discussions.
156
+
For help or technical support, visit Ably's [support page](https://ably.com/support) or [GitHub Issues](https://github.com/ably/ably-pubsub-js/issues) for community-reported bugs and discussions.
157
157
158
158
### Chrome extensions
159
159
@@ -221,7 +221,7 @@ export default function AblyClientProvider({ children }) {
221
221
}
222
222
```
223
223
224
-
Avoid creating the client inside [React](https://github.com/ably/ably-js/blob/main/docs/react.md#Usage) component bodies, as this leads to a new connection on every render. Use the `useEffect` + `useState` pattern shown above, or move the client to a shared provider at the layout level.
224
+
Avoid creating the client inside [React](https://github.com/ably/ably-pubsub-js/blob/main/docs/react.md#Usage) component bodies, as this leads to a new connection on every render. Use the `useEffect` + `useState` pattern shown above, or move the client to a shared provider at the layout level.
225
225
226
226
In development environments that use Hot Module Replacement (HMR), such as React, Vite, or Next.js, saving a file can recreate the Ably.Realtime client, while previous instances remain connected. Over time, this leads to a growing number of active connections with each code edit. To fix: Move the client to a separate file (e.g., `ably-client.js`) and import it. This ensures the client is recreated only when that file changes.
0 commit comments