@droponair/sdk-js 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/core/messaging-client.d.ts +1 -0
- package/dist/core/messaging-client.js +4 -1
- package/dist/core/types.d.ts +7 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ This project follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [0.23.0], 2026-06-01
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Idempotent retries via `sendMessage(..., { clientMessageId })`.** Pass a stable id to reuse across retries of the same logical message. The relay now dedups by `(appId, fromUserId, messageId)`, so re-sending after a lost ack or a reconnect delivers the message at most once instead of creating duplicates. Omit it for new messages and a fresh id is generated (unchanged default behavior). Requires relay support shipped alongside this release; wire format and `PROTOCOL_VERSION` are unchanged (the `clientMessageId` field already existed).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
9
17
|
## [0.22.1], 2026-05-31
|
|
10
18
|
|
|
11
19
|
### Fixed
|
|
@@ -101,6 +101,7 @@ export declare class MessagingClient implements DropOnAirClient {
|
|
|
101
101
|
disconnect(): void;
|
|
102
102
|
sendMessage(toUserId: string, plaintextMessage: string, options?: {
|
|
103
103
|
attachments?: AttachmentRef[];
|
|
104
|
+
clientMessageId?: string;
|
|
104
105
|
}): Promise<{
|
|
105
106
|
messageId: string;
|
|
106
107
|
}>;
|
|
@@ -337,7 +337,10 @@ class MessagingClient {
|
|
|
337
337
|
throw new Error('JWT_EXPIRED: Secure messaging session is reconnecting; please retry in a moment');
|
|
338
338
|
}
|
|
339
339
|
const myDeviceId = this.deviceId ?? await this.getOrCreateDeviceId();
|
|
340
|
-
|
|
340
|
+
// Reuse a caller-supplied id for idempotent retries: the relay dedups by
|
|
341
|
+
// (appId, fromUserId, messageId), so re-sending with the same id is a no-op
|
|
342
|
+
// delivery instead of a duplicate. Defaults to a fresh id for new messages.
|
|
343
|
+
const messageId = options?.clientMessageId ?? crypto.randomUUID();
|
|
341
344
|
const timestamp = Date.now();
|
|
342
345
|
const myIdentity = await this.cryptoService.getOrCreateIdentity();
|
|
343
346
|
const myPublicKeyBytes = (0, bytes_1.fromBase64)(myIdentity.publicKey);
|
package/dist/core/types.d.ts
CHANGED
|
@@ -304,9 +304,16 @@ export interface DropOnAirClient {
|
|
|
304
304
|
/**
|
|
305
305
|
* Send a 1:1 E2EE message. Optionally attach one or more attachments
|
|
306
306
|
* prepared via {@link prepareAttachmentAndUpload} or {@link createUploadSession}.
|
|
307
|
+
*
|
|
308
|
+
* Pass `options.clientMessageId` to reuse a stable id across retries: the relay
|
|
309
|
+
* dedups by `(appId, fromUserId, messageId)`, so re-sending a message with the
|
|
310
|
+
* same id delivers it at most once instead of creating a duplicate. Omit it for
|
|
311
|
+
* new messages and a fresh id is generated. The chosen id is returned as
|
|
312
|
+
* `messageId`.
|
|
307
313
|
*/
|
|
308
314
|
sendMessage(toUserId: string, plaintextMessage: string, options?: {
|
|
309
315
|
attachments?: import('../attachment/attachment-types').AttachmentRef[];
|
|
316
|
+
clientMessageId?: string;
|
|
310
317
|
}): Promise<{
|
|
311
318
|
messageId: string;
|
|
312
319
|
}>;
|
package/dist/version.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* MINOR, additive feature (e.g. multi-device payloads, new call event type)
|
|
8
8
|
* PATCH, bug-fix / perf improvement with no wire or API change
|
|
9
9
|
*/
|
|
10
|
-
export declare const SDK_VERSION = "0.
|
|
10
|
+
export declare const SDK_VERSION = "0.23.0";
|
|
11
11
|
/**
|
|
12
12
|
* Binary encrypted-payload format version.
|
|
13
13
|
* Included as the first byte of every encrypted payload so receivers can
|
package/dist/version.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.PROTOCOL_VERSION = exports.PAYLOAD_FORMAT_VERSION = exports.SDK_VERSION
|
|
|
10
10
|
* MINOR, additive feature (e.g. multi-device payloads, new call event type)
|
|
11
11
|
* PATCH, bug-fix / perf improvement with no wire or API change
|
|
12
12
|
*/
|
|
13
|
-
exports.SDK_VERSION = '0.
|
|
13
|
+
exports.SDK_VERSION = '0.23.0';
|
|
14
14
|
/**
|
|
15
15
|
* Binary encrypted-payload format version.
|
|
16
16
|
* Included as the first byte of every encrypted payload so receivers can
|