From 8fd491adc569b31ae32f1f63cbf9c4c105bbd24e Mon Sep 17 00:00:00 2001 From: Lawrence Forooghian Date: Tue, 15 Apr 2025 17:28:19 -0300 Subject: [PATCH 1/7] Fix realtime annotation subscribe signature Mistake in 6d7a37b. --- ably.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ably.d.ts b/ably.d.ts index c3bdb4150f..7578cfe257 100644 --- a/ably.d.ts +++ b/ably.d.ts @@ -2055,7 +2055,7 @@ export declare interface RealtimeAnnotations { * @param listener - An event listener function. * @returns A promise which resolves upon success of the channel {@link RealtimeChannel.attach | `attach()`} operation and rejects with an {@link ErrorInfo} object upon its failure. */ - subscribe(type: string | Array, listener?: messageCallback): Promise; + subscribe(type: string | Array, listener?: messageCallback): Promise; /** * Registers a listener that is called each time an {@link Annotation} is received on the channel. * Note that if you want to receive individual realtime annotations (instead of just the rolled-up summaries), you will need to request the annotation_subscribe ChannelMode in ChannelOptions, since they are not delivered by default. In general, most clients will not bother with subscribing to individual annotations, and will instead just look at the summary updates. From 1e60821745564ba03f52ced80b58085399a801aa Mon Sep 17 00:00:00 2001 From: Simon Woolf Date: Wed, 16 Apr 2025 10:03:14 +0100 Subject: [PATCH 2/7] Annotation: add a couple of new fields Missed from the initial pr due to late-stage redesign. Doesn't actually fix any bug since it's essentially just internal typings for fields that no internal code touches right now, but they should still be there for the benefit of maintainers --- src/common/lib/types/annotation.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/lib/types/annotation.ts b/src/common/lib/types/annotation.ts index a01ad8262c..1429f73ec8 100644 --- a/src/common/lib/types/annotation.ts +++ b/src/common/lib/types/annotation.ts @@ -59,6 +59,8 @@ class Annotation extends BaseMessage { serial?: string; messageSerial?: string; type?: string; + name?: string; + count?: number; async encode(): Promise { const res = Object.assign(new WireAnnotation(), this, { @@ -87,6 +89,8 @@ export class WireAnnotation extends BaseMessage { serial?: string; messageSerial?: string; type?: string; + name?: string; + count?: number; toJSON(...args: any[]) { return wireToJSON.call(this, ...args); From 12ecb5967dff7f7bd64a96dcf42991fa4d0af511 Mon Sep 17 00:00:00 2001 From: Andrew Bulat Date: Thu, 17 Apr 2025 02:32:52 +0100 Subject: [PATCH 3/7] Add ANNOTATION_* channel modes to ResolvedChannelMode This was missed in 7d989577aeeea4675b943d50a0a63d6fc0d0c10a --- ably.d.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ably.d.ts b/ably.d.ts index 7578cfe257..8a642f8b67 100644 --- a/ably.d.ts +++ b/ably.d.ts @@ -902,7 +902,7 @@ declare namespace ResolvedChannelModes { */ type PUBLISH = 'publish'; /** - * The client can subscribe to messages. + * The client will receive messages. */ type SUBSCRIBE = 'subscribe'; /** @@ -910,9 +910,17 @@ declare namespace ResolvedChannelModes { */ type PRESENCE = 'presence'; /** - * The client can receive presence messages. + * The client will receive presence messages. */ type PRESENCE_SUBSCRIBE = 'presence_subscribe'; + /** + * The client can publish annotations + */ + type ANNOTATION_PUBLISH = 'annotation_publish'; + /** + * The client will receive annotations + */ + type ANNOTATION_SUBSCRIBE = 'annotation_subscribe'; } /** @@ -926,7 +934,9 @@ export type ResolvedChannelMode = | ResolvedChannelModes.PUBLISH | ResolvedChannelModes.SUBSCRIBE | ResolvedChannelModes.PRESENCE - | ResolvedChannelModes.PRESENCE_SUBSCRIBE; + | ResolvedChannelModes.PRESENCE_SUBSCRIBE + | ResolvedChannelModes.ANNOTATION_PUBLISH + | ResolvedChannelModes.ANNOTATION_SUBSCRIBE; /** * Passes additional properties to a {@link Channel} or {@link RealtimeChannel} object, such as encryption, {@link ChannelMode} and channel parameters. From b6a1195b017286026254ae2be964b8f65229262b Mon Sep 17 00:00:00 2001 From: Vlad Velici Date: Tue, 15 Apr 2025 15:32:16 +0100 Subject: [PATCH 4/7] chore: bump version for 2.7.0 release --- package-lock.json | 4 ++-- package.json | 2 +- src/platform/react-hooks/src/AblyReactHooks.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 843da2d4c3..362c1568bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ably", - "version": "2.6.5", + "version": "2.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ably", - "version": "2.6.5", + "version": "2.7.0", "license": "Apache-2.0", "dependencies": { "@ably/msgpack-js": "^0.4.0", diff --git a/package.json b/package.json index f836220314..b28cb26050 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ably", "description": "Realtime client library for Ably, the realtime messaging service", - "version": "2.6.5", + "version": "2.7.0", "license": "Apache-2.0", "bugs": { "url": "https://github.com/ably/ably-js/issues", diff --git a/src/platform/react-hooks/src/AblyReactHooks.ts b/src/platform/react-hooks/src/AblyReactHooks.ts index fe0f8266df..49c6d23fa2 100644 --- a/src/platform/react-hooks/src/AblyReactHooks.ts +++ b/src/platform/react-hooks/src/AblyReactHooks.ts @@ -12,7 +12,7 @@ export type ChannelNameAndOptions = { export type ChannelNameAndAblyId = Pick; export type ChannelParameters = string | ChannelNameAndOptions; -export const version = '2.6.5'; +export const version = '2.7.0'; /** * channel options for react-hooks From 820765f798f6f2865b9be84aa56fd017aaa27b5e Mon Sep 17 00:00:00 2001 From: Vlad Velici Date: Tue, 15 Apr 2025 15:32:33 +0100 Subject: [PATCH 5/7] chore: update changelog for 2.7.0 release --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8301ef64ac..86eb8d46b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ This contains only the most important and/or user-facing changes; for a full changelog, see the commit history. +## [2.7.0](https://github.com/ably/ably-js/tree/2.7.0) (2025-04-17) + +- Adds `ANNOTATION_PUBLISH` and `ANNOTATION_SUBSCRIBE` channel modes. +- Adds support for message annotations via `channel.annotations`. +- The message action `meta.occupancy` is now renamed to `meta`. Similarly, `MessageActions.META` is now `MessageActions.META`. + ## [2.6.5](https://github.com/ably/ably-js/tree/2.6.5) (2025-03-24) - Fixed type issue in `PublishOptions` [\#1988](https://github.com/ably/ably-js/pull/1988) From 731ea06a3ba96c19292facdff1c9e683cb431434 Mon Sep 17 00:00:00 2001 From: owenpearson Date: Tue, 15 Apr 2025 15:39:04 +0100 Subject: [PATCH 6/7] docs: add web-push `deactivate` fixes to changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86eb8d46b7..2e8cc6d992 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ This contains only the most important and/or user-facing changes; for a full cha - Adds `ANNOTATION_PUBLISH` and `ANNOTATION_SUBSCRIBE` channel modes. - Adds support for message annotations via `channel.annotations`. - The message action `meta.occupancy` is now renamed to `meta`. Similarly, `MessageActions.META` is now `MessageActions.META`. +- Fixes a bug where `deactivate` would not use device auth, meaning clients would only be able to use it with the `push-admin` capability. +- The push `deactivate` method's callback type is now optional when using TypeScript. ## [2.6.5](https://github.com/ably/ably-js/tree/2.6.5) (2025-03-24) From bd7510daf103f0c57c40d9c0b2a4e25843b2e70f Mon Sep 17 00:00:00 2001 From: Vlad Velici Date: Tue, 15 Apr 2025 20:16:11 +0100 Subject: [PATCH 7/7] chore: add links to PRs in changelog for v2.7.0 --- CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e8cc6d992..d114510439 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,11 @@ This contains only the most important and/or user-facing changes; for a full cha ## [2.7.0](https://github.com/ably/ably-js/tree/2.7.0) (2025-04-17) -- Adds `ANNOTATION_PUBLISH` and `ANNOTATION_SUBSCRIBE` channel modes. -- Adds support for message annotations via `channel.annotations`. -- The message action `meta.occupancy` is now renamed to `meta`. Similarly, `MessageActions.META` is now `MessageActions.META`. -- Fixes a bug where `deactivate` would not use device auth, meaning clients would only be able to use it with the `push-admin` capability. -- The push `deactivate` method's callback type is now optional when using TypeScript. +- Adds `ANNOTATION_PUBLISH` and `ANNOTATION_SUBSCRIBE` channel modes [\#1953](https://github.com/ably/ably-js/pull/1953) +- Adds support for message annotations via `channel.annotations` [\#1953](https://github.com/ably/ably-js/pull/1953) +- The message action `meta.occupancy` is now renamed to `meta`. Similarly, `MessageActions.META` is now `MessageActions.META` [\#1953](https://github.com/ably/ably-js/pull/1953) +- Fixes a bug where `deactivate` would not use device auth, meaning clients would only be able to use it with the `push-admin` capability [\#2000](https://github.com/ably/ably-js/pull/2000) +- The push `deactivate` method's callback type is now optional when using TypeScript [\#2000](https://github.com/ably/ably-js/pull/2000) ## [2.6.5](https://github.com/ably/ably-js/tree/2.6.5) (2025-03-24)