Skip to content

Commit 27b464f

Browse files
committed
Merge remote-tracking branch 'origin/main' into liveobjects/noop-diffs-and-empty-synthetic-list
2 parents 9490a18 + 5149a7c commit 27b464f

51 files changed

Lines changed: 929 additions & 193 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/bundle-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1
3333
with:
3434
aws-region: eu-west-2
35-
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-ably-js
35+
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-ably-pubsub-js
3636
role-session-name: '${{ github.run_id }}-${{ github.run_number }}'
3737
- uses: ably/sdk-upload-action@8c6179796fc7ee8fc9bb28d5223ffef005b985cc # v1
3838
with:

.github/workflows/check.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ jobs:
2828
- run: npm run lint
2929
- run: npm run format:check
3030
- run: npx tsc --noEmit ably.d.ts modular.d.ts
31+
# Redundant today: `npm ci` above runs `prepare`, which builds `webpack:all`, and its
32+
# ts-loader already typechecks this same tsconfig program - so a type error fails that
33+
# step first. Kept explicit so the guarantee does not rest on that incidental side
34+
# effect: adding `transpileOnly` or dropping the webpack bundles would silently remove
35+
# it, and nothing would tell us.
36+
- run: npx tsc --noEmit -p tsconfig.json
37+
# The error-code union is generated from the ably-common submodule at its pinned
38+
# commit; fail if the committed copy has drifted from the registry.
39+
- run: npm run generate:errorcodes-ts
40+
- run: git diff --exit-code -- src/common/lib/types/errorcodes.ts
3141
# for some reason, this doesn't work in CI using `npx attw --pack .`
3242
- run: npm pack
3343
- run: npx attw ably-$(node -e "console.log(require('./package.json').version)").tgz --summary --exclude-entrypoints 'ably/modular'

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1
6161
with:
6262
aws-region: eu-west-2
63-
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-ably-js
63+
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-ably-pubsub-js
6464
role-session-name: '${{ github.run_id }}-${{ github.run_number }}'
6565

6666
- name: Upload Documentation

.github/workflows/features.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
id-token: write
1515
uses: ably/features/.github/workflows/sdk-features.yml@6b3fc7a8ede2ebdd7a6325314f3a96c6466f1453 # main
1616
with:
17-
repository-name: ably-js
17+
repository-name: ably-pubsub-js
1818
secrets:
1919
ABLY_AWS_ACCOUNT_ID_SDK: ${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DS_Store
2-
ably-js.iml
2+
ably-pubsub-js.iml
33
.idea
44
node_modules
55
npm-debug.log

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
test/common/ably-common/
2+
3+
# Generated by `npm run generate:errorcodes-ts`; the generator is the only thing that
4+
# should change it, and CI diffs it against the registry.
5+
src/common/lib/types/errorcodes.ts

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
This contains only the most important and/or user-facing changes; for a full changelog, see the commit history.
44

5+
## [2.28.0](https://github.com/ably/ably-js/tree/2.28.0) (2026-08-21)
6+
7+
[Full Changelog](https://github.com/ably/ably-js/compare/2.27.0...2.28.0)
8+
9+
### What's Changed
10+
11+
- 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)
12+
13+
## [2.27.0](https://github.com/ably/ably-js/tree/2.27.0) (2026-08-10)
14+
15+
[Full Changelog](https://github.com/ably/ably-js/compare/2.26.0...2.27.0)
16+
17+
### What's Changed
18+
19+
- 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)
24+
525
## [2.26.0](https://github.com/ably/ably-js/tree/2.26.0) (2026-07-22)
626

727
[Full Changelog](https://github.com/ably/ably-js/compare/2.25.0...2.26.0)

CLAUDE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,26 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full test-suite, debugging, and
2222

2323
## Coding Conventions
2424

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+
2545
### Error messages and remediations
2646

2747
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:

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to ably-js
1+
# Contributing to ably-pubsub-js
22

33
## Contributing
44

@@ -7,7 +7,7 @@
77
3. Create your feature branch (`git checkout -b my-new-feature`)
88
4. Commit your changes (`git commit -am 'Add some feature'`)
99
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
1111
7. Push the branch (`git push origin my-new-feature`)
1212
8. Create a new Pull Request
1313

@@ -23,7 +23,7 @@
2323
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>`)
2424
9. Run `npm publish .` (should require OTP) - publishes to NPM
2525
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)
2727
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)
2828

2929
## Building the library
@@ -34,7 +34,7 @@ Since webpack builds are slow, commands are also available to only build the out
3434

3535
## Coding conventions
3636

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).
3838

3939
## Test suite
4040

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![Ably Chat Header](/images/JavaScriptSDK-github.png)
22
[![npm version](https://img.shields.io/npm/v/ably.svg?style=flat)](https://img.shields.io/npm/v/ably.svg?style=flat)
3-
[![License](https://badgen.net/github/license/ably/ably-js)](https://github.com/ably/ably-js/blob/main/LICENSE)
3+
[![License](https://badgen.net/github/license/ably/ably-pubsub-js)](https://github.com/ably/ably-pubsub-js/blob/main/LICENSE)
44

55
---
66

@@ -35,13 +35,13 @@ Ably aims to support a wide range of platforms and all current browser versions,
3535

3636
The following platforms are supported:
3737

38-
| Platform | Support |
39-
| ----------- | ---------------------------------------------------------------------------------------- |
40-
| JavaScript | ES2017 |
41-
| Node.js | See `engines` in [package.json](https://github.com/ably/ably-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. |
38+
| Platform | Support |
39+
| ----------- | ----------------------------------------------------------------------------------------------- |
40+
| JavaScript | ES2017 |
41+
| 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. |
4545

4646
> [!NOTE]
4747
> 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
133133

134134
If you require more verbose logging, use the default variant of the SDK.
135135

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).
137137

138138
</details>
139139

@@ -147,13 +147,13 @@ Read the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines to contribute to Ably.
147147

148148
## Releases
149149

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).
151151

152152
---
153153

154154
## Support, feedback, and troubleshooting
155155

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.
157157

158158
### Chrome extensions
159159

@@ -221,7 +221,7 @@ export default function AblyClientProvider({ children }) {
221221
}
222222
```
223223

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.
225225

226226
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.
227227

0 commit comments

Comments
 (0)