Skip to content

Commit 97f56a1

Browse files
umair-ablyclaude
andcommitted
DX-1211: promote fact-bearing parentheticals in RealtimePresence docstrings to sentences; single @see on history()
Aligns presence get/subscribe mode wording with the reviewed RealtimeChannel form, and moves the storage concept inline onto the persistence-rule prerequisite per the single-link convention. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 337288a commit 97f56a1

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

ably.d.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,13 +2154,13 @@ export declare interface Presence {
21542154
*/
21552155
export declare interface RealtimePresence {
21562156
/**
2157-
* Indicates whether the presence set synchronization between Ably and the clients on the channel has been completed. Set to `true` when the sync is complete, and back to `false` whenever a new sync starts (typically after a (re)attach). The value is also `true` after the local presence set is cleared (when the channel becomes detached or failed, or attaches without the server reporting any presence members), so it indicates only that no sync is in progress (though it is initially `false`, before any sync has started), not that the channel is attached or that a sync ever ran. To wait for an in-progress sync, call {@link RealtimePresence.get | `get()`}, which by default resolves only once the sync completes.
2157+
* Indicates whether the presence set synchronization between Ably and the clients on the channel has been completed. Set to `true` when the sync is complete, and back to `false` whenever a new sync starts, typically after a re-attach. The value is initially `false`, before any sync has started. It is also `true` after the local presence set is cleared, which happens when the channel becomes detached or failed, or attaches without the server reporting any presence members. It therefore indicates only that no sync is in progress, not that the channel is attached or that a sync ever ran. To wait for an in-progress sync, call {@link RealtimePresence.get | `get()`}, which by default resolves only once the sync completes.
21582158
*
21592159
* @see https://ably.com/docs/pub-sub/api/javascript/realtime/realtime-presence#sync-complete
21602160
*/
21612161
syncComplete: boolean;
21622162
/**
2163-
* Deregisters a specific listener that is registered to receive {@link PresenceMessage} on the channel for a given {@link PresenceAction}. This only removes the local listener; it does not detach the channel or remove this client from the presence set (use {@link RealtimePresence.leave | `leave()`} for that), and presence events may continue to arrive for any other registered listeners.
2163+
* Deregisters a specific listener that is registered to receive {@link PresenceMessage} on the channel for a given {@link PresenceAction}. This only removes the local listener. It does not detach the channel or remove this client from the presence set, and presence events may continue to arrive for any other registered listeners. To leave the presence set, call {@link RealtimePresence.leave | `leave()`}.
21642164
*
21652165
* @param presence - A specific {@link PresenceAction} to deregister the listener for.
21662166
* @param listener - An event listener function.
@@ -2208,7 +2208,7 @@ export declare interface RealtimePresence {
22082208
unsubscribe(): void;
22092209

22102210
/**
2211-
* Retrieves the current members present on the channel and the metadata for each member, such as their {@link PresenceAction} and ID. Implicitly attaches the channel if it is not already attached. Requires the `presence_subscribe` mode (granted by default unless {@link ChannelOptions.modes} excludes it); without it the call resolves with an empty array rather than rejecting (or it rejects with a hinted {@link ErrorInfo} when {@link ClientOptions.strictMode} is enabled).
2211+
* Retrieves the current members present on the channel and the metadata for each member, such as their {@link PresenceAction} and ID. Implicitly attaches the channel if it is not already attached. Requires the `presence_subscribe` mode. Without it the call resolves with an empty array rather than rejecting. When {@link ClientOptions.strictMode} is enabled, it instead rejects with a hinted {@link ErrorInfo}.
22122212
*
22132213
* @param params - A set of parameters which are used to specify which presence members should be retrieved.
22142214
* @returns A promise which, upon success, will be fulfilled with an array of {@link PresenceMessage} objects. Upon failure, the promise will be rejected with an {@link ErrorInfo} object which explains the error.
@@ -2234,7 +2234,7 @@ export declare interface RealtimePresence {
22342234
*/
22352235
get(params: RealtimePresenceParams | null, callback: StandardCallback<PresenceMessage[]>): void;
22362236
/**
2237-
* Retrieves a {@link PaginatedResult} object, containing an array of historical {@link PresenceMessage} objects for the channel. Presence messages are retrievable for up to 72 hours in the past when message persistence is enabled for the channel by a channel rule; without it, only presence messages from the last two minutes, the service's default retention, are returned.
2237+
* Retrieves a {@link PaginatedResult} object, containing an array of historical {@link PresenceMessage} objects for the channel. Presence messages are retrievable for up to 72 hours in the past when message persistence is enabled for the channel by a [rule](https://ably.com/docs/channels#rules). If message persistence is not enabled, only presence messages from the last two minutes are returned.
22382238
*
22392239
* @param params - A set of parameters which are used to specify which presence messages should be retrieved.
22402240
* @returns A promise which, upon success, will be fulfilled with a {@link PaginatedResult} object containing an array of {@link PresenceMessage} objects. Upon failure, the promise will be rejected with an {@link ErrorInfo} object which explains the error.
@@ -2243,7 +2243,6 @@ export declare interface RealtimePresence {
22432243
* const result = await channel.presence.history();
22442244
* ```
22452245
* @see https://ably.com/docs/pub-sub/api/javascript/realtime/realtime-presence#history
2246-
* @see https://ably.com/docs/storage-history/storage
22472246
*/
22482247
history(params?: RealtimeHistoryParams): Promise<PaginatedResult<PresenceMessage>>;
22492248
/**
@@ -2261,7 +2260,7 @@ export declare interface RealtimePresence {
22612260
*/
22622261
history(params: RealtimeHistoryParams | null, callback: StandardCallback<PaginatedResult<PresenceMessage>>): void;
22632262
/**
2264-
* Registers a listener that is called each time a {@link PresenceMessage} matching a given {@link PresenceAction}, or an action within an array of {@link PresenceAction | `PresenceAction`s}, is received on the channel, such as a new member entering the presence set. Implicitly attaches the channel unless {@link ChannelOptions.attachOnSubscribe} is `false`. Requires the `presence_subscribe` mode (granted by default unless {@link ChannelOptions.modes} excludes it); if the channel attaches without it the server never delivers presence events, so the listener silently never fires: the call still resolves and nothing is logged.
2263+
* Registers a listener that is called each time a {@link PresenceMessage} matching a given {@link PresenceAction}, or an action within an array of {@link PresenceAction | `PresenceAction`s}, is received on the channel, such as a new member entering the presence set. Implicitly attaches the channel unless {@link ChannelOptions.attachOnSubscribe} is `false`. Requires the `presence_subscribe` mode. If the channel attaches without it the server never delivers presence events, so the listener silently never fires. The call still resolves and nothing is logged.
22652264
*
22662265
* @param action - A {@link PresenceAction} or an array of {@link PresenceAction | `PresenceAction`s} to register the listener for.
22672266
* @param listener - An event listener function.
@@ -2274,7 +2273,7 @@ export declare interface RealtimePresence {
22742273
*/
22752274
subscribe(action: PresenceAction | Array<PresenceAction>, listener?: messageCallback<PresenceMessage>): Promise<void>;
22762275
/**
2277-
* Registers a listener that is called each time a {@link PresenceMessage} is received on the channel, such as a new member entering the presence set. Implicitly attaches the channel unless {@link ChannelOptions.attachOnSubscribe} is `false`. Requires the `presence_subscribe` mode (granted by default unless {@link ChannelOptions.modes} excludes it); if the channel attaches without it the server never delivers presence events, so the listener silently never fires: the call still resolves and nothing is logged.
2276+
* Registers a listener that is called each time a {@link PresenceMessage} is received on the channel, such as a new member entering the presence set. Implicitly attaches the channel unless {@link ChannelOptions.attachOnSubscribe} is `false`. Requires the `presence_subscribe` mode. If the channel attaches without it the server never delivers presence events, so the listener silently never fires. The call still resolves and nothing is logged.
22782277
*
22792278
* @param listener - An event listener function.
22802279
* @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. When {@link ChannelOptions.attachOnSubscribe} is `false`, no attach is performed.
@@ -2305,7 +2304,7 @@ export declare interface RealtimePresence {
23052304
callback: ErrorCallback,
23062305
): void;
23072306
/**
2308-
* Enters the presence set for the channel, optionally passing a `data` payload. A `clientId` is required: if the client has no `clientId` (or the wildcard `*`), the call rejects with an {@link ErrorInfo}; set a `clientId` in {@link ClientOptions} or in the token, or use {@link RealtimePresence.enterClient | `enterClient()`} to enter on behalf of another identity. Implicitly attaches the channel if it is not already attached. Once entered, the member is automatically re-entered whenever the channel re-attaches after a disconnection; if that re-enter fails, the failure surfaces as a channel `update` event carrying the {@link ErrorInfo}, not as a rejection.
2307+
* Enters the presence set for the channel, optionally passing a `data` payload. A `clientId` is required: if the client has no `clientId`, or only the wildcard `*`, the call rejects with an {@link ErrorInfo}. Set a `clientId` in {@link ClientOptions} or in the token, or use {@link RealtimePresence.enterClient | `enterClient()`} to enter on behalf of another identity. Implicitly attaches the channel if it is not already attached. Once entered, the member is automatically re-entered whenever the channel re-attaches after a disconnection; if that re-enter fails, the failure surfaces as a channel `update` event carrying the {@link ErrorInfo}, not as a rejection.
23092308
*
23102309
* @param data - The payload associated with the presence member.
23112310
* @returns A promise which resolves upon success of the operation and rejects with an {@link ErrorInfo} object upon its failure.
@@ -2331,7 +2330,7 @@ export declare interface RealtimePresence {
23312330
*/
23322331
enter(data: any, callback: ErrorCallback): void;
23332332
/**
2334-
* Updates the `data` payload for a presence member. If called before entering the presence set, this is treated as an {@link PresenceActions.ENTER} event. Requires an identified client: if the client has no `clientId` (or the wildcard `*`) set in the {@link ClientOptions} or the token, the call rejects with an {@link ErrorInfo} (use {@link RealtimePresence.updateClient | `updateClient()`} to update on behalf of another identity). Implicitly attaches the channel if it is not already attached.
2333+
* Updates the `data` payload for a presence member. If called before entering the presence set, this is treated as an {@link PresenceActions.ENTER} event. Requires an identified client: if the client has no `clientId`, or only the wildcard `*`, set in the {@link ClientOptions} or the token, the call rejects with an {@link ErrorInfo}. Use {@link RealtimePresence.updateClient | `updateClient()`} to update on behalf of another identity. Implicitly attaches the channel if it is not already attached.
23352334
*
23362335
* @param data - The payload to update for the presence member.
23372336
* @returns A promise which resolves upon success of the operation and rejects with an {@link ErrorInfo} object upon its failure.

0 commit comments

Comments
 (0)