@open-e2ee/signal-protocol-sdk 8.0.0 → 8.2.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 (199) hide show
  1. package/ADAPTERS.md +2 -2
  2. package/CHANGELOG.md +188 -0
  3. package/README.md +4 -4
  4. package/SECURITY.md +2 -2
  5. package/device/README.md +16 -7
  6. package/dist/client/client.d.ts +4 -2
  7. package/dist/client/client.d.ts.map +1 -1
  8. package/dist/client/client.js +25 -19
  9. package/dist/client/client.js.map +1 -1
  10. package/dist/client/group-outbox.d.ts +31 -1
  11. package/dist/client/group-outbox.d.ts.map +1 -1
  12. package/dist/client/group-outbox.js +67 -58
  13. package/dist/client/group-outbox.js.map +1 -1
  14. package/dist/client/hosted-anonymous-delivery.d.ts +9 -1
  15. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  16. package/dist/client/hosted-anonymous-delivery.js +61 -22
  17. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  18. package/dist/client/hosted-transport.d.ts +16 -0
  19. package/dist/client/hosted-transport.d.ts.map +1 -1
  20. package/dist/client/hosted-transport.js +93 -19
  21. package/dist/client/hosted-transport.js.map +1 -1
  22. package/dist/client/key-rotation.d.ts.map +1 -1
  23. package/dist/client/key-rotation.js +2 -4
  24. package/dist/client/key-rotation.js.map +1 -1
  25. package/dist/client/prekeys.d.ts.map +1 -1
  26. package/dist/client/prekeys.js +1 -1
  27. package/dist/client/prekeys.js.map +1 -1
  28. package/dist/client/relay-device-refusal.d.ts +32 -0
  29. package/dist/client/relay-device-refusal.d.ts.map +1 -0
  30. package/dist/client/relay-device-refusal.js +36 -0
  31. package/dist/client/relay-device-refusal.js.map +1 -0
  32. package/dist/client/relay-work.d.ts +26 -0
  33. package/dist/client/relay-work.d.ts.map +1 -1
  34. package/dist/client/relay-work.js +37 -0
  35. package/dist/client/relay-work.js.map +1 -1
  36. package/dist/client/sealed-sender.d.ts.map +1 -1
  37. package/dist/client/sealed-sender.js +12 -17
  38. package/dist/client/sealed-sender.js.map +1 -1
  39. package/dist/client/sessions.d.ts.map +1 -1
  40. package/dist/client/sessions.js +2 -4
  41. package/dist/client/sessions.js.map +1 -1
  42. package/dist/client/signal-service-cipher.d.ts +90 -4
  43. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  44. package/dist/client/signal-service-cipher.js +425 -136
  45. package/dist/client/signal-service-cipher.js.map +1 -1
  46. package/dist/client/types.d.ts +7 -0
  47. package/dist/client/types.d.ts.map +1 -1
  48. package/dist/client/types.js.map +1 -1
  49. package/dist/internal/manager/manager.d.ts +8 -7
  50. package/dist/internal/manager/manager.d.ts.map +1 -1
  51. package/dist/internal/manager/manager.js +34 -36
  52. package/dist/internal/manager/manager.js.map +1 -1
  53. package/dist/internal/protocol/spqr/index.d.ts +1 -1
  54. package/dist/internal/protocol/spqr/index.d.ts.map +1 -1
  55. package/dist/internal/protocol/spqr/index.js +2 -2
  56. package/dist/internal/protocol/spqr/index.js.map +1 -1
  57. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts.map +1 -1
  58. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js +1 -3
  59. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js.map +1 -1
  60. package/dist/internal/protocol/spqr/serialize.d.ts.map +1 -1
  61. package/dist/internal/protocol/spqr/serialize.js +1 -4
  62. package/dist/internal/protocol/spqr/serialize.js.map +1 -1
  63. package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
  64. package/dist/internal/protocol/spqr/spqr.js +1 -2
  65. package/dist/internal/protocol/spqr/spqr.js.map +1 -1
  66. package/dist/internal/protocol/zk/credentials/attributes.d.ts.map +1 -1
  67. package/dist/internal/protocol/zk/credentials/attributes.js +2 -1
  68. package/dist/internal/protocol/zk/credentials/attributes.js.map +1 -1
  69. package/dist/internal/protocol/zk/credentials/credentials.d.ts.map +1 -1
  70. package/dist/internal/protocol/zk/credentials/credentials.js +8 -6
  71. package/dist/internal/protocol/zk/credentials/credentials.js.map +1 -1
  72. package/dist/internal/protocol/zk/credentials/presentation.d.ts.map +1 -1
  73. package/dist/internal/protocol/zk/credentials/presentation.js +19 -13
  74. package/dist/internal/protocol/zk/credentials/presentation.js.map +1 -1
  75. package/dist/internal/protocol/zk/groups/lizard.d.ts +8 -0
  76. package/dist/internal/protocol/zk/groups/lizard.d.ts.map +1 -1
  77. package/dist/internal/protocol/zk/groups/lizard.js +18 -5
  78. package/dist/internal/protocol/zk/groups/lizard.js.map +1 -1
  79. package/dist/internal/protocol/zk/groups/profile-key-commitment.d.ts.map +1 -1
  80. package/dist/internal/protocol/zk/groups/profile-key-commitment.js +7 -6
  81. package/dist/internal/protocol/zk/groups/profile-key-commitment.js.map +1 -1
  82. package/dist/internal/protocol/zk/groups/profile-key-encryption.d.ts.map +1 -1
  83. package/dist/internal/protocol/zk/groups/profile-key-encryption.js +3 -2
  84. package/dist/internal/protocol/zk/groups/profile-key-encryption.js.map +1 -1
  85. package/dist/internal/protocol/zk/groups/uid-encryption.d.ts.map +1 -1
  86. package/dist/internal/protocol/zk/groups/uid-encryption.js +3 -2
  87. package/dist/internal/protocol/zk/groups/uid-encryption.js.map +1 -1
  88. package/dist/internal/protocol/zk/proofs/point-multiplication.d.ts +53 -0
  89. package/dist/internal/protocol/zk/proofs/point-multiplication.d.ts.map +1 -0
  90. package/dist/internal/protocol/zk/proofs/point-multiplication.js +164 -0
  91. package/dist/internal/protocol/zk/proofs/point-multiplication.js.map +1 -0
  92. package/dist/internal/protocol/zk/proofs/sho.d.ts +1 -0
  93. package/dist/internal/protocol/zk/proofs/sho.d.ts.map +1 -1
  94. package/dist/internal/protocol/zk/proofs/sho.js.map +1 -1
  95. package/dist/internal/protocol/zk/proofs/statement.d.ts.map +1 -1
  96. package/dist/internal/protocol/zk/proofs/statement.js +11 -11
  97. package/dist/internal/protocol/zk/proofs/statement.js.map +1 -1
  98. package/dist/internal/sesame/device-registry.d.ts +24 -4
  99. package/dist/internal/sesame/device-registry.d.ts.map +1 -1
  100. package/dist/internal/sesame/device-registry.js +55 -28
  101. package/dist/internal/sesame/device-registry.js.map +1 -1
  102. package/dist/internal/sesame/manager.d.ts +79 -11
  103. package/dist/internal/sesame/manager.d.ts.map +1 -1
  104. package/dist/internal/sesame/manager.js +381 -280
  105. package/dist/internal/sesame/manager.js.map +1 -1
  106. package/dist/internal/session/cipher.d.ts +0 -5
  107. package/dist/internal/session/cipher.d.ts.map +1 -1
  108. package/dist/internal/session/cipher.js +3 -9
  109. package/dist/internal/session/cipher.js.map +1 -1
  110. package/dist/internal/session/record-locks.d.ts +46 -0
  111. package/dist/internal/session/record-locks.d.ts.map +1 -0
  112. package/dist/internal/session/record-locks.js +72 -0
  113. package/dist/internal/session/record-locks.js.map +1 -0
  114. package/dist/local/store/expo/adapter.d.ts +8 -2
  115. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  116. package/dist/local/store/expo/adapter.js +24 -3
  117. package/dist/local/store/expo/adapter.js.map +1 -1
  118. package/dist/local/store/expo/driver.d.ts +7 -0
  119. package/dist/local/store/expo/driver.d.ts.map +1 -1
  120. package/dist/local/store/expo/driver.js +16 -0
  121. package/dist/local/store/expo/driver.js.map +1 -1
  122. package/dist/local/store/index.d.ts +2 -2
  123. package/dist/local/store/index.js +2 -2
  124. package/dist/local/store/key-value/adapter.d.ts.map +1 -1
  125. package/dist/local/store/key-value/adapter.js +61 -38
  126. package/dist/local/store/key-value/adapter.js.map +1 -1
  127. package/dist/local/store/memory/adapter.d.ts +10 -0
  128. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  129. package/dist/local/store/memory/adapter.js +79 -55
  130. package/dist/local/store/memory/adapter.js.map +1 -1
  131. package/dist/local/store/reliability.d.ts +16 -0
  132. package/dist/local/store/reliability.d.ts.map +1 -1
  133. package/dist/local/store/reliability.js +58 -28
  134. package/dist/local/store/reliability.js.map +1 -1
  135. package/dist/local/store/sqlite/store.d.ts.map +1 -1
  136. package/dist/local/store/sqlite/store.js +36 -14
  137. package/dist/local/store/sqlite/store.js.map +1 -1
  138. package/dist/local/store/sqlite/web/driver.d.ts.map +1 -1
  139. package/dist/local/store/sqlite/web/driver.js +3 -1
  140. package/dist/local/store/sqlite/web/driver.js.map +1 -1
  141. package/dist/local/store/sqlite/web/protocol.d.ts +1 -1
  142. package/dist/local/store/sqlite/web/protocol.d.ts.map +1 -1
  143. package/dist/local/store/sqlite/web/worker.d.ts +7 -4
  144. package/dist/local/store/sqlite/web/worker.d.ts.map +1 -1
  145. package/dist/local/store/sqlite/web/worker.js +48 -18
  146. package/dist/local/store/sqlite/web/worker.js.map +1 -1
  147. package/dist/local/store/web/adapter.d.ts.map +1 -1
  148. package/dist/local/store/web/adapter.js +63 -53
  149. package/dist/local/store/web/adapter.js.map +1 -1
  150. package/dist/local/store/web-sqlite/adapter.d.ts +3 -0
  151. package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -1
  152. package/dist/local/store/web-sqlite/adapter.js +3 -0
  153. package/dist/local/store/web-sqlite/adapter.js.map +1 -1
  154. package/dist/local/vault/electron-safe-storage.d.ts.map +1 -1
  155. package/dist/local/vault/electron-safe-storage.js +15 -2
  156. package/dist/local/vault/electron-safe-storage.js.map +1 -1
  157. package/dist/profile/index.d.ts +2 -1
  158. package/dist/profile/index.d.ts.map +1 -1
  159. package/dist/profile/index.js +2 -1
  160. package/dist/profile/index.js.map +1 -1
  161. package/dist/profile/own-profile-key.d.ts +42 -0
  162. package/dist/profile/own-profile-key.d.ts.map +1 -0
  163. package/dist/profile/own-profile-key.js +64 -0
  164. package/dist/profile/own-profile-key.js.map +1 -0
  165. package/dist/profile/profile-key.d.ts +1 -34
  166. package/dist/profile/profile-key.d.ts.map +1 -1
  167. package/dist/profile/profile-key.js +3 -63
  168. package/dist/profile/profile-key.js.map +1 -1
  169. package/dist/profile/update-service.js +1 -1
  170. package/dist/profile/update-service.js.map +1 -1
  171. package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
  172. package/dist/remote/relay/memory/adapter.js +3 -4
  173. package/dist/remote/relay/memory/adapter.js.map +1 -1
  174. package/dist/username/link.d.ts.map +1 -1
  175. package/dist/username/link.js +1 -5
  176. package/dist/username/link.js.map +1 -1
  177. package/dist/utils/bounded-fan-out.d.ts +99 -0
  178. package/dist/utils/bounded-fan-out.d.ts.map +1 -0
  179. package/dist/utils/bounded-fan-out.js +180 -0
  180. package/dist/utils/bounded-fan-out.js.map +1 -0
  181. package/dist/utils/keyed-lock.d.ts +16 -0
  182. package/dist/utils/keyed-lock.d.ts.map +1 -0
  183. package/dist/utils/keyed-lock.js +39 -0
  184. package/dist/utils/keyed-lock.js.map +1 -0
  185. package/docs/ASSURANCE.md +68 -24
  186. package/docs/DEVIATIONS.md +21 -2
  187. package/docs/ERROR_HANDLING.md +1 -1
  188. package/docs/PACKAGE_SURFACE.md +3 -1
  189. package/examples/browser/index.html +1 -1
  190. package/hooks/README.md +11 -2
  191. package/local/store/README.md +41 -21
  192. package/local/store/expo/README.md +18 -5
  193. package/local/store/key-value/README.md +5 -3
  194. package/local/store/node/README.md +2 -1
  195. package/local/store/web/README.md +5 -0
  196. package/local/store/web-sqlite/README.md +36 -8
  197. package/local/vault/README.md +21 -2
  198. package/package.json +1 -1
  199. package/remote/object-store/convex-r2/README.md +10 -0
package/ADAPTERS.md CHANGED
@@ -35,8 +35,8 @@ Use:
35
35
 
36
36
  - `expoStore` and `ExpoSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/expo` (`await expoStore()` opens the SDK-owned SQLCipher database; `resetExpoStore` deletes it and opens an empty one; `createPreKeyMaintenanceStore` takes an open store)
37
37
  - `reactNativeStore` and `ReactNativeSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/react-native` (bare React Native: `await reactNativeStore()` opens the SDK-owned SQLCipher database on op-sqlite with its key in the react-native-keychain vault; `resetReactNativeStore` deletes it and opens an empty one; `createPreKeyMaintenanceStore` takes an open store)
38
- - `IndexedDbSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/web`
39
- - `webSqliteStore` and `WebSqliteSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/web-sqlite` (`await webSqliteStore()` opens the SDK-owned SQLite database in the origin private file system, encrypted in a Wasm worker; `resetWebSqliteStore` deletes it and opens an empty one; `createPreKeyMaintenanceStore` takes an open store; the page's Content Security Policy must allow `'wasm-unsafe-eval'`)
38
+ - `webSqliteStore` and `WebSqliteSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/web-sqlite` (browsers: `await webSqliteStore()` opens the SDK-owned SQLite database in the origin private file system, encrypted in a Wasm worker; `resetWebSqliteStore` deletes it and opens an empty one; `createPreKeyMaintenanceStore` takes an open store; the page's Content Security Policy must allow `'wasm-unsafe-eval'`)
39
+ - `IndexedDbSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/web` (browsers without the origin private file system, where `webSqliteStore` fails with `OPFS_UNAVAILABLE`)
40
40
  - `KeyValueSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/key-value` (use `await KeyValueSignalProtocolStore.create({ storage, vault })` with a caller-provided key-value backend, verified with the exported backend-conformance kit, and a secret vault that holds the value key)
41
41
  - `createRealmKeyValueBackend` from `@open-e2ee/signal-protocol-sdk/local/store/key-value/realm` (a key-value backend over an application-installed Realm)
42
42
  - `createTransactionalKeyValueBackend` from `@open-e2ee/signal-protocol-sdk/local/store/key-value` (a key-value backend over another engine's transaction, through a synchronous `KeyValueTransaction` handle; the SDK applies each `atomicWrite` batch inside the transaction)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,193 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.2.0
4
+
5
+ - **Changed: a group send posts to the member devices at the same time.**
6
+ Before, a group send posted each sender-key distribution message, each
7
+ device post, and each copy for the sender's other devices one after the
8
+ other. Now each phase of a group send posts at the same time, under the
9
+ client's bound of 4 relay requests, and a phase starts only after the phase
10
+ before it settles: the sender-key distribution messages, then their
11
+ confirmation, then the group message and its device posts, then the copies.
12
+ A failure for one device does not stop the other devices of the phase.
13
+ After every device of the phase settles, the send rejects with the error of
14
+ the first failed device in member order. When a distribution message fails,
15
+ the stored send keeps only the distribution messages that the relay did not
16
+ accept, so a replay with the same `clientMessageId` posts only those. The
17
+ sessions for the members are set up at the same time, and the index in the
18
+ `clientMessageId` of each distribution message follows the member order.
19
+ - **Changed: a group send that distributes a new sender key reads each
20
+ member's device list once.** Before, such a send read the list of a member
21
+ up to three times: to prepare the distribution, to set up the sessions, and
22
+ to send the group message. The device posts of one group send check and
23
+ refresh the group's endorsements one at a time, so one refresh serves them
24
+ all.
25
+ - **Changed: a direct send posts to each device of the recipient at the same
26
+ time.** Before, a direct send posted to one device after the other. A
27
+ failure for one device stopped the posts to the devices after it. Now the
28
+ send posts to every device at the same time, and a failure for one device
29
+ does not stop the other devices. After every device settles, the send
30
+ rejects with the error of the first failed device in recipient order. The
31
+ copies for the sender's other devices start only after every device post
32
+ settles. These copies, and the copies of read state and other account
33
+ state, also post at the same time. A replay with the same `clientMessageId`
34
+ posts to every device again. A relay that remembers the result of a device
35
+ does not store the message again. After the hosted Relay forgets a result
36
+ (60 s), that device gets a second copy, and the recipient drops it as a
37
+ duplicate. When two sealed-sender posts of one send fail authorization,
38
+ the access mode steps down two times, to `DISABLED`, as before.
39
+ - **Changed: one client has at most 4 relay requests in flight.** The device
40
+ posts and copies of a direct send, the prekey fetches of session setup, and
41
+ the requests of hosted sealed-sender delivery share this bound. The clients
42
+ that use one hosted Relay transport share one bound. A request that finds
43
+ the 4 slots full waits, and the waiting requests start in the order that
44
+ they came.
45
+ - **Changed: a direct send through the hosted Relay posts before it reads
46
+ the recipient's device list, when this process read the list less than
47
+ 5 min before.** Before, a direct send to a recipient whose list was more
48
+ than 60 s old waited for the device-list read before it posted. Now the
49
+ send posts to the known devices, reads the list, and in the same send posts
50
+ the same message to each device that the list newly shows. A device linked
51
+ 60 s to 300 s before a send now receives that send. A send after a restart,
52
+ after 5 min, or after reads that failed, still waits for the read. The
53
+ stored send records the pending read, so a replay reads the list before it
54
+ completes. Sender key distribution, and sends through the Convex and memory
55
+ relays, keep the read before the post.
56
+ - **Changed: a direct send through the hosted Relay that posts before the
57
+ read drops a removed device.** Before, a send threw the Relay's `NOT_FOUND`
58
+ when a post named the mailbox of a device that the recipient had removed.
59
+ Now such a send waits for its device-list read, drops that device from the
60
+ send and its result, and succeeds. A `NOT_FOUND` for a device that the list
61
+ still shows, or when the read fails, still fails the send. A send that does
62
+ not read the list, because the last read is less than 60 s old, still
63
+ throws.
64
+ - **Fixed: a sealed-sender send through the hosted Relay repairs a device
65
+ that the Relay refuses as `STALE_DEVICE`.** The identified path fetched a
66
+ new prekey bundle and sent again, but the sealed path threw. Now both paths
67
+ repair the device.
68
+ - **Fixed: a device-list time later than the clock counts as old.** When the
69
+ wall clock went back, a send used the old list until the clock passed that
70
+ time again. Now the send reads the list.
71
+ - **Fixed: an app entry that awaits SDK work at the top level finishes.**
72
+ When a bundler splits code, each module that the SDK loaded with `import()`
73
+ got its own chunk. That chunk imported the app's entry chunk, so it waited
74
+ for the entry module to finish evaluation. An entry module that awaited a
75
+ send or a sync at the top level never finished, and the SDK work stopped. In
76
+ a Vite 8 build, the first send stopped. Now the SDK loads with `import()`
77
+ only a module that imports nothing, so no SDK chunk imports the entry chunk.
78
+ The SDK loads the other modules with static imports.
79
+ - **Changed: session setup fetches the prekey bundles of a recipient's
80
+ devices in parallel.** Before, a send that set up sessions with a
81
+ recipient fetched one prekey bundle for each device in turn. Now the
82
+ fetches run at the same time, and one client has at most 4 of these relay
83
+ requests in flight, also when it sets up sessions with more than one
84
+ recipient. The client then establishes the sessions one at a time, so
85
+ every device gets its session and its device record on every store. A
86
+ device with no bundle, or a device whose fetch fails, does not stop the
87
+ other devices.
88
+ - **Fixed: an encrypted Expo store on the web fails before it uses the
89
+ vault.** The web build of `expo-sqlite` has no SQLCipher, and Expo
90
+ SecureStore has no web implementation. `expoStore()` on the web rejected
91
+ with `KEY_STORAGE_ERROR` from the default vault, and with a custom vault it
92
+ wrote a key before it rejected. Now `expoStore()` and `resetExpoStore()`
93
+ reject with `SqliteEncryptionUnavailableError` (`KEY_STORAGE_ERROR`) when the
94
+ `expo-sqlite` build has no SQLCipher, before they use the vault or a file.
95
+ The same refusal applies to a native build without the `useSQLCipher`
96
+ option. `encryptionAtRest: false` still opens a store without encryption. The
97
+ guide names `./local/store/web-sqlite` for encrypted browser storage.
98
+ - **Fixed: the Electron vault names the Secret portal key.** On Linux, a
99
+ Chromium feature can make `safeStorage` use that key. The feature is
100
+ `SecretPortalKeyProviderUseForEncryption`, and the ciphertext starts with
101
+ `v12`. The vault refused that key, but its `KEY_STORAGE_ERROR` named the
102
+ fixed fallback key.
103
+ Now the error names the Secret portal. Outside a Flatpak or Snap sandbox,
104
+ the portal gives the same key to each Electron app of the user. The vault
105
+ still refuses the key, and the vault file does not change.
106
+ - **Fixed: concurrent SESAME writes for one user keep every change.** Each
107
+ write of a SESAME user record or device record reads the record, changes
108
+ it, and writes it back. Two concurrent writes for one user could both read
109
+ before either wrote, and the second write then removed the change of the
110
+ first: a device that a concurrent `addDevice` added, a session, or a
111
+ cleared verification flag. Now a per-user lock orders these writes in
112
+ `DefaultSesameManager`, on every store. The lock orders the writes of one
113
+ client process only. It does not order two browser tabs or two processes
114
+ that share one store.
115
+ - **Changed: hosted sealed-sender delivery reads the recipients at the same
116
+ time.** Before a sealed-sender send through the hosted Relay, the transport
117
+ reads the device directory of each recipient account that it has not
118
+ cached. It read one account after the other. Now it reads the accounts at
119
+ the same time, with one read for each account, also when two sends need
120
+ the same account. A direct send also delivers to each device of the
121
+ recipient at the same time. At most four of these requests are in flight
122
+ for each client. A failure for one device no longer stops the delivery to
123
+ the other devices. After every device settles, the send rejects with the
124
+ error of the first failed device in recipient order, and a successful send
125
+ returns the server timestamp of the last device in that order.
126
+ - **Fixed: SESAME writes and store sweeps keep a newer session.** A SESAME
127
+ write that carries a session read it before the protocol took the session
128
+ lock. When a send or a receive committed a newer session between that read
129
+ and the write, the write put the older session back, and the next send
130
+ used a message key again. `deleteStaleRecords()` and
131
+ `cleanupExpiredSessions()` read the records, decided, and wrote without a
132
+ lock, so they could delete a device that got a session after the read, or
133
+ write back a session and a verification flag that a SESAME write had
134
+ changed. Now these writes and each device change of a sweep take the
135
+ session lock of the device and then the per-user lock, and read the
136
+ records under them. A PreKeyMessage receive now compares the incoming
137
+ identity with the identity that the store pins when it writes. An identity
138
+ pinned while the message decrypts gets `pendingVerification` and an
139
+ identity change event. It is no longer replaced. The locks order one
140
+ client process only.
141
+ - **Fixed: key cleanup, session setup, and device removal keep a newer
142
+ session.** `cleanupExpiredKeys()` read the session and wrote it back
143
+ without the session lock. `establishSession()` registered the session
144
+ state that it read after the session was established. When a send
145
+ committed a newer state between the read and the write, the write put the
146
+ older state back, and the next send used a message key again. When the
147
+ device list of a recipient no longer listed a device, or listed a new
148
+ identity for it, the removal deleted the session under the per-user lock
149
+ only, so a send that was in progress could put the session of the removed
150
+ device back. Now the cleanup runs under the session lock. Session setup
151
+ registers the state of the session that the store holds under the session
152
+ lock. A device removal takes the session lock of the device and then the
153
+ per-user lock. Two device-list syncs for one recipient still run one after
154
+ the other. The locks order one client process only.
155
+
156
+ ## 8.1.0
157
+
158
+ - **Changed: the web SQLite store is no longer experimental.** Its last
159
+ graduation gate, a soak, now runs in Chromium on each change to the main
160
+ branch and on each pull request that is ready for review. It drives open,
161
+ write, read, and close cycles, one long session of churn, and writes that
162
+ two tabs make in turn, and it fails when latency, memory, or the file size
163
+ grows over the run. The guides now name `webSqliteStore` first for
164
+ browsers where the origin private file system works, and `indexedDbStore`
165
+ where it is not available. The error of `DefaultSignalProtocolClient.create()`
166
+ without storage names both.
167
+ - **Fixed: an open of the web SQLite store under a full origin quota rejects
168
+ with `StorageQuotaExceededError`.** The open rejected with
169
+ `OPFS_FILE_BUSY`. After a failed first open, the store could also fail every
170
+ later open with `SQLITE_CANTOPEN`. Now the open rejects with
171
+ `StorageQuotaExceededError` (`STORAGE_QUOTA_EXCEEDED`), a new store writes
172
+ no key and no database file, and the open succeeds after space frees.
173
+ - **Changed: hosted prekey reads send the destination mailbox generation.**
174
+ The hosted Relay client sends the `mailboxGeneration` field on each prekey
175
+ bundle fetch and each prekey status read, which includes an identity key
176
+ read. The Relay keeps the prekeys of a device for each mailbox generation,
177
+ so a read after a recovery gets the prekeys of the recovered device. The own
178
+ device sends the generation of its session. For another device, the client
179
+ reads the device directory first. When the Relay does not find the prekeys
180
+ at a cached generation, the client reads the directory one more time and
181
+ tries again. A directory read now also removes the cached generation of each
182
+ device that the directory no longer lists.
183
+ - **Changed: group zero-knowledge proofs and credential presentations are
184
+ about twice as fast.** The constant generators of the group credential and
185
+ encryption systems keep a table of their multiples and their encoding. A
186
+ proof, a presentation, and a presentation verification calculate each sum
187
+ of products with one constant-time multiscalar multiplication, which uses
188
+ these tables. The Lizard decode uses an addition chain for its field
189
+ exponentiation. The proofs, the credentials, and their bytes do not change.
190
+
3
191
  ## 8.0.0
4
192
 
5
193
  8.0.0 is a major release. The entries below give the details. To upgrade from
package/README.md CHANGED
@@ -11,7 +11,7 @@ Add encrypted messaging to Expo, React Native, browser, and Node applications. T
11
11
 
12
12
  The default policy requires post-quantum session establishment and ratcheting. The protocol implementation is open source under the MIT License or the Apache License 2.0, at your option.
13
13
 
14
- [**Run an encrypted exchange in your browser**](https://open-e2ee.dev/playground) · [Edit on StackBlitz](https://stackblitz.com/fork/github/open-e2ee/signal-protocol-js/tree/v8.0.0/examples/browser) · [Run on Expo / Hermes](./examples/expo/README.md)
14
+ [**Run an encrypted exchange in your browser**](https://open-e2ee.dev/playground) · [Edit on StackBlitz](https://stackblitz.com/fork/github/open-e2ee/signal-protocol-js/tree/v8.2.0/examples/browser) · [Run on Expo / Hermes](./examples/expo/README.md)
15
15
 
16
16
  [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-2f6f5e)](./LICENSE)
17
17
  [![npm version](https://img.shields.io/npm/v/@open-e2ee/signal-protocol-sdk)](https://www.npmjs.com/package/@open-e2ee/signal-protocol-sdk)
@@ -43,7 +43,7 @@ The relay never needs message plaintext or device private keys.
43
43
 
44
44
  OpenE2EE implements a versioned profile of the published Signal Protocol specifications. It is not affiliated with Signal Messenger and is **not wire-compatible with Signal Messenger or libsignal**. Messages, identities, and safety numbers do not interoperate. See the [notice](./NOTICE) and [documented deviations](./docs/DEVIATIONS.md).
45
45
 
46
- Version `8.0.x`. Public APIs and persisted formats follow semantic versioning.
46
+ Version `8.2.x`. Public APIs and persisted formats follow semantic versioning.
47
47
 
48
48
  ## Install
49
49
 
@@ -107,8 +107,8 @@ Choose the device-local store for your runtime. Then supply a relay that authent
107
107
  | Runtime | Storage path | Deployment boundary |
108
108
  |---|---|---|
109
109
  | Expo | [`expoStore`](./local/store/expo/README.md) | Enable SQLCipher in the expo-sqlite config plugin. The SDK owns the database file, its key, and its migrations. Requires a native development or release build. [Run the Hermes example](./examples/expo/README.md); Expo Go does not include SQLCipher. |
110
- | Browser | [`indexedDbStore`](./local/store/web/README.md) | Use a secure context and a restrictive CSP. Same-origin JavaScript can access stored records and their key. [Browser setup](https://docs.open-e2ee.dev/start/browser). |
111
- | Browser, SQLite | [`webSqliteStore`](./local/store/web-sqlite/README.md) | Needs the origin private file system and a CSP that allows `'wasm-unsafe-eval'`. The SDK owns the database file, its key, and its migrations. The key sits in IndexedDB in the same origin, so same-origin JavaScript can read it. |
110
+ | Browser | [`webSqliteStore`](./local/store/web-sqlite/README.md) | Needs the origin private file system and a CSP that allows `'wasm-unsafe-eval'`. The SDK owns the database file, its key, and its migrations. The key sits in IndexedDB in the same origin, so same-origin JavaScript can read it. Without the origin private file system, the open fails with `OPFS_UNAVAILABLE`. |
111
+ | Browser without the origin private file system | [`indexedDbStore`](./local/store/web/README.md) | Use a secure context and a restrictive CSP. Same-origin JavaScript can access stored records and their key. [Browser setup](https://docs.open-e2ee.dev/start/browser). |
112
112
  | Bare React Native | [`reactNativeStore`](./local/store/react-native/README.md) | Enable SQLCipher with `"op-sqlite": { "sqlcipher": true }` in the app's `package.json`, and install `react-native-keychain`. The SDK owns the database file, its key, and its migrations. Requires a native build; with SQLCipher on, op-sqlite conflicts on iOS with `expo-sqlite`, `expo-updates`, and `use_frameworks!`. |
113
113
  | Own key-value engine | [`keyValueStore`](./local/store/key-value/README.md) | Provide an atomic, durable key-value backend and a keychain-backed secret vault, and run the exported backend conformance kit. A Realm backend is included. |
114
114
  | Node and Electron | [`nodeStore`](./local/store/node/README.md) | Install `better-sqlite3-multiple-ciphers` and pass a private directory on a local file system and a secret vault. In Electron, open it in the main process with the safeStorage vault. The SDK owns the database file, its key, and its migrations. |
package/SECURITY.md CHANGED
@@ -7,8 +7,8 @@ backports.
7
7
 
8
8
  | Version | Supported |
9
9
  | ------- | ------------------ |
10
- | 8.0.x | :white_check_mark: |
11
- | < 8.0.0 | :x: |
10
+ | 8.2.x | :white_check_mark: |
11
+ | < 8.2.0 | :x: |
12
12
 
13
13
  ## Reporting a Vulnerability
14
14
 
package/device/README.md CHANGED
@@ -28,15 +28,24 @@ and lifecycle state in the `SignalProtocolLocalSecretVault` that the
28
28
  application passes, and they take platform metadata as an input. They omit each
29
29
  metadata field that the application does not supply.
30
30
 
31
- Two platform entries read that metadata:
31
+ Two platform entries read that metadata. Install the peers of the entry that
32
+ you use.
32
33
 
33
- - `@open-e2ee/signal-protocol-sdk/device/expo` reads `react-native`,
34
- `expo-constants`, and `expo-device`.
35
- - `@open-e2ee/signal-protocol-sdk/device/react-native` reads `react-native` and
36
- `react-native-device-info`.
34
+ `@open-e2ee/signal-protocol-sdk/device/expo` reads `react-native` 0.83.6 or
35
+ later, `expo-constants` 55.0.7 or later, and `expo-device` 55.0.15 or later.
37
36
 
38
- Install the optional peer dependencies of the platform entry you use. The
39
- lifecycle core is available from:
37
+ ```sh
38
+ npx expo install react-native expo-constants expo-device
39
+ ```
40
+
41
+ `@open-e2ee/signal-protocol-sdk/device/react-native` reads `react-native`
42
+ 0.83.6 or later and `react-native-device-info` 15.0.1 or later.
43
+
44
+ ```sh
45
+ npm install react-native react-native-device-info
46
+ ```
47
+
48
+ The lifecycle core is available from:
40
49
 
41
50
  <!-- doc-snippet:skip requires-external-context -->
42
51
  ```ts
@@ -101,6 +101,7 @@ export declare class DefaultSignalProtocolClient implements SignalProtocolClient
101
101
  private groupSessionFor?;
102
102
  private groupStore?;
103
103
  private readonly cipher;
104
+ private readonly fanOut;
104
105
  /**
105
106
  * Durable media job facade backed by the configured Signal Protocol local store.
106
107
  *
@@ -206,8 +207,9 @@ export declare class DefaultSignalProtocolClient implements SignalProtocolClient
206
207
  private relayWorkContext;
207
208
  /**
208
209
  * Session callbacks of a send. Their session hooks run through the given
209
- * context, so a send in relay work calls the app through that work. There
210
- * are none without a relay.
210
+ * context, so a send in relay work calls the app through that work. Session
211
+ * setup sends its relay requests under the client's relay request bound, and
212
+ * the stop signal ends it. There are none without a relay.
211
213
  */
212
214
  private sendSessionCallbacks;
213
215
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../client/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAKH,OAAO,KAAK,EAGV,oBAAoB,EACpB,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EAIrB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAChC,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAiB,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAA+B,K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C,IAAI,CAAC,CAEf;IAED;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAErE;IAED;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5F;IAED;;OAEG;IACG,sBAAsB,CAC1B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAEf;IAED;;OAEG;IACG,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,CAEtE;IAMD;;OAEG;IACH,OAAO,CAAC,cAAc;CAQvB"}
@@ -50,8 +50,11 @@ import { DefaultSesameManager } from '../internal/sesame/index.js';
50
50
  import { createCompositeIdentityV1 } from '../keys/identity.js';
51
51
  import { EncryptionError, EncryptionErrorCode } from '../types/index.js';
52
52
  import { base64ToBytes, bytesToBase64, constantTimeEqual } from '../internal/crypto/index.js';
53
+ import { deriveGroupSecretParams, getGroupPublicParams } from '../internal/protocol/zk/groups/index.js';
54
+ import { SERVICE_ID_ACI } from '../internal/protocol/zk/groups/uid-struct.js';
55
+ import { deserializeSenderCertificate, validateSenderCertificate, } from '../internal/protocol/sealed-sender/index.js';
53
56
  import { ProtocolAddress } from '../types/address.js';
54
- import { getActiveIdentityTypes, resolveSignalProtocolStrategy, } from './config.js';
57
+ import { getActiveIdentityTypes, resolveSignalProtocolStrategy, SEALED_SENDER_CERTIFICATE_MARGIN_MS, } from './config.js';
55
58
  import { resolveSignalProtocolLogger } from '../logger.js';
56
59
  import { SenderKeyManager, } from '../internal/protocol/sender-keys/index.js';
57
60
  import { createDefaultSignalProtocolContentAdapter, } from './content-adapter.js';
@@ -61,6 +64,7 @@ import { profileKeyExchange } from './profile-key-exchange.js';
61
64
  import { SignalProtocolServiceCipher, sortEnvelopesForDecryption, } from './signal-service-cipher.js';
62
65
  import { establishMultiDeviceSessions } from '../internal/sesame/device-registry.js';
63
66
  import { isRetryableDecryptionError } from './retry-utils.js';
67
+ import { envelopeTypeForContent, unsealMessage } from './sealed-sender.js';
64
68
  import { MESSAGE_RECORD_TTL_MS } from './constants.js';
65
69
  import { ReceiptType } from './types.js';
66
70
  import * as MessageOps from './messages.js';
@@ -72,7 +76,7 @@ import * as PreKeyOps from './prekeys.js';
72
76
  import * as RetryOps from './retry.js';
73
77
  import * as RelaySubscriptionOps from './relay-subscription.js';
74
78
  import { SignalProtocolClientState, SIGNAL_PROTOCOL_CLIENT_CONSTANTS } from './state.js';
75
- import { rethrowRelayWorkStopped } from './relay-work.js';
79
+ import { clientRelayFanOut, rethrowRelayWorkStopped } from './relay-work.js';
76
80
  import { deleteMediaAttachment, resolveMediaAttachment, } from '../media/index.js';
77
81
  import { StorageBackedSignalProtocolClientMedia } from './media.js';
78
82
  // Group state (Signal Private Group System)
@@ -144,6 +148,8 @@ export class DefaultSignalProtocolClient {
144
148
  groupStore;
145
149
  // Cipher coordination (encrypts/decrypts, routes to appropriate cipher)
146
150
  cipher;
151
+ // The relay request bound that every fan-out of this client shares
152
+ fanOut;
147
153
  /**
148
154
  * Durable media job facade backed by the configured Signal Protocol local store.
149
155
  *
@@ -218,6 +224,8 @@ export class DefaultSignalProtocolClient {
218
224
  this.contentAdapter = config.contentAdapter ?? createDefaultSignalProtocolContentAdapter();
219
225
  // Dependency injection: use the provided relay adapter when configured.
220
226
  this.relay = config.relay;
227
+ // A relay adapter that sends relay requests itself shares its bound.
228
+ this.fanOut = clientRelayFanOut(config.relay);
221
229
  // Dependency injection: use the remote object store for encrypted attachments.
222
230
  this.remoteObjectStore = config.remoteObjectStore;
223
231
  // Dependency injection: Storage is always provided by create() callers.
@@ -312,7 +320,7 @@ export class DefaultSignalProtocolClient {
312
320
  this.groupManager = this.groupSessionFor(config.groups).manager;
313
321
  }
314
322
  // Initialize cipher for encrypt/decrypt coordination
315
- this.cipher = new SignalProtocolServiceCipher(this._userId, deviceId, this.sesameManager, this.senderKeyManager, this._storage, this.relay, this.remoteObjectStore, this.contentAdapter, this.logger);
323
+ this.cipher = new SignalProtocolServiceCipher(this._userId, deviceId, this.sesameManager, this.senderKeyManager, this._storage, this.relay, this.remoteObjectStore, this.contentAdapter, this.logger, this.fanOut);
316
324
  if (this.groupManager) {
317
325
  this.cipher.setGroupSendBarrierChecker((groupId) => this.groupManager.assertGroupSendAllowed(groupId));
318
326
  }
@@ -335,11 +343,10 @@ export class DefaultSignalProtocolClient {
335
343
  if (!identityKeyPair) {
336
344
  throw new EncryptionError('No identity key pair for sealed sender', EncryptionErrorCode.INITIALIZATION_FAILED);
337
345
  }
338
- const { base64ToBytes: b64ToBytes } = await import('../internal/crypto/index.js');
339
346
  return {
340
347
  senderCertificateBase64: certBase64,
341
- senderIdentityPrivate: b64ToBytes(identityKeyPair.dhKey.privateKey),
342
- senderIdentityPublic: b64ToBytes(identityKeyPair.dhKey.publicKey),
348
+ senderIdentityPrivate: base64ToBytes(identityKeyPair.dhKey.privateKey),
349
+ senderIdentityPublic: base64ToBytes(identityKeyPair.dhKey.publicKey),
343
350
  config: this.config.sealedSender,
344
351
  };
345
352
  });
@@ -372,7 +379,6 @@ export class DefaultSignalProtocolClient {
372
379
  const masterKey = await store.getMasterKey(groupId);
373
380
  if (!masterKey)
374
381
  return null;
375
- const { deriveGroupSecretParams } = await import('../internal/protocol/zk/groups/index.js');
376
382
  return deriveGroupSecretParams(masterKey);
377
383
  });
378
384
  }
@@ -397,7 +403,6 @@ export class DefaultSignalProtocolClient {
397
403
  const masterKey = await groupStore.getMasterKey(groupId);
398
404
  if (!masterKey)
399
405
  return false;
400
- const { deriveGroupSecretParams, getGroupPublicParams } = await import('../internal/protocol/zk/groups/index.js');
401
406
  const secretParams = deriveGroupSecretParams(masterKey);
402
407
  // 3. Derive the protocol identifier, not the display identifier's UTF-8 bytes.
403
408
  const groupIdBytes = getGroupPublicParams(secretParams).groupId;
@@ -410,7 +415,6 @@ export class DefaultSignalProtocolClient {
410
415
  // 6. Build ACI→userId mapping from known members + self.
411
416
  // Endorsements are issued in group-state member order, so we must
412
417
  // build parallel arrays matching that order.
413
- const { SERVICE_ID_ACI } = await import('../internal/protocol/zk/groups/uid-struct.js');
414
418
  const allUserIds = [...memberUserIds, selfUserId];
415
419
  const aciHexToUserId = new Map();
416
420
  const resolvedAciBytes = groupConfig.resolveAciBytesByUserIds
@@ -490,7 +494,6 @@ export class DefaultSignalProtocolClient {
490
494
  * @throws if no certificate provider is available
491
495
  */
492
496
  async fetchSenderCertificate() {
493
- const { SEALED_SENDER_CERTIFICATE_MARGIN_MS } = await import('./config.js');
494
497
  const now = Date.now();
495
498
  if (this.cachedSenderCertificate && now < this.cachedCertificateExpiry) {
496
499
  return this.cachedSenderCertificate;
@@ -510,7 +513,6 @@ export class DefaultSignalProtocolClient {
510
513
  else {
511
514
  throw new EncryptionError('No sender certificate provider configured. Set sealedSender.certificateProvider or use a relay that supports fetchSenderCertificate.', EncryptionErrorCode.INITIALIZATION_FAILED);
512
515
  }
513
- const { deserializeSenderCertificate, validateSenderCertificate } = await import('../internal/protocol/sealed-sender/index.js');
514
516
  let certificate;
515
517
  try {
516
518
  certificate = deserializeSenderCertificate(base64ToBytes(certBase64));
@@ -577,7 +579,7 @@ export class DefaultSignalProtocolClient {
577
579
  * waits for the recipient's lock only until stop() stops the work.
578
580
  */
579
581
  retryCallbacks(work, ctx) {
580
- const sessions = this.sendSessionCallbacks(() => ctx);
582
+ const sessions = this.sendSessionCallbacks(() => ctx, work.stopSignal);
581
583
  return {
582
584
  archiveSession: (address) => SessionOps.archiveSession(ctx, address),
583
585
  establishSession: (address, bundle) => SessionOps.establishSession(ctx, this.sesameManager, address, bundle),
@@ -610,18 +612,22 @@ export class DefaultSignalProtocolClient {
610
612
  }
611
613
  /**
612
614
  * Session callbacks of a send. Their session hooks run through the given
613
- * context, so a send in relay work calls the app through that work. There
614
- * are none without a relay.
615
+ * context, so a send in relay work calls the app through that work. Session
616
+ * setup sends its relay requests under the client's relay request bound, and
617
+ * the stop signal ends it. There are none without a relay.
615
618
  */
616
- sendSessionCallbacks(context) {
619
+ sendSessionCallbacks(context, stopSignal) {
617
620
  const relay = this.relay;
618
621
  if (!relay)
619
622
  return undefined;
620
623
  const establishSession = (address, bundle) => SessionOps.establishSession(context(), this.sesameManager, address, bundle);
621
624
  return {
622
- establishSessions: (recipientUserId) => establishMultiDeviceSessions(this, relay, recipientUserId, {
625
+ establishSessions: (recipientUserId, listedDevices) => establishMultiDeviceSessions(this, relay, recipientUserId, {
623
626
  establishSession,
624
627
  rethrowFatal: rethrowRelayWorkStopped,
628
+ fanOut: this.fanOut,
629
+ stopSignal,
630
+ ...(listedDevices && { listedDevices }),
625
631
  }),
626
632
  // Stale-device recovery archives the old session, fetches a fresh bundle,
627
633
  // and establishes a replacement.
@@ -636,7 +642,7 @@ export class DefaultSignalProtocolClient {
636
642
  data: { recipientUserId, recipientDeviceId },
637
643
  });
638
644
  // 2. Fetch fresh prekey bundle
639
- const freshBundle = await relay.fetchPreKeyBundle(recipientUserId, recipientDeviceId);
645
+ const freshBundle = await this.fanOut.request(() => relay.fetchPreKeyBundle(recipientUserId, recipientDeviceId), stopSignal);
640
646
  if (!freshBundle) {
641
647
  this.logger.warn('No prekey bundle available for stale session refresh', {
642
648
  category: 'E2EE',
@@ -750,7 +756,8 @@ export class DefaultSignalProtocolClient {
750
756
  throw new Error('DefaultSignalProtocolClient.create() requires storage. ' +
751
757
  'Expo: import { expoStore } from "@open-e2ee/signal-protocol-sdk/local/store/expo"; ' +
752
758
  'React Native: import { reactNativeStore } from "@open-e2ee/signal-protocol-sdk/local/store/react-native"; ' +
753
- 'Web: import { indexedDbStore } from "@open-e2ee/signal-protocol-sdk/local/store/web"; ' +
759
+ 'Web: import { webSqliteStore } from "@open-e2ee/signal-protocol-sdk/local/store/web-sqlite", ' +
760
+ 'or where OPFS is unavailable, import { indexedDbStore } from "@open-e2ee/signal-protocol-sdk/local/store/web"; ' +
754
761
  'Node: import { nodeStore } from "@open-e2ee/signal-protocol-sdk/local/store/node";');
755
762
  }
756
763
  const finalConfig = {
@@ -1162,7 +1169,6 @@ export class DefaultSignalProtocolClient {
1162
1169
  async processIncomingEnvelope(envelope, options) {
1163
1170
  // Handle sealed sender envelopes: unseal to reveal sender before decrypting
1164
1171
  if (envelope.messageType === 'unidentified_sender' && this.config.sealedSender) {
1165
- const { unsealMessage, envelopeTypeForContent } = await import('./sealed-sender.js');
1166
1172
  const identityKeyPair = await this._storage.getIdentityKey();
1167
1173
  if (!identityKeyPair) {
1168
1174
  throw new EncryptionError('No identity key pair for sealed sender decryption', EncryptionErrorCode.DECRYPTION_FAILED);