@open-e2ee/signal-protocol-sdk 9.3.0 → 9.5.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.
Files changed (92) hide show
  1. package/ADAPTERS.md +1 -0
  2. package/CHANGELOG.md +269 -0
  3. package/README.md +1 -1
  4. package/SECURITY.md +2 -2
  5. package/client/README.md +11 -14
  6. package/dist/client/client.d.ts +134 -64
  7. package/dist/client/client.d.ts.map +1 -1
  8. package/dist/client/client.js +333 -179
  9. package/dist/client/client.js.map +1 -1
  10. package/dist/client/config.d.ts +4 -7
  11. package/dist/client/config.d.ts.map +1 -1
  12. package/dist/client/config.js.map +1 -1
  13. package/dist/client/content-adapter.d.ts +8 -0
  14. package/dist/client/content-adapter.d.ts.map +1 -1
  15. package/dist/client/content-adapter.js +4 -0
  16. package/dist/client/content-adapter.js.map +1 -1
  17. package/dist/client/event-hooks.d.ts +1 -1
  18. package/dist/client/group-outbox.d.ts +2 -4
  19. package/dist/client/group-outbox.d.ts.map +1 -1
  20. package/dist/client/group-outbox.js +7 -1
  21. package/dist/client/group-outbox.js.map +1 -1
  22. package/dist/client/hosted-anonymous-delivery.d.ts +1 -1
  23. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  24. package/dist/client/hosted-anonymous-delivery.js +5 -14
  25. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  26. package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
  27. package/dist/client/hosted-mailbox-subscription.js +136 -15
  28. package/dist/client/hosted-mailbox-subscription.js.map +1 -1
  29. package/dist/client/hosted-transport.d.ts +2 -2
  30. package/dist/client/hosted-transport.d.ts.map +1 -1
  31. package/dist/client/hosted-transport.js +20 -5
  32. package/dist/client/hosted-transport.js.map +1 -1
  33. package/dist/client/messages.d.ts.map +1 -1
  34. package/dist/client/messages.js +12 -2
  35. package/dist/client/messages.js.map +1 -1
  36. package/dist/client/relay-acceptance.d.ts +29 -0
  37. package/dist/client/relay-acceptance.d.ts.map +1 -0
  38. package/dist/client/relay-acceptance.js +29 -0
  39. package/dist/client/relay-acceptance.js.map +1 -0
  40. package/dist/client/relay-subscription.d.ts +43 -1
  41. package/dist/client/relay-subscription.d.ts.map +1 -1
  42. package/dist/client/relay-subscription.js +278 -100
  43. package/dist/client/relay-subscription.js.map +1 -1
  44. package/dist/client/relay-work.d.ts +7 -6
  45. package/dist/client/relay-work.d.ts.map +1 -1
  46. package/dist/client/relay-work.js +34 -9
  47. package/dist/client/relay-work.js.map +1 -1
  48. package/dist/client/retry-family.d.ts +119 -0
  49. package/dist/client/retry-family.d.ts.map +1 -0
  50. package/dist/client/retry-family.js +170 -0
  51. package/dist/client/retry-family.js.map +1 -0
  52. package/dist/client/retry-request-envelope.d.ts +106 -0
  53. package/dist/client/retry-request-envelope.d.ts.map +1 -0
  54. package/dist/client/retry-request-envelope.js +245 -0
  55. package/dist/client/retry-request-envelope.js.map +1 -0
  56. package/dist/client/retry.d.ts +66 -24
  57. package/dist/client/retry.d.ts.map +1 -1
  58. package/dist/client/retry.js +239 -139
  59. package/dist/client/retry.js.map +1 -1
  60. package/dist/client/sealed-sender.d.ts +15 -3
  61. package/dist/client/sealed-sender.d.ts.map +1 -1
  62. package/dist/client/sealed-sender.js +22 -3
  63. package/dist/client/sealed-sender.js.map +1 -1
  64. package/dist/client/signal-service-cipher.d.ts +52 -0
  65. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  66. package/dist/client/signal-service-cipher.js +185 -15
  67. package/dist/client/signal-service-cipher.js.map +1 -1
  68. package/dist/client/state.d.ts +12 -64
  69. package/dist/client/state.d.ts.map +1 -1
  70. package/dist/client/state.js +22 -98
  71. package/dist/client/state.js.map +1 -1
  72. package/dist/client/types.d.ts +28 -2
  73. package/dist/client/types.d.ts.map +1 -1
  74. package/dist/client/types.js.map +1 -1
  75. package/dist/internal/protocol/sealed-sender/types.d.ts +1 -1
  76. package/dist/internal/protocol/sealed-sender/types.js +1 -1
  77. package/dist/local/store/received-content.d.ts +16 -2
  78. package/dist/local/store/received-content.d.ts.map +1 -1
  79. package/dist/local/store/received-content.js +18 -3
  80. package/dist/local/store/received-content.js.map +1 -1
  81. package/dist/local/store/reliability.d.ts +260 -2
  82. package/dist/local/store/reliability.d.ts.map +1 -1
  83. package/dist/local/store/reliability.js +390 -12
  84. package/dist/local/store/reliability.js.map +1 -1
  85. package/dist/remote/relay/types.d.ts +31 -31
  86. package/dist/remote/relay/types.d.ts.map +1 -1
  87. package/dist/types/api.d.ts +74 -26
  88. package/dist/types/api.d.ts.map +1 -1
  89. package/docs/ASSURANCE.md +5 -5
  90. package/docs/DEVIATIONS.md +4 -5
  91. package/docs/INTERFACES.md +2 -0
  92. package/package.json +1 -1
@@ -182,6 +182,24 @@ export interface SendResult {
182
182
  * reads its mailbox.
183
183
  */
184
184
  recipientDeviceCount: number;
185
+ /**
186
+ * True when the relay had already accepted every device post of this send,
187
+ * so the send stored no new copy. This is the case when the application
188
+ * calls `send()` again with the `clientMessageId` of a send whose posts the
189
+ * relay accepted but whose result did not arrive. For a group send over a
190
+ * group token, the shared post reports that the relay had already accepted
191
+ * its fan-out, not that each destination stored a copy. The sender key
192
+ * pre-messages of a group send do not count. Absent when a post did not
193
+ * report it, as on a relay that does not report it.
194
+ */
195
+ duplicate?: boolean;
196
+ /**
197
+ * The earliest time, in milliseconds since the epoch, at which the relay
198
+ * drops the copy of a device post that the device has not acknowledged.
199
+ * The sender key pre-messages of a group send do not count. Absent when a
200
+ * post did not report it.
201
+ */
202
+ expiresAt?: number;
185
203
  /** Group ID if sent to a group */
186
204
  groupId?: string;
187
205
  /** Opaque remote object identifier for the encrypted attachment */
@@ -392,6 +410,13 @@ export interface TypingIndicator {
392
410
  export interface IncomingEnvelope {
393
411
  /** Server-assigned message ID */
394
412
  id: string;
413
+ /**
414
+ * The SDK ID of the message, when the relay assigns its own `id` and
415
+ * delivers the SDK ID with the envelope. The retry family of a resend or
416
+ * a null message resolves by this ID, or by `id` when it is absent. The
417
+ * processed record and the acknowledgment use `id`.
418
+ */
419
+ clientMessageId?: string;
395
420
  /** Sender's user ID (Convex _id) */
396
421
  senderUserId: string;
397
422
  /** Sender's device ID */
@@ -436,9 +461,10 @@ export interface ProcessEnvelopeOptions {
436
461
  * Callback to send retry requests when no relay is available.
437
462
  *
438
463
  * Required for background processing where there is no WebSocket relay.
439
- * The callback receives a fully-formed RetryRequest created by SesameManager.
464
+ * The callback receives a `retry_request` envelope for the device that sent
465
+ * the failed message. Deliver it to that device as any other envelope.
440
466
  */
441
- sendRetryRequest?: (request: import('../internal/sesame/types.js').RetryRequest) => Promise<void>;
467
+ sendRetryRequest?: (envelope: import('../remote/relay/types.js').Envelope) => Promise<void>;
442
468
  /**
443
469
  * Callback to mark message as delivered when no relay is available.
444
470
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../client/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EACV,iCAAiC,EACjC,sBAAsB,EACtB,qBAAqB,EACrB,+BAA+B,EAC/B,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAA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QG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,0BAA0B;IAC1B,qDAAW,CAAA;IACX,2EAA2E;IAC3E,qDAAW,CAAA;AACb,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../client/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkTH,iFAAiF;AACjF,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,OAAO,CACL,KAAK,YAAY,KAAK;QACtB,iBAAiB,IAAI,KAAK;QAC1B,OAAQ,KAAuC,CAAC,eAAe,KAAK,QAAQ,CAC7E,CAAC;AACJ,CAAC;AA8GD,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,kDAAkD;IAClD,qDAAY,CAAA;IACZ,oCAAoC;IACpC,6CAAQ,CAAA;IACR,8DAA8D;IAC9D,iDAAU,CAAA;AACZ,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AA4BD,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,0BAA0B;IAC1B,qDAAW,CAAA;IACX,2EAA2E;IAC3E,qDAAW,CAAA;AACb,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB"}
@@ -137,7 +137,7 @@ export declare enum SealedSenderContentType {
137
137
  *
138
138
  * `PLAINTEXT_CONTENT` is deliberately excluded. The reference uses it to carry
139
139
  * a decryption-error receipt when no session exists. This implementation
140
- * delivers those over a dedicated relay channel instead (`retryRequests`), so
140
+ * sends those as identified `retry_request` mailbox envelopes instead, so
141
141
  * nothing here produces the type and no decrypt path consumes it. Accepting it
142
142
  * would mean routing an unauthenticated payload through a path with no handler
143
143
  * for it. The whole point of the type is that it is not encrypted.
@@ -51,7 +51,7 @@ export var SealedSenderContentType;
51
51
  *
52
52
  * `PLAINTEXT_CONTENT` is deliberately excluded. The reference uses it to carry
53
53
  * a decryption-error receipt when no session exists. This implementation
54
- * delivers those over a dedicated relay channel instead (`retryRequests`), so
54
+ * sends those as identified `retry_request` mailbox envelopes instead, so
55
55
  * nothing here produces the type and no decrypt path consumes it. Accepting it
56
56
  * would mean routing an unauthenticated payload through a path with no handler
57
57
  * for it. The whole point of the type is that it is not encrypted.
@@ -1,7 +1,21 @@
1
1
  import type { Envelope } from '../../remote/relay/types.js';
2
2
  import type { SignalProtocolLocalStore, ReceivedContent } from '../../types/api.js';
3
- /** Bind recovery to the exact envelope and the device that consumed it. */
4
- export declare function receivedContentId(userId: string, deviceId: number, envelope: Envelope): Promise<string>;
3
+ /**
4
+ * Bind recovery to the device that consumed an envelope, and to the
5
+ * envelope ID, the sender, the message type and the ciphertext of the
6
+ * envelope. The timestamps are not part of the ID: a push can omit the
7
+ * server timestamp that a pull of the same envelope sets.
8
+ */
9
+ export declare function receivedContentId(userId: string, deviceId: number, envelope: Pick<Envelope, 'senderUserId' | 'senderDeviceId' | 'ciphertext' | 'id'> & {
10
+ messageType?: string;
11
+ }): Promise<string>;
12
+ /**
13
+ * The fingerprint of an envelope as the Relay delivered it. Every receive
14
+ * path gives one value for one delivered envelope: an absent message type
15
+ * is `ciphertext`, as the Relay delivers it, a sealed envelope is hashed
16
+ * before any unseal, and the timestamps are not part of the value.
17
+ */
18
+ export declare function deliveredEnvelopeFingerprint(userId: string, deviceId: number, envelope: Parameters<typeof receivedContentId>[2]): Promise<string>;
5
19
  export declare function receivedContentKey(id: string): string;
6
20
  export declare function parseReceivedContent(value: string, id: string): ReceivedContent;
7
21
  /** Expired content follows the same thirty-day horizon as incoming retry evidence. */
@@ -1 +1 @@
1
- {"version":3,"file":"received-content.d.ts","sourceRoot":"","sources":["../../../local/store/received-content.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,C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CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe,CAa/E;AAID,sFAAsF;AACtF,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzF"}
@@ -1,6 +1,11 @@
1
1
  import { sha256, bytesToBase64 } from '../../internal/crypto/index.js';
2
2
  import { RELIABILITY_RECORD_TTL_MS } from './reliability.js';
3
- /** Bind recovery to the exact envelope and the device that consumed it. */
3
+ /**
4
+ * Bind recovery to the device that consumed an envelope, and to the
5
+ * envelope ID, the sender, the message type and the ciphertext of the
6
+ * envelope. The timestamps are not part of the ID: a push can omit the
7
+ * server timestamp that a pull of the same envelope sets.
8
+ */
4
9
  export async function receivedContentId(userId, deviceId, envelope) {
5
10
  const ciphertext = typeof envelope.ciphertext === 'string'
6
11
  ? envelope.ciphertext
@@ -12,12 +17,22 @@ export async function receivedContentId(userId, deviceId, envelope) {
12
17
  envelope.senderUserId,
13
18
  envelope.senderDeviceId,
14
19
  envelope.messageType,
15
- envelope.timestamp ?? null,
16
- envelope.serverTimestamp ?? null,
17
20
  ciphertext,
18
21
  ])));
19
22
  return bytesToBase64(digest);
20
23
  }
24
+ /**
25
+ * The fingerprint of an envelope as the Relay delivered it. Every receive
26
+ * path gives one value for one delivered envelope: an absent message type
27
+ * is `ciphertext`, as the Relay delivers it, a sealed envelope is hashed
28
+ * before any unseal, and the timestamps are not part of the value.
29
+ */
30
+ export async function deliveredEnvelopeFingerprint(userId, deviceId, envelope) {
31
+ return receivedContentId(userId, deviceId, {
32
+ ...envelope,
33
+ messageType: envelope.messageType ?? 'ciphertext',
34
+ });
35
+ }
21
36
  export function receivedContentKey(id) {
22
37
  return `received-content:${id}`;
23
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"received-content.js","sourceRoot":"","sources":["../../../local/store/received-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,uBAAuB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AK,CAAC,CAAC;IACpC,IAAI,IAAI,KAAK,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,GAAG,IAAI,GAAG,MAAM;QAAE,OAAO;IACrE,MAAM,KAAK,CAAC,4BAA4B,CAAC,GAAG,GAAG,yBAAyB,CAAC,CAAC;IAC1E,WAAW,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC9B,CAAC"}
@@ -1,6 +1,17 @@
1
+ import type { Envelope } from '../../remote/relay/types.js';
1
2
  import type { SignalProtocolLocalStore } from '../../types/index.js';
2
3
  import type { ContentHint } from '../../types/messages.js';
3
4
  export declare const RELIABILITY_RECORD_TTL_MS: number;
5
+ /**
6
+ * The lifetime of the retry-request and retry-family records of the
7
+ * requester, and of a fulfilled processed-envelope record. Two bounds set
8
+ * it. A sender refuses a retry request for a message older than
9
+ * `RELIABILITY_RECORD_TTL_MS`, so its last resend post comes at most that
10
+ * long after the failure. The Relay keeps a post for at most
11
+ * `RELIABILITY_RECORD_TTL_MS`, so a resend can arrive up to twice that
12
+ * time after the failure.
13
+ */
14
+ export declare const RETRY_REQUESTER_RECORD_TTL_MS: number;
4
15
  export interface StoredOutgoingDeviceMessage {
5
16
  recipientUserId: string;
6
17
  recipientDeviceId: number;
@@ -51,6 +62,8 @@ export interface StoredOutgoingMessageIntent {
51
62
  messageId: string;
52
63
  timestamp: number;
53
64
  recipientDeviceCount: number;
65
+ duplicate?: boolean;
66
+ expiresAt?: number;
54
67
  groupId?: string;
55
68
  };
56
69
  }
@@ -73,7 +86,252 @@ export declare function replaceOutgoingDirectDeviceMessage(store: ReliabilityMet
73
86
  export declare function getOutgoingMessageIntent(store: ReliabilityMetadataStore, clientMessageId: string, now?: number): Promise<StoredOutgoingMessageIntent | null>;
74
87
  export declare function storeOutgoingMessageIntent(store: ReliabilityMetadataStore, intent: StoredOutgoingMessageIntent, now?: number): Promise<void>;
75
88
  export declare function completeOutgoingMessageIntent(store: ReliabilityMetadataStore, clientMessageId: string, result: NonNullable<StoredOutgoingMessageIntent['result']>): Promise<void>;
76
- export declare function hasProcessedEnvelope(store: ReliabilityMetadataStore, envelopeId: string, now?: number, fingerprint?: string): Promise<boolean>;
77
- export declare function storeProcessedEnvelope(store: ReliabilityMetadataStore, envelopeId: string, processedAt?: number, fingerprint?: string): Promise<void>;
89
+ /** The record of one envelope ID that the local device processed. */
90
+ export interface ProcessedEnvelope {
91
+ /** The time of the processing. The record expires from this time. */
92
+ processedAt: number;
93
+ /** The fingerprint of the processed envelope. */
94
+ fingerprint?: string;
95
+ /**
96
+ * True when the application got the content of this failed envelope,
97
+ * from the envelope itself or from a resend. The requester then drops
98
+ * each later member of its retry family.
99
+ */
100
+ fulfilled?: true;
101
+ }
102
+ /**
103
+ * Get the processed-envelope record of one envelope ID. A record older
104
+ * than `RELIABILITY_RECORD_TTL_MS` does not count. A fulfilled record
105
+ * counts for `RETRY_REQUESTER_RECORD_TTL_MS`.
106
+ */
107
+ export declare function getProcessedEnvelope(store: ReliabilityMetadataStore, envelopeId: string, now?: number): Promise<ProcessedEnvelope | null>;
108
+ /**
109
+ * Tell whether the local device processed one envelope ID. A record counts
110
+ * for the lifetime that `getProcessedEnvelope` applies.
111
+ */
112
+ export declare function hasProcessedEnvelope(store: ReliabilityMetadataStore, envelopeId: string, now?: number): Promise<boolean>;
113
+ /**
114
+ * Record that the local device processed one envelope ID. The write keeps
115
+ * the fingerprint and the fulfilled flag of a record that counts, so a
116
+ * later store for the same ID never clears them.
117
+ *
118
+ * @param fulfilled - True when the application got the content of this
119
+ * failed envelope. The processed fact and the fulfilled fact are then
120
+ * one write.
121
+ */
122
+ export declare function storeProcessedEnvelope(store: ReliabilityMetadataStore, envelopeId: string, processedAt?: number, fingerprint?: string, fulfilled?: true): Promise<void>;
123
+ /**
124
+ * The relay gave a failed envelope ID again with other content after the
125
+ * local device stored a retry request for that ID.
126
+ */
127
+ export declare class RetryRequestedEnvelopeChangedError extends Error {
128
+ constructor();
129
+ }
130
+ /** Tell whether a value has the shape of a retry ID. */
131
+ export declare function isRetryId(value: unknown): value is string;
132
+ /**
133
+ * The client message ID of the retry request with one retry ID. The first
134
+ * attempt of that request posts under this ID.
135
+ */
136
+ export declare function retryRequestClientMessageId(retryId: string): string;
137
+ /**
138
+ * The resend ID of the content resend for one retry ID. The first attempt of
139
+ * that resend posts under this ID.
140
+ */
141
+ export declare function retryResendClientMessageId(retryId: string): string;
142
+ /**
143
+ * The resend ID of the null message for one retry ID. It is not the content
144
+ * resend ID, so a null message never posts content bytes.
145
+ */
146
+ export declare function retryNullMessageClientMessageId(retryId: string): string;
147
+ /**
148
+ * The client message ID of one attempt of a retry request or a retry resend.
149
+ * Attempt 1 posts under the given ID, and attempt `n` posts under
150
+ * `<id>:<n>`. A resend takes the attempt number of the request that it
151
+ * answers. A new encryption for the same request attempt posts the same
152
+ * ID, and the processed ledger of the requester and the RETRY_CONFLICT
153
+ * answer of the Relay cover the new bytes.
154
+ */
155
+ export declare function retryAttemptClientMessageId(id: string, attempt: number): string;
156
+ /**
157
+ * The two IDs that a retry request payload carries: the failed envelope and
158
+ * the retry ID of the request record. The resend and the null message IDs
159
+ * derive from the retry ID and from the attempt number of the request
160
+ * envelope that they answer.
161
+ */
162
+ export interface RetryRequestIds {
163
+ /** The Relay message ID of the envelope that the requester could not decrypt. */
164
+ failedEnvelopeId: string;
165
+ /** The retry ID of the request record. */
166
+ retryId: string;
167
+ }
168
+ /** An envelope ID that one retry ID derives. */
169
+ export interface RetryFamilyMember {
170
+ /** The retry ID: the family key on the wire. */
171
+ retryId: string;
172
+ /** The retry request, the content resend or the null message. */
173
+ kind: 'retry-request' | 'resend' | 'null';
174
+ /** The attempt number of the ID, from 1. */
175
+ attempt: number;
176
+ }
177
+ /**
178
+ * The retry ID, the kind and the attempt number of an envelope whose ID has
179
+ * the shape of a retry attempt: `<retryId>:retry-request[:n]`,
180
+ * `<retryId>:resend[:n]` or `<retryId>:null[:n]`, with `n` from 2. An ID
181
+ * with no `n` is attempt 1. Undefined for any other ID. Only the family
182
+ * index of the requester tells which failed envelope a retry ID names.
183
+ */
184
+ export declare function retryFamilyMember(envelopeId: string): RetryFamilyMember | undefined;
185
+ /**
186
+ * The attempt number of the retry request that a resend or a null message
187
+ * answers, from the request envelope ID. The answer carries this number,
188
+ * so the requester can tell which of its attempts the answer is for.
189
+ * Throws when the ID is not a retry request of the retry ID: the requester
190
+ * makes each request envelope ID, so the sender never answers another ID.
191
+ */
192
+ export declare function retryRequestAttempt(target: Pick<RetryResendTarget, 'retryId' | 'requestEnvelopeId'>): number;
193
+ /** A resend or a null message that answers a retry request of the local device. */
194
+ export interface ResolvedRetryFamilyMember {
195
+ /** The retry ID of the request record. */
196
+ retryId: string;
197
+ /** The ID of the failed envelope that the request record names. */
198
+ failedEnvelopeId: string;
199
+ /** The content resend or the null message. */
200
+ kind: 'resend' | 'null';
201
+ /** The attempt number of the member ID, from 1. */
202
+ attempt: number;
203
+ }
204
+ /**
205
+ * Get the failed envelope ID that the family index gives for one retry ID.
206
+ * A record older than `RETRY_REQUESTER_RECORD_TTL_MS` does not count.
207
+ */
208
+ export declare function getRetryFamily(store: ReliabilityMetadataStore, retryId: string, now?: number): Promise<string | null>;
209
+ /**
210
+ * Resolve an envelope ID to the request record that it answers. An ID that
211
+ * has the shape of a resend or a null message is a family member only when
212
+ * the family index of the local device holds its retry ID. Any other ID
213
+ * gives undefined, and the envelope is an ordinary envelope.
214
+ *
215
+ * The sender of a member is not bound to the target of the request. The
216
+ * retry ID is a random UUID that only the requester, the Relay and the
217
+ * requested sender see, so another sender cannot name it.
218
+ */
219
+ export declare function resolveRetryFamilyMember(store: ReliabilityMetadataStore, envelopeId: string, now?: number): Promise<ResolvedRetryFamilyMember | undefined>;
220
+ /**
221
+ * The stored attempt of the retry request for one failed envelope, keyed by
222
+ * the failed envelope ID. A later decrypt failure of that envelope posts
223
+ * this envelope again, so the Relay sees one operation for each attempt. A
224
+ * resend or a null message of the same attempt number that arrives marks
225
+ * the attempt answered. A decrypt failure of a resend or a null message
226
+ * posts the next attempt under the same retry ID when the stored attempt is
227
+ * answered, and posts the stored envelope again when it is not.
228
+ */
229
+ export interface StoredRetryRequest {
230
+ /** The ID of the envelope that the local device could not decrypt: the key of the record. */
231
+ failedEnvelopeId: string;
232
+ /** The retry ID of the record. Every attempt of the record uses it. */
233
+ retryId: string;
234
+ /** The number of the stored attempt, from 1. It names the client message ID of its post. */
235
+ attempt: number;
236
+ /** The time of the stored attempt. The record expires from this time. */
237
+ requestedAt: number;
238
+ /** The fingerprint of the failed envelope. */
239
+ fingerprint?: string;
240
+ /**
241
+ * True when a resend or a null message of this attempt number arrived.
242
+ * Each new attempt stores false. The member whose decrypt failure created
243
+ * attempt n is of an earlier attempt number, so its redelivery does not
244
+ * answer attempt n, and its post is a replay.
245
+ */
246
+ answered: boolean;
247
+ /** The request envelope of the stored attempt. */
248
+ envelope: Envelope;
249
+ }
250
+ /**
251
+ * Get the stored retry request for one failed envelope. A record older than
252
+ * `RETRY_REQUESTER_RECORD_TTL_MS` does not count.
253
+ *
254
+ * @throws RetryRequestedEnvelopeChangedError When the stored fingerprint is
255
+ * not the given fingerprint.
256
+ */
257
+ export declare function getRetryRequest(store: ReliabilityMetadataStore, failedEnvelopeId: string, now?: number, fingerprint?: string): Promise<StoredRetryRequest | null>;
258
+ /**
259
+ * Mark the stored attempt of a retry request answered when a resend or a
260
+ * null message of its retry ID and its attempt number arrives. A member of
261
+ * another attempt number answers nothing. An expired record, a record of
262
+ * another retry ID and an answered attempt stay as they are.
263
+ *
264
+ * @param store - The local store that keeps the request records.
265
+ * @param failedEnvelopeId - The failed envelope of the family.
266
+ * @param retryId - The retry ID of the arriving envelope.
267
+ * @param attempt - The attempt number of the arriving envelope ID.
268
+ * @param now - The current time.
269
+ */
270
+ export declare function markRetryRequestAnswered(store: ReliabilityMetadataStore, failedEnvelopeId: string, retryId: string, attempt: number, now?: number): Promise<void>;
271
+ /**
272
+ * Record the request envelope of a retry request before its post, and the
273
+ * family index entry from its retry ID to the failed envelope ID. One
274
+ * mutation writes both. The two writes are serialized, not atomic, and the
275
+ * index write comes first. Only a failure between the two writes leaves an
276
+ * index entry with no request record, so the case is practically
277
+ * unreachable. A member of that retry ID then still resolves to the
278
+ * failed envelope. Its decrypt stores the failed envelope processed, and
279
+ * its decrypt failure creates attempt 1 under a new retry ID. A record
280
+ * that a member creates has no fingerprint, so a later failure of the
281
+ * failed envelope with a fingerprint reads as a changed envelope and posts
282
+ * nothing. A later attempt replaces the earlier one in one write, so the
283
+ * record holds an attempt at each point.
284
+ */
285
+ export declare function storeRetryRequest(store: ReliabilityMetadataStore, request: StoredRetryRequest): Promise<void>;
286
+ /**
287
+ * The retry request that a resend or a null message answers. The sender
288
+ * takes it from the request envelope and its payload.
289
+ */
290
+ export interface RetryResendTarget {
291
+ /** The retry ID of the requester's record. The answer IDs derive from it. */
292
+ retryId: string;
293
+ /** The ID of the request attempt that the answer goes to. */
294
+ requestEnvelopeId: string;
295
+ /** The ID of the envelope that the requester could not decrypt. */
296
+ failedEnvelopeId: string;
297
+ /** A resend of the content, or the null message of a session reset. */
298
+ kind: 'resend' | 'null';
299
+ }
300
+ /**
301
+ * The stored answer to the retry requests for one failed envelope. The
302
+ * record key is the device that gets the answer and the failed envelope
303
+ * ID. The record holds the last encryption: a later post for the same
304
+ * request attempt and kind sends these bytes with this operation epoch
305
+ * again, so the Relay sees one operation.
306
+ */
307
+ export interface StoredRetryResend extends RetryResendTarget {
308
+ /**
309
+ * The attempt number of the request that the answer goes to, from
310
+ * `retryRequestAttempt`. With the retry ID and the kind, it names the
311
+ * client message ID of the post.
312
+ */
313
+ attempt: number;
314
+ /** The operation epoch of the stored bytes. The record expires from this time. */
315
+ operationEpochMilliseconds: number;
316
+ transportMode: StoredOutgoingMessageIntent['transportMode'];
317
+ sealedSenderAuth?: {
318
+ type: 'accessKey';
319
+ unidentifiedAccessKey: string;
320
+ };
321
+ contentHint?: ContentHint;
322
+ message: StoredOutgoingDeviceMessage;
323
+ }
324
+ /**
325
+ * Get the stored answer to one device for one failed envelope. A record
326
+ * older than `RELIABILITY_RECORD_TTL_MS` does not count.
327
+ */
328
+ export declare function getRetryResend(store: ReliabilityMetadataStore, recipientUserId: string, recipientDeviceId: number, failedEnvelopeId: string, now?: number): Promise<StoredRetryResend | null>;
329
+ /**
330
+ * Record the encrypted bytes of a retry resend before their post. A later
331
+ * encryption replaces the earlier one in one write, so the record holds an
332
+ * encryption at each point. Throws, and writes nothing, when the attempt
333
+ * is not the attempt number of the request envelope.
334
+ */
335
+ export declare function storeRetryResend(store: ReliabilityMetadataStore, resend: StoredRetryResend): Promise<void>;
78
336
  export {};
79
337
  //# sourceMappingURL=reliability.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reliability.d.ts","sourceRoot":"","sources":["../../../local/store/reliability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOxD,eAAO,MAAM,yBAAyB,QAAc,CAAC;AAErD,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,eAAe,GAAG,YAAY,GAAG,YAAY,CAAC;IAC3D,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,yBAAyB,CAAC,EAAE,YAAY,GAAG,kBAAkB,CAAC;IAC9D,wBAAwB,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;CACrD;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,M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