@open-e2ee/signal-protocol-sdk 13.5.2 → 14.1.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 (179) hide show
  1. package/CHANGELOG.md +369 -0
  2. package/README.md +9 -8
  3. package/SECURITY.md +2 -2
  4. package/client/README.md +5 -3
  5. package/device/README.md +4 -3
  6. package/dist/client/client.d.ts +20 -55
  7. package/dist/client/client.d.ts.map +1 -1
  8. package/dist/client/client.js +133 -165
  9. package/dist/client/client.js.map +1 -1
  10. package/dist/client/content-adapter.d.ts +35 -6
  11. package/dist/client/content-adapter.d.ts.map +1 -1
  12. package/dist/client/content-adapter.js +28 -0
  13. package/dist/client/content-adapter.js.map +1 -1
  14. package/dist/client/event-hooks.d.ts +22 -11
  15. package/dist/client/event-hooks.d.ts.map +1 -1
  16. package/dist/client/event-hooks.js.map +1 -1
  17. package/dist/client/group-fetcher.d.ts.map +1 -1
  18. package/dist/client/group-fetcher.js +43 -0
  19. package/dist/client/group-fetcher.js.map +1 -1
  20. package/dist/client/group-key-sync.d.ts +65 -0
  21. package/dist/client/group-key-sync.d.ts.map +1 -0
  22. package/dist/client/group-key-sync.js +286 -0
  23. package/dist/client/group-key-sync.js.map +1 -0
  24. package/dist/client/group-outbox.d.ts +20 -6
  25. package/dist/client/group-outbox.d.ts.map +1 -1
  26. package/dist/client/group-outbox.js +153 -80
  27. package/dist/client/group-outbox.js.map +1 -1
  28. package/dist/client/group-receive-authorization.d.ts +16 -9
  29. package/dist/client/group-receive-authorization.d.ts.map +1 -1
  30. package/dist/client/group-receive-authorization.js +25 -16
  31. package/dist/client/group-receive-authorization.js.map +1 -1
  32. package/dist/client/hosted-anonymous-delivery.d.ts +13 -1
  33. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  34. package/dist/client/hosted-anonymous-delivery.js +48 -5
  35. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  36. package/dist/client/hosted-mailbox-subscription.d.ts +6 -5
  37. package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
  38. package/dist/client/hosted-mailbox-subscription.js +4 -8
  39. package/dist/client/hosted-mailbox-subscription.js.map +1 -1
  40. package/dist/client/hosted-sandbox-identity.d.ts +66 -3
  41. package/dist/client/hosted-sandbox-identity.d.ts.map +1 -1
  42. package/dist/client/hosted-sandbox-identity.js +136 -45
  43. package/dist/client/hosted-sandbox-identity.js.map +1 -1
  44. package/dist/client/hosted-transport.d.ts +12 -0
  45. package/dist/client/hosted-transport.d.ts.map +1 -1
  46. package/dist/client/hosted-transport.js +85 -43
  47. package/dist/client/hosted-transport.js.map +1 -1
  48. package/dist/client/hosted.d.ts +13 -10
  49. package/dist/client/hosted.d.ts.map +1 -1
  50. package/dist/client/hosted.js +13 -10
  51. package/dist/client/hosted.js.map +1 -1
  52. package/dist/client/index.d.ts +2 -2
  53. package/dist/client/index.d.ts.map +1 -1
  54. package/dist/client/index.js +1 -1
  55. package/dist/client/index.js.map +1 -1
  56. package/dist/client/receive-queue.d.ts +3 -4
  57. package/dist/client/receive-queue.d.ts.map +1 -1
  58. package/dist/client/receive-queue.js +24 -32
  59. package/dist/client/receive-queue.js.map +1 -1
  60. package/dist/client/relay-period-close.d.ts +35 -0
  61. package/dist/client/relay-period-close.d.ts.map +1 -0
  62. package/dist/client/relay-period-close.js +63 -0
  63. package/dist/client/relay-period-close.js.map +1 -0
  64. package/dist/client/relay-subscription.d.ts.map +1 -1
  65. package/dist/client/relay-subscription.js +4 -9
  66. package/dist/client/relay-subscription.js.map +1 -1
  67. package/dist/client/retry-request-envelope.d.ts +4 -2
  68. package/dist/client/retry-request-envelope.d.ts.map +1 -1
  69. package/dist/client/retry-request-envelope.js +6 -4
  70. package/dist/client/retry-request-envelope.js.map +1 -1
  71. package/dist/client/retry-request-lifecycle.d.ts +7 -8
  72. package/dist/client/retry-request-lifecycle.d.ts.map +1 -1
  73. package/dist/client/retry-request-lifecycle.js +10 -7
  74. package/dist/client/retry-request-lifecycle.js.map +1 -1
  75. package/dist/client/retry-terminal-recovery.d.ts +14 -15
  76. package/dist/client/retry-terminal-recovery.d.ts.map +1 -1
  77. package/dist/client/retry-terminal-recovery.js +16 -17
  78. package/dist/client/retry-terminal-recovery.js.map +1 -1
  79. package/dist/client/retry-utils.d.ts +22 -0
  80. package/dist/client/retry-utils.d.ts.map +1 -1
  81. package/dist/client/retry-utils.js +30 -0
  82. package/dist/client/retry-utils.js.map +1 -1
  83. package/dist/client/send-deadline.d.ts +3 -2
  84. package/dist/client/send-deadline.d.ts.map +1 -1
  85. package/dist/client/send-deadline.js +6 -1
  86. package/dist/client/send-deadline.js.map +1 -1
  87. package/dist/client/send-timestamp.d.ts +71 -14
  88. package/dist/client/send-timestamp.d.ts.map +1 -1
  89. package/dist/client/send-timestamp.js +87 -19
  90. package/dist/client/send-timestamp.js.map +1 -1
  91. package/dist/client/signal-service-cipher.d.ts +125 -13
  92. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  93. package/dist/client/signal-service-cipher.js +413 -102
  94. package/dist/client/signal-service-cipher.js.map +1 -1
  95. package/dist/client/types.d.ts +21 -16
  96. package/dist/client/types.d.ts.map +1 -1
  97. package/dist/client/types.js.map +1 -1
  98. package/dist/index.d.ts +2 -2
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +1 -1
  101. package/dist/index.js.map +1 -1
  102. package/dist/internal/groups/key-sync-ledger.d.ts +65 -0
  103. package/dist/internal/groups/key-sync-ledger.d.ts.map +1 -0
  104. package/dist/internal/groups/key-sync-ledger.js +104 -0
  105. package/dist/internal/groups/key-sync-ledger.js.map +1 -0
  106. package/dist/internal/groups/receive-record.d.ts +4 -1
  107. package/dist/internal/groups/receive-record.d.ts.map +1 -1
  108. package/dist/internal/groups/receive-record.js.map +1 -1
  109. package/dist/internal/session/cipher.d.ts.map +1 -1
  110. package/dist/internal/session/cipher.js +14 -0
  111. package/dist/internal/session/cipher.js.map +1 -1
  112. package/dist/local/store/conformance/cases/durability.d.ts.map +1 -1
  113. package/dist/local/store/conformance/cases/durability.js +6 -0
  114. package/dist/local/store/conformance/cases/durability.js.map +1 -1
  115. package/dist/local/store/conformance/records.d.ts.map +1 -1
  116. package/dist/local/store/conformance/records.js +3 -0
  117. package/dist/local/store/conformance/records.js.map +1 -1
  118. package/dist/local/store/expo/adapter.js +2 -2
  119. package/dist/local/store/expo/adapter.js.map +1 -1
  120. package/dist/local/store/key-value/adapter.d.ts +6 -5
  121. package/dist/local/store/key-value/adapter.d.ts.map +1 -1
  122. package/dist/local/store/key-value/adapter.js +21 -19
  123. package/dist/local/store/key-value/adapter.js.map +1 -1
  124. package/dist/local/store/key-value/receive-work.d.ts +0 -5
  125. package/dist/local/store/key-value/receive-work.d.ts.map +1 -1
  126. package/dist/local/store/key-value/receive-work.js +0 -16
  127. package/dist/local/store/key-value/receive-work.js.map +1 -1
  128. package/dist/local/store/node/adapter.js +2 -2
  129. package/dist/local/store/node/adapter.js.map +1 -1
  130. package/dist/local/store/react-native/adapter.js +2 -2
  131. package/dist/local/store/react-native/adapter.js.map +1 -1
  132. package/dist/local/store/receive-work.d.ts +32 -32
  133. package/dist/local/store/receive-work.d.ts.map +1 -1
  134. package/dist/local/store/receive-work.js +112 -65
  135. package/dist/local/store/receive-work.js.map +1 -1
  136. package/dist/local/store/received-content.d.ts +0 -5
  137. package/dist/local/store/received-content.d.ts.map +1 -1
  138. package/dist/local/store/received-content.js +0 -17
  139. package/dist/local/store/received-content.js.map +1 -1
  140. package/dist/local/store/reliability.d.ts +191 -53
  141. package/dist/local/store/reliability.d.ts.map +1 -1
  142. package/dist/local/store/reliability.js +517 -37
  143. package/dist/local/store/reliability.js.map +1 -1
  144. package/dist/local/store/sqlite/key-storage/metadata.d.ts +1 -8
  145. package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -1
  146. package/dist/local/store/sqlite/key-storage/metadata.js +1 -18
  147. package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -1
  148. package/dist/local/store/sqlite/migrations.d.ts.map +1 -1
  149. package/dist/local/store/sqlite/migrations.js +8 -0
  150. package/dist/local/store/sqlite/migrations.js.map +1 -1
  151. package/dist/local/store/sqlite/store.d.ts +5 -5
  152. package/dist/local/store/sqlite/store.d.ts.map +1 -1
  153. package/dist/local/store/sqlite/store.js +29 -9
  154. package/dist/local/store/sqlite/store.js.map +1 -1
  155. package/dist/local/store/web/adapter.d.ts +11 -10
  156. package/dist/local/store/web/adapter.d.ts.map +1 -1
  157. package/dist/local/store/web/adapter.js +69 -51
  158. package/dist/local/store/web/adapter.js.map +1 -1
  159. package/dist/local/store/web-sqlite/adapter.js +2 -2
  160. package/dist/local/store/web-sqlite/adapter.js.map +1 -1
  161. package/dist/remote/relay/request-admission.d.ts +5 -3
  162. package/dist/remote/relay/request-admission.d.ts.map +1 -1
  163. package/dist/remote/relay/request-admission.js +2 -1
  164. package/dist/remote/relay/request-admission.js.map +1 -1
  165. package/dist/remote/relay/types.d.ts +1 -1
  166. package/dist/types/api.d.ts +50 -71
  167. package/dist/types/api.d.ts.map +1 -1
  168. package/dist/types/errors.d.ts +52 -18
  169. package/dist/types/errors.d.ts.map +1 -1
  170. package/dist/types/errors.js +58 -17
  171. package/dist/types/errors.js.map +1 -1
  172. package/docs/ASSURANCE.md +8 -8
  173. package/docs/CLIENT_COMPOSITION.md +4 -2
  174. package/docs/DEVIATIONS.md +175 -11
  175. package/docs/ERROR_HANDLING.md +38 -23
  176. package/docs/GETTING_STARTED.md +22 -2
  177. package/local/store/README.md +32 -8
  178. package/package.json +7 -2
  179. package/remote/relay/README.md +4 -2
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../client/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAQH,OAAO,KAAK,EAGV,oBAAoB,EACpB,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,UAAU,EAAE,YAA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G,wBAAwB,CAC5B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC,CAEf;IAED;;OAEG;IACG,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpF;IAED;;OAEG;IACG,sBAAsB,CAC1B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,UAAU,EACnB,cAAc,EAAE,UAAU,GACzB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,QAAQ,GAAG,kBAAkB,CAAA;KAAE,CAAC,CAgBtE;IAMD;;OAEG;IACH,OAAO,CAAC,cAAc;CAQvB"}
@@ -69,11 +69,13 @@ import { removeDistributionsFromMessageRecords } from './distribution-records.js
69
69
  import { GroupSenderKeyOperations } from './group-sender-key-operations.js';
70
70
  import { GroupReceiveRefusedError, classifyGroupContent, createGroupMembershipChecker, createGroupReceiveEvaluator, groupOfContext, } from './group-receive-authorization.js';
71
71
  import { GroupFetcher } from './group-fetcher.js';
72
+ import { GroupKeySync, deleteGroupKeySyncWithRecord } from './group-key-sync.js';
73
+ import { bytesToHex } from '../encoding/hex.js';
72
74
  import { envelopeCiphertextBytes, receiveRefusal, reportReceiveRefusal } from './delivery-error.js';
73
75
  import { profileKeyExchange } from './profile-key-exchange.js';
74
76
  import { attachClientMessageId, SignalProtocolServiceCipher, sortEnvelopesForDecryption, } from './signal-service-cipher.js';
75
77
  import { establishMultiDeviceSessions } from '../internal/sesame/device-registry.js';
76
- import { isRetryableDecryptionError } from './retry-utils.js';
78
+ import { isPartialCommitKyberPreKeyUse, isRetryableDecryptionError } from './retry-utils.js';
77
79
  import { envelopeTypeForContent, SealedRetryRequestReceived, unsealMessage } from './sealed-sender.js';
78
80
  import { ResendableContent } from './resendable-content.js';
79
81
  import { decideContentRecovery, readLocalStoreProtection, resolveContentRecoveryPolicy, resolveReceiveQueuePolicy, } from './storage-protection.js';
@@ -89,12 +91,12 @@ import { receiveInRetryFamily } from './retry-family.js';
89
91
  import { RetryRequestScheduler } from './retry-request-lifecycle.js';
90
92
  import { ResendJobDriver } from './recovery-driver.js';
91
93
  import { retryRequestPost } from './retry-request-envelope.js';
92
- import { getOutgoingMessageIntent, migrateOutgoingIntentRecords, migrateRetryRequestRecords, } from '../local/store/reliability.js';
94
+ import { getOutgoingMessageIntent, migrateOutgoingIntentRecords, migrateReceivedTimestampRecords, migrateRetryRequestRecords, } from '../local/store/reliability.js';
93
95
  import { manualResendOutcomeEvent, SEND_END_REPORT, sendOutcomeEvent, } from './send-deadline.js';
94
96
  import { intentContent, SendIntentDriver } from './send-intent-driver.js';
95
- import { checkNewSendTimestamp, SEND_TIMESTAMP_ORIGIN, } from './send-timestamp.js';
97
+ import { checkNewSendTimestamp, releaseNewSendTimestampWithLock, reserveNewSendTimestamp, SEND_TIMESTAMP_ORIGIN, } from './send-timestamp.js';
96
98
  import { deliveredEnvelopeFingerprint } from '../local/store/received-content.js';
97
- import { RECEIVE_WORK_DEFAULT_LIMIT, sizedReceiveWork } from '../local/store/receive-work.js';
99
+ import { RECEIVE_WORK_DEFAULT_LIMIT } from '../local/store/receive-work.js';
98
100
  import { awaitReceiveCompletion, blockReceiveWork, completeReceiveWork, denyReceiveWork, ReceiveQueue, } from './receive-queue.js';
99
101
  import { receiveExpiresAt } from './receive-expiry.js';
100
102
  import { boundReceiveHooks } from './receive-hook-bound.js';
@@ -104,7 +106,6 @@ import { relayReceiptJoinOf } from './relay-receipt-join.js';
104
106
  import { SignalProtocolClientState, SIGNAL_PROTOCOL_CLIENT_CONSTANTS } from './state.js';
105
107
  import { clientRelayFanOut, rethrowRelayWorkStopped, RelayWorkStopped, } from './relay-work.js';
106
108
  import { StaleSessionRefreshError } from './relay-device-refusal.js';
107
- import { createKeyedLocks, withKeyedLock } from '../utils/keyed-lock.js';
108
109
  import { deleteMediaAttachment, resolveMediaAttachment, } from '../media/index.js';
109
110
  import { StorageBackedSignalProtocolClientMedia } from './media.js';
110
111
  // Group state (Signal Private Group System)
@@ -121,12 +122,6 @@ const storageLock = new AsyncLock({
121
122
  timeout: 30000, // 30 second timeout for storage initialization
122
123
  maxPending: 100, // Limit pending operations
123
124
  });
124
- /**
125
- * `decryptGroupMessage` calls for one group message run one at a time per
126
- * local store, from the read of its receive record to its completion, so
127
- * one content is given once.
128
- */
129
- const groupMessageReceiveLocks = createKeyedLocks();
130
125
  /** The reason of a `denied` receive outcome. */
131
126
  function receiveDenialReason(error) {
132
127
  if (error instanceof GroupReceiveRefusedError)
@@ -204,6 +199,7 @@ export class DefaultSignalProtocolClient {
204
199
  groupReceiveEvaluator;
205
200
  /** The single fetcher that brings each group up to its claimed revision. */
206
201
  groupFetcher;
202
+ groupKeySync;
207
203
  /** The current membership that a retry resend of group content needs. */
208
204
  groupMembership;
209
205
  /** The processor of the stored receive records. */
@@ -459,7 +455,8 @@ export class DefaultSignalProtocolClient {
459
455
  if (config?.groups) {
460
456
  const groupConfig = config.groups;
461
457
  // Each client write to a group record reports a changed init status.
462
- this.groupStore = observeGroupInitStatus(config.groups.store ?? new SignalProtocolGroupStateStore(this._storage), {
458
+ // A deleted group record also deletes its key sync ledger value.
459
+ this.groupStore = observeGroupInitStatus(deleteGroupKeySyncWithRecord(config.groups.store ?? new SignalProtocolGroupStateStore(this._storage), this._storage), {
463
460
  isObserved: () => typeof this.hooks.onGroupInitStatus === 'function',
464
461
  report: (groupId, status) => callHook(this.hooks, 'onGroupInitStatus', createGroupId(groupId), status),
465
462
  logger: this.logger,
@@ -589,6 +586,26 @@ export class DefaultSignalProtocolClient {
589
586
  logger: this.logger,
590
587
  });
591
588
  this.groupFetcher = fetcher;
589
+ // Each own device gets the key of each group in a GroupKeySync.
590
+ const keySync = new GroupKeySync({
591
+ storage: this._storage,
592
+ store,
593
+ ...(config.aci?.uuid && { localAci: config.aci.uuid }),
594
+ ownDevices: () => this.cipher.localOwnSyncDevices(),
595
+ send: (input, deviceIds, stopSignal) => this.cipher.sendGroupKeySyncToLocalOtherDevices(input, deviceIds, stopSignal),
596
+ runInBackground: (job) => this.state.relayWork.run((work) => job(work.stopSignal)),
597
+ logger: this.logger,
598
+ });
599
+ this.groupKeySync = keySync;
600
+ this.cipher.setOwnDevicesFirstSeenListener((deviceIds) => {
601
+ void keySync.devicesFirstSeen(deviceIds);
602
+ });
603
+ this.cipher.setGroupKeySyncReceiver(async ({ masterKey, revision }, sender) => {
604
+ const groupId = bytesToHex(deriveGroupSecretParams(masterKey).groupId);
605
+ await fetcher.admitSync(groupId, masterKey, revision);
606
+ // The sender has the key, so this device does not send it back.
607
+ await keySync.receivedFrom(groupId, sender);
608
+ });
592
609
  this.groupReceiveEvaluator = createGroupReceiveEvaluator({
593
610
  store,
594
611
  fetcher,
@@ -944,7 +961,7 @@ export class DefaultSignalProtocolClient {
944
961
  }
945
962
  /**
946
963
  * The session reset steps of a retry request that ended as
947
- * `expired-content` or `posting-deadline`. Their session hooks run through
964
+ * `posting-deadline`. Their session hooks run through
948
965
  * the given context, and its stop signal stops their lock waits and relay
949
966
  * requests. There are none without a relay.
950
967
  */
@@ -1239,6 +1256,7 @@ export class DefaultSignalProtocolClient {
1239
1256
  await client.initialize(retained);
1240
1257
  await client.hydratePersistedState();
1241
1258
  await migrateRetryRequestRecords(client._storage);
1259
+ await migrateReceivedTimestampRecords(client._storage, client.logger);
1242
1260
  await migrateOutgoingIntentRecords(client._storage);
1243
1261
  await client.applyContentRecoveryDecision();
1244
1262
  // A failed sweep fails the start and runs again at the next start.
@@ -1764,10 +1782,11 @@ export class DefaultSignalProtocolClient {
1764
1782
  * - `duplicate`: this client processed the envelope, or the application
1765
1783
  * already has the content of the failed envelope of a retry request.
1766
1784
  * The client acknowledged the envelope.
1767
- * - `null-message`: the envelope carries no content. The client consumed
1768
- * it and acknowledged it. A null message for a failed envelope marks
1769
- * that envelope processed, but a content resend for it that comes later
1770
- * still gives its content.
1785
+ * - `null-message`: the envelope carries no content for the application.
1786
+ * It is a null message, or a `GroupKeySync` from an own device that the
1787
+ * client consumed. The client acknowledged it. A null message for a
1788
+ * failed envelope marks that envelope processed, but a content resend
1789
+ * for it that comes later still gives its content.
1771
1790
  * - `denied`: the client refused the content. The ratchet step is spent,
1772
1791
  * and the client acknowledged the envelope. Content from another
1773
1792
  * account that carries a sync message is denied in any envelope.
@@ -1812,7 +1831,7 @@ export class DefaultSignalProtocolClient {
1812
1831
  ...(after !== undefined && { after }),
1813
1832
  limit: RECEIVE_WORK_DEFAULT_LIMIT,
1814
1833
  });
1815
- const record = page.find((item) => item.origin === 'caller' && (item.messageId ?? item.workId) === messageId);
1834
+ const record = page.find((item) => item.origin === 'caller' && item.messageId === messageId);
1816
1835
  if (record) {
1817
1836
  await this.completeCallerRecord(record.workId);
1818
1837
  return;
@@ -1893,7 +1912,7 @@ export class DefaultSignalProtocolClient {
1893
1912
  ...(after !== undefined && { after }),
1894
1913
  limit: RECEIVE_WORK_DEFAULT_LIMIT,
1895
1914
  });
1896
- record = page.find((item) => item.stage !== 'receipt-due' && (item.messageId ?? item.workId) === messageId);
1915
+ record = page.find((item) => item.stage !== 'receipt-due' && item.messageId === messageId);
1897
1916
  if (record === undefined && page.length < RECEIVE_WORK_DEFAULT_LIMIT)
1898
1917
  return null;
1899
1918
  const last = page[page.length - 1];
@@ -2001,25 +2020,22 @@ export class DefaultSignalProtocolClient {
2001
2020
  * Receive one envelope that the application passed. The queue skips its
2002
2021
  * record while the receive runs, and runs a pass after it.
2003
2022
  *
2004
- * @param direct - The group and the receive record ID of a framed group
2005
- * message that `decryptGroupMessage` passed. A decrypt failure then
2006
- * throws with no retry request and no report.
2007
2023
  * @returns The outcome, and the error behind a `pending` or `denied`
2008
2024
  * outcome
2009
2025
  */
2010
- async receiveForCaller(envelope, options, direct) {
2026
+ async receiveForCaller(envelope, options) {
2011
2027
  if (envelope.messageType === 'retry_request') {
2012
2028
  throw new EncryptionError('A retry_request envelope holds no plaintext; give it to receiveIncomingEnvelopes', EncryptionErrorCode.INVALID_CIPHERTEXT, { messageType: envelope.messageType, senderId: envelope.senderUserId });
2013
2029
  }
2014
2030
  // The fingerprint covers the envelope as the Relay delivered it, before
2015
2031
  // any unseal, so every receive path stores one value for it.
2016
- const workId = direct?.workId ?? (await deliveredEnvelopeFingerprint(this.userId, this.deviceId, envelope));
2032
+ const workId = await deliveredEnvelopeFingerprint(this.userId, this.deviceId, envelope);
2017
2033
  const release = this.receiveQueue.hold(workId);
2018
2034
  try {
2019
2035
  // The record sorts after the stored records once the resume ends. The
2020
2036
  // wait comes before the retry family lock, which the resume also takes.
2021
2037
  await this.receiveQueue.seeded();
2022
- return await receiveInRetryFamily(this._storage, this.logger, this.hooks, envelope, (family) => this.receiveForCallerLocked(envelope, family, workId, options, direct));
2038
+ return await receiveInRetryFamily(this._storage, this.logger, this.hooks, envelope, (family) => this.receiveForCallerLocked(envelope, family, workId, options));
2023
2039
  }
2024
2040
  finally {
2025
2041
  release();
@@ -2027,7 +2043,7 @@ export class DefaultSignalProtocolClient {
2027
2043
  }
2028
2044
  }
2029
2045
  /** Receive one envelope that the application passed, under its retry family lock. */
2030
- async receiveForCallerLocked(envelope, family, workId, options, direct) {
2046
+ async receiveForCallerLocked(envelope, family, workId, options) {
2031
2047
  // The processed record of an envelope with no ID has no key.
2032
2048
  const receiveId = envelope.id ? workId : undefined;
2033
2049
  let record = await this._storage.getReceiveWork(workId);
@@ -2037,22 +2053,15 @@ export class DefaultSignalProtocolClient {
2037
2053
  await this.markMessageDeliveredSilently(envelope.id, options);
2038
2054
  return { outcome: { kind: 'duplicate' } };
2039
2055
  }
2040
- if (!record.awaitingEnvelope) {
2041
- // The receive queue delivers a Relay record to onMessageDecrypted.
2042
- if (record.origin === 'relay') {
2043
- return {
2044
- outcome: { kind: 'pending', messageId: record.messageId ?? workId, reason: 'queued' },
2045
- };
2046
- }
2047
- // A redelivery of content that waits for completeReceive.
2048
- if (record.stage === 'awaiting-completion') {
2049
- return { outcome: await this.processedReceive(record, options) };
2050
- }
2056
+ // The receive queue delivers a Relay record to onMessageDecrypted.
2057
+ if (record.origin === 'relay') {
2058
+ return {
2059
+ outcome: { kind: 'pending', messageId: record.messageId, reason: 'queued' },
2060
+ };
2051
2061
  }
2052
- else {
2053
- // A converted legacy record gets its sender from this envelope.
2054
- const opened = await this.openForCaller(envelope, family, receiveId, options);
2055
- record = await this.fillAwaitingRecord(record, family, workId, opened);
2062
+ // A redelivery of content that waits for completeReceive.
2063
+ if (record.stage === 'awaiting-completion') {
2064
+ return { outcome: await this.processedReceive(record, options) };
2056
2065
  }
2057
2066
  }
2058
2067
  else {
@@ -2061,7 +2070,7 @@ export class DefaultSignalProtocolClient {
2061
2070
  return { outcome: { kind: 'duplicate' } };
2062
2071
  }
2063
2072
  const opened = await this.openForCaller(envelope, family, receiveId, options);
2064
- const decrypted = await this.decryptForCaller(envelope, opened, family, workId, options, direct);
2073
+ const decrypted = await this.decryptForCaller(envelope, opened, family, workId, options);
2065
2074
  if ('outcome' in decrypted)
2066
2075
  return decrypted;
2067
2076
  record = decrypted.record;
@@ -2095,6 +2104,13 @@ export class DefaultSignalProtocolClient {
2095
2104
  content.inspected.senderKeyDistributionOnly === false,
2096
2105
  ...RelaySubscriptionOps.groupOfFulfill(content),
2097
2106
  });
2107
+ // A GroupKeySync from an own device is SDK content, so the caller
2108
+ // never gets it.
2109
+ if (await this.cipher.consumeGroupKeySync(content)) {
2110
+ await completeReceiveWork(this.ctx, record);
2111
+ await this.markMessageDeliveredSilently(envelope.id, options);
2112
+ return { outcome: { kind: 'null-message' } };
2113
+ }
2098
2114
  const decision = await this.cipher.decideGroupContent(content);
2099
2115
  if (decision.kind === 'denied') {
2100
2116
  await denyReceiveWork(this.ctx, record, content, decision.error);
@@ -2172,34 +2188,6 @@ export class DefaultSignalProtocolClient {
2172
2188
  receiptJoin: false,
2173
2189
  });
2174
2190
  }
2175
- /**
2176
- * Fill the sender fields of a converted legacy record from the envelope
2177
- * that the application passed. The record keeps its age and its arrival
2178
- * order, and becomes a helper record.
2179
- */
2180
- async fillAwaitingRecord(existing, family, workId, opened) {
2181
- const { inner, arrivedSealed } = opened;
2182
- const groupId = existing.groupId ??
2183
- (inner.messageType === 'sender_key'
2184
- ? ((await this.senderKeyManager.resolveGroupForFramedMessage(envelopeCiphertextBytes(inner.ciphertext), inner.senderUserId, inner.senderDeviceId)) ?? undefined)
2185
- : undefined);
2186
- const seed = this.callerReceiveCommit(family, workId).commit.seed(this.relayEnvelopeOf(inner), arrivedSealed);
2187
- const filled = sizedReceiveWork({
2188
- ...seed({ plaintext: existing.plaintext, ...(groupId !== undefined && { groupId }) }),
2189
- workId: existing.workId,
2190
- revision: existing.revision + 1,
2191
- stage: existing.stage,
2192
- arrivalSeq: existing.arrivalSeq,
2193
- receivedAt: existing.receivedAt,
2194
- dueAt: existing.dueAt,
2195
- plaintext: existing.plaintext,
2196
- ...(groupId !== undefined && { groupId }),
2197
- ...(existing.blockedOn !== undefined && { blockedOn: existing.blockedOn }),
2198
- });
2199
- if (await this._storage.putReceiveWork(filled, existing.revision))
2200
- return filled;
2201
- return (await this._storage.getReceiveWork(workId)) ?? existing;
2202
- }
2203
2191
  /**
2204
2192
  * Decrypt one opened envelope under the receive admission, and commit its
2205
2193
  * receive record with the ratchet step.
@@ -2210,11 +2198,13 @@ export class DefaultSignalProtocolClient {
2210
2198
  * the outcome is `denied`. A retryable failure (per SESAME spec §4.1)
2211
2199
  * sends a retry request, which acknowledges the envelope, and throws. A
2212
2200
  * failure after the decrypt built the record is a store failure: it
2213
- * throws with no request, and the ratchet step rolled back.
2201
+ * throws with no request, and the ratchet step rolled back. A refused
2202
+ * Kyber prekey use with no session for its base key is retryable, as
2203
+ * `isPartialCommitKyberPreKeyUse` tells.
2214
2204
  *
2215
2205
  * @returns The committed record, or the outcome when nothing committed
2216
2206
  */
2217
- async decryptForCaller(envelope, opened, family, workId, options, direct) {
2207
+ async decryptForCaller(envelope, opened, family, workId, options) {
2218
2208
  const { inner, arrivedSealed } = opened;
2219
2209
  const receiveId = envelope.id ? workId : undefined;
2220
2210
  const handle = this.callerReceiveCommit(family, workId);
@@ -2227,9 +2217,8 @@ export class DefaultSignalProtocolClient {
2227
2217
  // does not say which group, so the group comes from the frame's
2228
2218
  // distribution identifier resolved against the local sender key
2229
2219
  // store.
2230
- const framed = direct?.framed ?? envelopeCiphertextBytes(inner.ciphertext);
2231
- const groupId = direct?.groupId ??
2232
- (await this.senderKeyManager.resolveGroupForFramedMessage(framed, inner.senderUserId, inner.senderDeviceId));
2220
+ const framed = envelopeCiphertextBytes(inner.ciphertext);
2221
+ const groupId = await this.senderKeyManager.resolveGroupForFramedMessage(framed, inner.senderUserId, inner.senderDeviceId);
2233
2222
  if (groupId === null) {
2234
2223
  throw new EncryptionError(`No sender key from ${inner.senderUserId} matches this group message - request key distribution`, EncryptionErrorCode.SESSION_NOT_FOUND);
2235
2224
  }
@@ -2252,7 +2241,9 @@ export class DefaultSignalProtocolClient {
2252
2241
  }
2253
2242
  }
2254
2243
  catch (error) {
2255
- if (handle.seeded() || direct !== undefined)
2244
+ // A Kyber prekey use without a session is a partial-commit artifact,
2245
+ // not a store failure that a redelivery repairs.
2246
+ if (handle.seeded() && !isPartialCommitKyberPreKeyUse(error))
2256
2247
  throw error;
2257
2248
  if (receiveRefusal(error) !== null) {
2258
2249
  await reportReceiveRefusal(this._storage, this.hooks, inner, error, receiveId, failure.reported);
@@ -2287,7 +2278,7 @@ export class DefaultSignalProtocolClient {
2287
2278
  kind: 'processed',
2288
2279
  // The caller gets the content as its sender gave it.
2289
2280
  plaintext: this.contentAdapter.withoutGroupContext(record.plaintext),
2290
- messageId: record.messageId ?? record.workId,
2281
+ messageId: record.messageId,
2291
2282
  ...(record.groupId !== undefined && { groupId: extractGroupId(record.groupId) }),
2292
2283
  };
2293
2284
  if (options?.onPersist) {
@@ -2326,14 +2317,12 @@ export class DefaultSignalProtocolClient {
2326
2317
  pendingReceiveOf(record) {
2327
2318
  const ready = record.stage === 'awaiting-completion';
2328
2319
  return {
2329
- // A converted legacy record has no message ID. Its outcomes give the
2330
- // record ID, as `completeReceive` matches.
2331
- messageId: record.messageId ?? record.workId,
2320
+ messageId: record.messageId,
2332
2321
  stage: ready ? 'awaiting-completion' : 'decrypted',
2333
2322
  origin: record.origin,
2334
2323
  receivedAt: record.receivedAt,
2335
- ...(record.senderUserId !== undefined && { senderId: record.senderUserId }),
2336
- ...(record.senderDeviceId !== undefined && { senderDeviceId: record.senderDeviceId }),
2324
+ senderId: record.senderUserId,
2325
+ senderDeviceId: record.senderDeviceId,
2337
2326
  ...(record.groupId !== undefined && { groupId: extractGroupId(record.groupId) }),
2338
2327
  ...(ready &&
2339
2328
  record.plaintext !== undefined && {
@@ -2610,7 +2599,11 @@ export class DefaultSignalProtocolClient {
2610
2599
  // that repeats a stored intent keeps the stored timestamp, which can be
2611
2600
  // outside the window, so a refused value passes only when a stored intent
2612
2601
  // for this identifier holds the same timestamp. The mark stops the inner
2613
- // checks of this send.
2602
+ // checks of this send. A new DataMessage send also reserves its timestamp
2603
+ // here, because the serialized message holds it. A new send with an
2604
+ // application timestamp reserves it here too, before the profile key
2605
+ // offer, so the profile key update cannot take that value. The inner
2606
+ // reservation of the send then finds the entry with its own ID.
2614
2607
  const applicationTimestamp = isDataMessage(content)
2615
2608
  ? content.timestamp
2616
2609
  : options?.timestamp;
@@ -2622,6 +2615,7 @@ export class DefaultSignalProtocolClient {
2622
2615
  : profileKeyExchange(this);
2623
2616
  let profileKey;
2624
2617
  let timestampOrigin;
2618
+ let reservation;
2625
2619
  let result;
2626
2620
  // A receipt for this send waits until the send resolves. The hold starts
2627
2621
  // before the stored-intent read, so a receipt for a replay of a sent
@@ -2649,9 +2643,20 @@ export class DefaultSignalProtocolClient {
2649
2643
  throw error;
2650
2644
  }
2651
2645
  }
2646
+ if (!stored && (isDataMessage(content) || applicationTimestamp != null)) {
2647
+ reservation = await reserveNewSendTimestamp(this._storage, {
2648
+ clientMessageId,
2649
+ timestamp: applicationTimestamp,
2650
+ [SEND_TIMESTAMP_ORIGIN]: timestampOrigin,
2651
+ });
2652
+ timestampOrigin = 'checked';
2653
+ }
2652
2654
  if (isDataMessage(content)) {
2653
2655
  // DataMessage path: build Content, set timestamp, serialize to protobuf (application send-pipeline ordering)
2654
- const timestamp = content.timestamp ?? stored?.clientTimestamp ?? Date.now();
2656
+ const timestamp = reservation?.timestamp ??
2657
+ content.timestamp ??
2658
+ stored?.clientTimestamp ??
2659
+ Date.now();
2655
2660
  clientTimestamp = timestamp;
2656
2661
  profileKey = await profileKeys?.outgoing();
2657
2662
  const dm = { ...content, timestamp, ...(profileKey && { profileKey }) };
@@ -2688,6 +2693,23 @@ export class DefaultSignalProtocolClient {
2688
2693
  ? this.withDeferredHooks(context, encrypt)
2689
2694
  : encrypt(context));
2690
2695
  }
2696
+ catch (error) {
2697
+ // A send that failed before its intent write removes its reservation.
2698
+ // A stored intent with the reserved timestamp keeps it. A failed
2699
+ // release does not replace the error of the send.
2700
+ if (reservation) {
2701
+ try {
2702
+ await releaseNewSendTimestampWithLock(this._storage, reservation);
2703
+ }
2704
+ catch (releaseError) {
2705
+ this.logger.warn('Failed to release the send timestamp reservation', {
2706
+ category: 'E2EE',
2707
+ data: { clientMessageId, error: releaseError.message },
2708
+ });
2709
+ }
2710
+ }
2711
+ throw error;
2712
+ }
2691
2713
  finally {
2692
2714
  this.deliveries.endSend(clientMessageId);
2693
2715
  }
@@ -2699,7 +2721,7 @@ export class DefaultSignalProtocolClient {
2699
2721
  await profileKeys?.delivered(recipientId, profileKey);
2700
2722
  if (protocolError)
2701
2723
  await callHook(context.hooks, 'onRelayProtocolError', protocolError);
2702
- return clientTimestamp !== undefined ? { ...result, clientTimestamp } : result;
2724
+ return result;
2703
2725
  }
2704
2726
  /** @see SignalProtocolClient.resendMessage */
2705
2727
  async resendMessage(clientMessageId) {
@@ -2967,6 +2989,7 @@ export class DefaultSignalProtocolClient {
2967
2989
  data: { behavior: 'GROUP_FETCH_START_FAILED', error: error.message },
2968
2990
  });
2969
2991
  });
2992
+ void this.groupKeySync?.start();
2970
2993
  void this.resendJobs.start();
2971
2994
  const relay = this.relay;
2972
2995
  if (this.resendJobsOnConnect === undefined && relay) {
@@ -3257,6 +3280,7 @@ export class DefaultSignalProtocolClient {
3257
3280
  this.resendJobs.stop();
3258
3281
  this.sendIntents.stop();
3259
3282
  this.groupFetcher?.stop();
3283
+ this.groupKeySync?.stop();
3260
3284
  this.receiveQueue.stop();
3261
3285
  this.resendJobsOnConnect?.();
3262
3286
  this.resendJobsOnConnect = undefined;
@@ -3492,6 +3516,16 @@ export class DefaultSignalProtocolClient {
3492
3516
  * use this to encrypt messages. All group members can decrypt
3493
3517
  * the same ciphertext, making it efficient for large groups.
3494
3518
  *
3519
+ * This primitive adds no group context and checks no group master key.
3520
+ * Unless the plaintext carries a group context, a
3521
+ * `processIncomingEnvelope` receiver denies the output for a managed
3522
+ * group. A receiver with a `groups` config gives the reason
3523
+ * `legacy-no-context`, or `blocked` when the group is blocked. A receiver
3524
+ * with no `groups` config refuses the output with a
3525
+ * `GroupReceiveRefusedError` of reason `configuration`. Send managed group
3526
+ * content with `send`. A caller that delivers the bytes itself decrypts
3527
+ * them with `decryptEnvelope`, as a `sender_key` envelope.
3528
+ *
3495
3529
  * @param groupId - Group identifier
3496
3530
  * @param plaintext - Message to encrypt
3497
3531
  * @returns Framed SenderKeyMessage bytes
@@ -3512,83 +3546,6 @@ export class DefaultSignalProtocolClient {
3512
3546
  ? (candidateGroupId) => this.groupManager.assertGroupSendAllowed(candidateGroupId)
3513
3547
  : undefined));
3514
3548
  }
3515
- /**
3516
- * Decrypt a group message from a sender
3517
- *
3518
- * Use this to decrypt messages from other group members.
3519
- * You must process the sender's distribution message first.
3520
- *
3521
- * The message passes the group decision of `processIncomingEnvelope`.
3522
- * Content whose group state must update first stays stored, and a later
3523
- * call with the same message decides it with no second decrypt.
3524
- *
3525
- * @deprecated Use `processIncomingEnvelope`, which returns a receive
3526
- * outcome and keeps the content until the application completes the
3527
- * receive. This method completes the receive before it returns, so a
3528
- * plaintext that the application loses is gone.
3529
- *
3530
- * @param groupId - Group identifier
3531
- * @param senderId - Sender's user ID
3532
- * @param senderDeviceId - Sender's device ID
3533
- * @param framedMessage - Framed SenderKeyMessage bytes
3534
- * @returns Decrypted plaintext
3535
- * @throws GroupReceiveUnavailableError when the group state of the content
3536
- * is not current. Its `messageId` names the stored receive. Call again
3537
- * later with the same message.
3538
- * @throws GroupReceiveRefusedError when the client refuses the content
3539
- * @throws EncryptionError MESSAGE_DUPLICATE for a message that this client
3540
- * processed, or that carries no content, and STORAGE_QUOTA_EXCEEDED when
3541
- * the receive queue has no room
3542
- *
3543
- * @example
3544
- * ```typescript
3545
- * const plaintext = await signal.decryptGroupMessage(
3546
- * 'group-123',
3547
- * senderId,
3548
- * senderDeviceId,
3549
- * encryptedMessage
3550
- * );
3551
- * console.log('Message:', plaintext);
3552
- * ```
3553
- */
3554
- async decryptGroupMessage(groupId, senderId, senderDeviceId, framedMessage) {
3555
- // The message has no envelope ID, so its receive record ID binds the
3556
- // sender and the framed bytes.
3557
- const ciphertext = bytesToBase64(framedMessage);
3558
- const workId = await deliveredEnvelopeFingerprint(this.userId, this.deviceId, {
3559
- senderUserId: senderId,
3560
- senderDeviceId,
3561
- messageType: 'sender_key',
3562
- ciphertext,
3563
- });
3564
- // A concurrent call with the same message waits here, and then reads
3565
- // the record that the first call left, as a later call does.
3566
- return withKeyedLock(groupMessageReceiveLocks, this._storage, workId, async () => {
3567
- const { outcome, error } = await this.receiveForCaller({
3568
- id: '',
3569
- senderUserId: senderId,
3570
- senderDeviceId,
3571
- ciphertext,
3572
- timestamp: Date.now(),
3573
- messageType: 'sender_key',
3574
- }, undefined, { groupId, workId, framed: framedMessage });
3575
- switch (outcome.kind) {
3576
- case 'processed':
3577
- await this.completeCallerRecord(workId);
3578
- return outcome.plaintext;
3579
- case 'pending':
3580
- case 'denied':
3581
- if (error)
3582
- throw error;
3583
- break;
3584
- case 'refused':
3585
- throw new EncryptionError('The receive queue has no room for this group message', EncryptionErrorCode.STORAGE_QUOTA_EXCEEDED, { senderId });
3586
- default:
3587
- break;
3588
- }
3589
- throw new EncryptionError('This group message gives no content', EncryptionErrorCode.MESSAGE_DUPLICATE, { senderId });
3590
- });
3591
- }
3592
3549
  /**
3593
3550
  * Rotate sender key for a group (forward secrecy on membership changes).
3594
3551
  *
@@ -3897,7 +3854,9 @@ export class DefaultSignalProtocolClient {
3897
3854
  * Create a new group.
3898
3855
  */
3899
3856
  async createGroup(creatorAci, creatorProfileKey, members, title, options) {
3900
- return GroupOps.createGroup(this.ctx, await this.groups, creatorAci, creatorProfileKey, members, title, options);
3857
+ const created = await GroupOps.createGroup(this.ctx, await this.groups, creatorAci, creatorProfileKey, members, title, options);
3858
+ void this.groupKeySync?.groupJoined(extractGroupId(created.groupId));
3859
+ return created;
3901
3860
  }
3902
3861
  /**
3903
3862
  * Get decrypted group state (from cache or server).
@@ -3936,7 +3895,8 @@ export class DefaultSignalProtocolClient {
3936
3895
  }
3937
3896
  /** Accept this client's pending profile-key invitation. */
3938
3897
  async acceptGroupMemberInvitation(groupId) {
3939
- return GroupOps.acceptGroupMemberInvitation(this.ctx, await this.groups, groupId);
3898
+ await GroupOps.acceptGroupMemberInvitation(this.ctx, await this.groups, groupId);
3899
+ void this.groupKeySync?.groupJoined(extractGroupId(groupId));
3940
3900
  }
3941
3901
  /**
3942
3902
  * Decline this account's ACI- or PNI-keyed pending invitation.
@@ -3984,7 +3944,15 @@ export class DefaultSignalProtocolClient {
3984
3944
  * Join a group via invite link.
3985
3945
  */
3986
3946
  async joinGroupViaInviteLink(url, userAci, userProfileKey) {
3987
- return GroupOps.joinGroupViaInviteLink(this.ctx, await this.groups, url, userAci, userProfileKey);
3947
+ const joined = await GroupOps.joinGroupViaInviteLink(this.ctx, await this.groups, url, userAci, userProfileKey);
3948
+ // Only a join with membership sends the key now. A join that waits for
3949
+ // approval or fails stores the master key and no state, so no pass sends
3950
+ // its key until its state arrives. The next start, join or first sight
3951
+ // of an own device after that sends it.
3952
+ if (joined.status === 'joined') {
3953
+ void this.groupKeySync?.groupJoined(extractGroupId(joined.groupId));
3954
+ }
3955
+ return joined;
3988
3956
  }
3989
3957
  // ============================================================================
3990
3958
  // PRIVATE METHODS