@open-e2ee/signal-protocol-sdk 12.0.0 → 13.0.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 (171) hide show
  1. package/ADAPTERS.md +3 -0
  2. package/ARCHITECTURE.md +4 -4
  3. package/CHANGELOG.md +165 -0
  4. package/README.md +1 -1
  5. package/SECURITY.md +2 -2
  6. package/TROUBLESHOOTING.md +7 -7
  7. package/client/README.md +40 -0
  8. package/device/README.md +29 -3
  9. package/dist/client/client.d.ts +8 -0
  10. package/dist/client/client.d.ts.map +1 -1
  11. package/dist/client/client.js +26 -3
  12. package/dist/client/client.js.map +1 -1
  13. package/dist/client/config.d.ts +19 -12
  14. package/dist/client/config.d.ts.map +1 -1
  15. package/dist/client/config.js.map +1 -1
  16. package/dist/client/event-hooks.d.ts +28 -0
  17. package/dist/client/event-hooks.d.ts.map +1 -1
  18. package/dist/client/event-hooks.js +1 -0
  19. package/dist/client/event-hooks.js.map +1 -1
  20. package/dist/client/group-init-status.d.ts +21 -0
  21. package/dist/client/group-init-status.d.ts.map +1 -0
  22. package/dist/client/group-init-status.js +156 -0
  23. package/dist/client/group-init-status.js.map +1 -0
  24. package/dist/client/hosted-device-link.d.ts +97 -0
  25. package/dist/client/hosted-device-link.d.ts.map +1 -0
  26. package/dist/client/hosted-device-link.js +149 -0
  27. package/dist/client/hosted-device-link.js.map +1 -0
  28. package/dist/client/hosted-http-error.d.ts +30 -0
  29. package/dist/client/hosted-http-error.d.ts.map +1 -0
  30. package/dist/client/hosted-http-error.js +34 -0
  31. package/dist/client/hosted-http-error.js.map +1 -0
  32. package/dist/client/hosted-presence.js +1 -1
  33. package/dist/client/hosted-presence.js.map +1 -1
  34. package/dist/client/hosted-profile-keys.js +1 -1
  35. package/dist/client/hosted-profile-keys.js.map +1 -1
  36. package/dist/client/hosted-sandbox-identity.d.ts +3 -3
  37. package/dist/client/hosted-sandbox-identity.js +3 -3
  38. package/dist/client/hosted-transport.d.ts +0 -11
  39. package/dist/client/hosted-transport.d.ts.map +1 -1
  40. package/dist/client/hosted-transport.js +1 -15
  41. package/dist/client/hosted-transport.js.map +1 -1
  42. package/dist/client/hosted.d.ts +53 -7
  43. package/dist/client/hosted.d.ts.map +1 -1
  44. package/dist/client/hosted.js +158 -17
  45. package/dist/client/hosted.js.map +1 -1
  46. package/dist/client/index.d.ts +2 -1
  47. package/dist/client/index.d.ts.map +1 -1
  48. package/dist/client/index.js +1 -1
  49. package/dist/client/index.js.map +1 -1
  50. package/dist/client/receive-queue.d.ts +4 -2
  51. package/dist/client/receive-queue.d.ts.map +1 -1
  52. package/dist/client/receive-queue.js +26 -22
  53. package/dist/client/receive-queue.js.map +1 -1
  54. package/dist/index.d.ts +2 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/index.js.map +1 -1
  58. package/dist/internal/manager/manager.d.ts +6 -1
  59. package/dist/internal/manager/manager.d.ts.map +1 -1
  60. package/dist/internal/manager/manager.js +8 -2
  61. package/dist/internal/manager/manager.js.map +1 -1
  62. package/dist/internal/session/cipher.d.ts +2 -2
  63. package/dist/internal/session/cipher.js +1 -1
  64. package/dist/internal/session/types.d.ts +1 -1
  65. package/dist/local/store/conformance/cases/ciphertext.d.ts +7 -0
  66. package/dist/local/store/conformance/cases/ciphertext.d.ts.map +1 -0
  67. package/dist/local/store/conformance/cases/ciphertext.js +55 -0
  68. package/dist/local/store/conformance/cases/ciphertext.js.map +1 -0
  69. package/dist/local/store/conformance/cases/durability.d.ts +6 -0
  70. package/dist/local/store/conformance/cases/durability.d.ts.map +1 -0
  71. package/dist/local/store/conformance/cases/durability.js +34 -0
  72. package/dist/local/store/conformance/cases/durability.js.map +1 -0
  73. package/dist/local/store/conformance/cases/identity.d.ts +7 -0
  74. package/dist/local/store/conformance/cases/identity.d.ts.map +1 -0
  75. package/dist/local/store/conformance/cases/identity.js +84 -0
  76. package/dist/local/store/conformance/cases/identity.js.map +1 -0
  77. package/dist/local/store/conformance/cases/metadata.d.ts +7 -0
  78. package/dist/local/store/conformance/cases/metadata.d.ts.map +1 -0
  79. package/dist/local/store/conformance/cases/metadata.js +48 -0
  80. package/dist/local/store/conformance/cases/metadata.js.map +1 -0
  81. package/dist/local/store/conformance/cases/protection.d.ts +7 -0
  82. package/dist/local/store/conformance/cases/protection.d.ts.map +1 -0
  83. package/dist/local/store/conformance/cases/protection.js +14 -0
  84. package/dist/local/store/conformance/cases/protection.js.map +1 -0
  85. package/dist/local/store/conformance/cases/receive-work.d.ts +8 -0
  86. package/dist/local/store/conformance/cases/receive-work.d.ts.map +1 -0
  87. package/dist/local/store/conformance/cases/receive-work.js +152 -0
  88. package/dist/local/store/conformance/cases/receive-work.js.map +1 -0
  89. package/dist/local/store/conformance/cases/sender-key.d.ts +7 -0
  90. package/dist/local/store/conformance/cases/sender-key.d.ts.map +1 -0
  91. package/dist/local/store/conformance/cases/sender-key.js +59 -0
  92. package/dist/local/store/conformance/cases/sender-key.js.map +1 -0
  93. package/dist/local/store/conformance/cases/session-trust.d.ts +7 -0
  94. package/dist/local/store/conformance/cases/session-trust.d.ts.map +1 -0
  95. package/dist/local/store/conformance/cases/session-trust.js +64 -0
  96. package/dist/local/store/conformance/cases/session-trust.js.map +1 -0
  97. package/dist/local/store/conformance/checks.d.ts +15 -0
  98. package/dist/local/store/conformance/checks.d.ts.map +1 -0
  99. package/dist/local/store/conformance/checks.js +67 -0
  100. package/dist/local/store/conformance/checks.js.map +1 -0
  101. package/dist/local/store/conformance/index.d.ts +30 -0
  102. package/dist/local/store/conformance/index.d.ts.map +1 -0
  103. package/dist/local/store/conformance/index.js +29 -0
  104. package/dist/local/store/conformance/index.js.map +1 -0
  105. package/dist/local/store/conformance/records.d.ts +36 -0
  106. package/dist/local/store/conformance/records.d.ts.map +1 -0
  107. package/dist/local/store/conformance/records.js +109 -0
  108. package/dist/local/store/conformance/records.js.map +1 -0
  109. package/dist/local/store/conformance/run.d.ts +24 -0
  110. package/dist/local/store/conformance/run.d.ts.map +1 -0
  111. package/dist/local/store/conformance/run.js +156 -0
  112. package/dist/local/store/conformance/run.js.map +1 -0
  113. package/dist/local/store/conformance/types.d.ts +55 -0
  114. package/dist/local/store/conformance/types.d.ts.map +1 -0
  115. package/dist/local/store/conformance/types.js +6 -0
  116. package/dist/local/store/conformance/types.js.map +1 -0
  117. package/dist/local/store/expo/adapter.d.ts +2 -1
  118. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  119. package/dist/local/store/expo/adapter.js.map +1 -1
  120. package/dist/local/store/node/adapter.d.ts +2 -2
  121. package/dist/local/store/react-native/adapter.d.ts +2 -1
  122. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  123. package/dist/local/store/react-native/adapter.js.map +1 -1
  124. package/dist/local/store/sqlite/convert-plaintext.d.ts +62 -0
  125. package/dist/local/store/sqlite/convert-plaintext.d.ts.map +1 -0
  126. package/dist/local/store/sqlite/convert-plaintext.js +236 -0
  127. package/dist/local/store/sqlite/convert-plaintext.js.map +1 -0
  128. package/dist/local/store/sqlite/driver.d.ts +9 -0
  129. package/dist/local/store/sqlite/driver.d.ts.map +1 -1
  130. package/dist/local/store/sqlite/encryption.d.ts +21 -0
  131. package/dist/local/store/sqlite/encryption.d.ts.map +1 -1
  132. package/dist/local/store/sqlite/encryption.js.map +1 -1
  133. package/dist/local/store/sqlite/errors.d.ts.map +1 -1
  134. package/dist/local/store/sqlite/errors.js +2 -1
  135. package/dist/local/store/sqlite/errors.js.map +1 -1
  136. package/dist/local/store/sqlite/key-storage/identity-keys.d.ts +3 -1
  137. package/dist/local/store/sqlite/key-storage/identity-keys.d.ts.map +1 -1
  138. package/dist/local/store/sqlite/key-storage/identity-keys.js +3 -1
  139. package/dist/local/store/sqlite/key-storage/identity-keys.js.map +1 -1
  140. package/dist/local/store/sqlite/open-store.d.ts +36 -4
  141. package/dist/local/store/sqlite/open-store.d.ts.map +1 -1
  142. package/dist/local/store/sqlite/open-store.js +326 -21
  143. package/dist/local/store/sqlite/open-store.js.map +1 -1
  144. package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.mjs +2 -1
  145. package/dist/local/store/sqlite/web/worker.d.ts +13 -0
  146. package/dist/local/store/sqlite/web/worker.d.ts.map +1 -1
  147. package/dist/local/store/sqlite/web/worker.js +163 -22
  148. package/dist/local/store/sqlite/web/worker.js.map +1 -1
  149. package/dist/local/store/web-sqlite/adapter.d.ts +3 -2
  150. package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -1
  151. package/dist/local/store/web-sqlite/adapter.js +12 -2
  152. package/dist/local/store/web-sqlite/adapter.js.map +1 -1
  153. package/dist/remote/relay/types.d.ts +4 -2
  154. package/dist/remote/relay/types.d.ts.map +1 -1
  155. package/dist/types/api.d.ts +20 -4
  156. package/dist/types/api.d.ts.map +1 -1
  157. package/docs/ASSURANCE.md +25 -7
  158. package/docs/DEVIATIONS.md +35 -3
  159. package/docs/ERROR_HANDLING.md +8 -6
  160. package/docs/GETTING_STARTED.md +15 -8
  161. package/docs/INTERFACES.md +3 -1
  162. package/docs/PACKAGE_SURFACE.md +1 -0
  163. package/docs/SECURITY.md +23 -5
  164. package/keys/README.md +3 -1
  165. package/local/store/README.md +92 -12
  166. package/local/store/expo/README.md +63 -6
  167. package/local/store/key-value/README.md +3 -2
  168. package/local/store/node/README.md +68 -6
  169. package/local/store/react-native/README.md +62 -4
  170. package/local/store/web-sqlite/README.md +73 -4
  171. package/package.json +5 -1
package/ADAPTERS.md CHANGED
@@ -45,6 +45,8 @@ Use:
45
45
  - `InMemorySignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/memory`
46
46
  - or a custom implementation
47
47
 
48
+ A custom implementation can be any object that implements `SignalProtocolLocalStore`. The client does not check its class, and no client feature requires a store class. Managed groups work on a custom store, including group message reception on the Relay subscription and on a pull. A custom store must meet the [storage implementation](#storage-implementations) expectations and pass the local store conformance kit.
49
+
48
50
  On React Native and Expo, the SDK reads random bytes only from the global `crypto.getRandomValues`. Install `react-native-get-random-values` 2.x or `react-native-quick-crypto`, and load it before the first SDK call. Without a global source, the SDK throws `SecureRandomUnavailableError`.
49
51
 
50
52
  ### Local secret vault: `SignalProtocolLocalSecretVault`
@@ -176,6 +178,7 @@ See the [client guide](./client/README.md#with-relay).
176
178
  - Keep contact identity trust decisions stable and explicit.
177
179
  - Persist linked-device identity state atomically enough that startup verification cannot enter a half-linked state.
178
180
  - Preserve session record semantics. Do not treat sessions as opaque blobs without honoring update and archive behavior.
181
+ - Run the local store conformance kit from `@open-e2ee/signal-protocol-sdk/local/store/conformance` against a custom `SignalProtocolLocalStore`. Use `assertLocalStoreConformance` in the automated checks, and give it the `armWriteFailure` hook, so that the rollback of each atomic commit runs. The kit reads the `protection` declaration, so declare it truthfully. The kit does not cover `SenderKeyHandoffStore`, `MessageRecordStore`, or `SendLogStore`. See the [storage guide](./local/store/README.md#conformance-kit-for-a-custom-store).
179
182
 
180
183
  ## Choosing a Shape
181
184
 
package/ARCHITECTURE.md CHANGED
@@ -16,8 +16,8 @@ The `@open-e2ee` scope is the umbrella namespace. Package and primary-client
16
16
  names identify the protocol they implement so future protocol packages do not
17
17
  share an ambiguous client identity.
18
18
 
19
- This package is pre-1.0. Prefer a clear, versioned correction over a
20
- compatibility shim when a boundary is wrong.
19
+ For the current package version and release notes, see
20
+ [package.json](./package.json) and [CHANGELOG](./CHANGELOG.md).
21
21
 
22
22
  ## Review Posture
23
23
 
@@ -35,7 +35,7 @@ compatibility shim when a boundary is wrong.
35
35
  | Shared types | [types/](./types/) | Protocol addresses, records, API contracts, protocol configuration |
36
36
  | Session domain | [internal/session/](./internal/session/) | Session establishment, session cipher, active/archive session resolution |
37
37
  | Orchestration | [internal/manager/](./internal/manager/), [internal/sesame/](./internal/sesame/) | Protocol manager and multi-device SESAME workflows |
38
- | Protocol algorithms | [internal/protocol/](./internal/protocol/) | PQXDH, Double Ratchet, Triple Ratchet, SPQR, sender keys, sealed sender, ZK helpers |
38
+ | Protocol algorithms | [internal/protocol/](./internal/protocol/) | PQXDH, Double Ratchet, SPQR, sender keys, sealed sender, ZK helpers |
39
39
  | Crypto foundation | [internal/crypto/](./internal/crypto/) | X25519, Ed25519, ML-KEM, AES, HKDF, padding |
40
40
  | Key model | [keys/](./keys/) | Key generation, branded key types, identity type helpers |
41
41
  | Public feature surfaces | [blocking/](./blocking/), [groups/](./groups/), [media/](./media/), [profile/](./profile/), [sealed-sender/](./sealed-sender/), [username/](./username/), [zk/](./zk/) | App-facing helpers that compose protocol, media, or account-state behavior without joining the inward dependency hierarchy |
@@ -112,7 +112,7 @@ Shared non-layer modules:
112
112
  | PQXDH | [internal/protocol/pqxdh/](./internal/protocol/pqxdh/) | Hybrid initial key agreement with ML-KEM-1024 |
113
113
  | Double Ratchet | [internal/protocol/double-ratchet/](./internal/protocol/double-ratchet/) | EC ratchet, skipped keys, header encryption |
114
114
  | SPQR | [internal/protocol/spqr/](./internal/protocol/spqr/) | Sparse post-quantum ratchet with ML-KEM-768 |
115
- | Triple Ratchet | [internal/protocol/triple-ratchet/](./internal/protocol/triple-ratchet/) | Double Ratchet plus SPQR hybrid message keys |
115
+ | Triple Ratchet | [internal/session/cipher.ts](./internal/session/cipher.ts) | Double Ratchet plus SPQR hybrid message keys |
116
116
  | SESAME | [internal/sesame/](./internal/sesame/) | Multi-device session management and convergence |
117
117
  | Sender Keys | [internal/protocol/sender-keys/](./internal/protocol/sender-keys/) | Group message sender-key state |
118
118
  | Sealed Sender | [internal/protocol/sealed-sender/](./internal/protocol/sealed-sender/) | Sender certificate and envelope privacy helpers |
package/CHANGELOG.md CHANGED
@@ -1,5 +1,170 @@
1
1
  # Changelog
2
2
 
3
+ ## 13.0.0
4
+
5
+ ### Breaking
6
+
7
+ - **A linked store that holds group state is refused.**
8
+ `linkHostedRelayDevice` lists the linked device's group store before any
9
+ write. When the store lists a group that the link did not write, the call
10
+ throws `HostedRelayDeviceLinkError` with code `DEVICE_LINK_STORE_NOT_EMPTY`.
11
+ The linked device's group store is `groups.store`, or the SDK group store on
12
+ the linked store. Link the device again with a new, empty store.
13
+ - **A custom identity store must accept an overwrite of its own identity
14
+ record.** `linkHostedRelayDevice` gives the linked device its own
15
+ registration ID with the same identity keys. It calls `storeIdentityKey` and
16
+ then `setLocalRegistrationId` for an identity type that the linked store
17
+ already holds. After both calls, both reads of that type must give the new
18
+ ID, and the other identity type must stay unchanged. Every store that the SDK
19
+ ships does this. A custom `SignalProtocolLocalStore` must pass this check:
20
+
21
+ <!-- doc-snippet:skip requires-external-context -->
22
+ ```ts
23
+ const identity = await store.getIdentityKey('aci');
24
+ await store.storeIdentityKey({ ...identity!, registrationId: 4321 }, 'aci');
25
+ await store.setLocalRegistrationId(4321, 'aci');
26
+ (await store.getIdentityKey('aci'))!.registrationId; // 4321
27
+ await store.getLocalRegistrationId('aci'); // 4321
28
+ ```
29
+
30
+ - **A SQLite store name that ends in `.oe2e-convert` is refused.** The
31
+ conversion uses that name for its temporary file. `nodeStore`, `expoStore`,
32
+ `reactNativeStore`, `webSqliteStore`, and their resets fail with
33
+ `INVALID_STATE` for such a name.
34
+
35
+ ### Added
36
+
37
+ - **`getGroupInitStatus` and the `onGroupInitStatus` hook.**
38
+ `DefaultSignalProtocolClient.getGroupInitStatus(groupId)` gives the
39
+ `GroupInitStatus` of a group on this device: `'ready'`, `'stale'`,
40
+ `'pending'`, `'no-key'`, or `'denied'`. It gives null when the device has no
41
+ record of the group. `'no-key'` means that the device knows the group but
42
+ holds no group key. `onGroupInitStatus(groupId, status)` runs when a client
43
+ write to the record of a group changes its status. It does not run when the
44
+ status stays the same.
45
+ - **`activeGroupStore` in `HostedRelayManagedDeviceLinkOptions`.** It is the
46
+ group store that the link copies from. The default is the SDK group store on
47
+ `activeDeviceStorage`. If a client runs on the active device during the
48
+ link, pass that client's group store, or stop that client first.
49
+ - **Progress phase `'copying'` for `'device-link'`.** `linkHostedRelayDevice`
50
+ reports it before it copies the group master keys.
51
+
52
+ - **SQLite stores accept `convertPlaintext: true`.** An encrypted open then
53
+ converts a database that `encryptionAtRest: false` created, and keeps every
54
+ row and its schema version. The removal of the plaintext file is the commit
55
+ point. A crash before it keeps the plaintext file, and a crash after it
56
+ leaves a store that the next encrypted open finishes. Each store guide has a
57
+ "Convert a plaintext store" section.
58
+
59
+ - **`HostedRelayHttpError` is exported from the root entry and the `client`
60
+ entry.** A custom `HostedRelayManagedDeviceLinkAdapter` can throw it when
61
+ the Relay refuses the link. Give it the Relay's status, `code`, message,
62
+ and `retryable`. A refusal with `retryable` false and the code
63
+ `KEY_PROOF_INVALID` or `CONFLICT` then rolls the link back. The
64
+ `linkHostedRelayDevice` call keeps the link state for an error of any other
65
+ class, also when the error has the same `code`.
66
+
67
+ - **Added: the local/store/conformance subpath exports runLocalStoreConformance and assertLocalStoreConformance.** A custom local store can check identity overwrite, atomic commits, compare-and-set, receive work, durability, and its protection declaration.
68
+
69
+ ### Changed
70
+
71
+ - **The link copies each group master key.** `linkHostedRelayDevice` copies
72
+ the master key of each group that the active device's group store lists into
73
+ the linked device's group store, in the calling process. No master key
74
+ crosses the Relay. A client with `groups` on the linked device then fetches
75
+ each copied group, so the application no longer brings each master key and
76
+ calls `syncGroup()`. A group record that a release before 12.0.0 wrote, and
77
+ that the active device has not read since, is not copied. Read each group
78
+ once on the active device before the link to copy it. A link that stops
79
+ during the copy copies again on the next call. A link that the Relay refuses
80
+ removes its copied groups.
81
+
82
+ - **The SQLite key mismatch error names `convertPlaintext`.** An encrypted open
83
+ of a plaintext file fails with `SqliteKeyMismatchError`, and its message
84
+ gives the option as a way to keep the data.
85
+ - **An open or a reset with `encryptionAtRest: false` refuses an incomplete
86
+ conversion.** While the temporary file of a conversion exists, it fails with
87
+ `INVALID_STATE` and changes nothing.
88
+ - **Each linked device gets its own registration ID.** `linkHostedRelayDevice`
89
+ writes a fresh registration ID into the linked store before it registers.
90
+ The ID differs from the ID of the active device. A held PNI record gets a
91
+ separate fresh ID. A device that a 12.0.x release linked keeps the ID that it
92
+ has. A link that a 12.0.x release began and that stopped before it completed
93
+ keeps its stored ID, so it registers the same device.
94
+ - **A linked store with a device-authentication key and no registration of the
95
+ link is refused.** `linkHostedRelayDevice` throws
96
+ `HostedRelayDeviceLinkError` with code `DEVICE_LINK_STORE_NOT_EMPTY` before
97
+ any write. Link the device again with a new, empty store.
98
+ - **A refused link rolls back.** When the Relay refuses a link with
99
+ `KEY_PROOF_INVALID` or `CONFLICT` and the refusal is not retryable, the call
100
+ removes the link state and rethrows. It keeps the identity records and the
101
+ registration, so the next call sends the same registration ID. Every other
102
+ error keeps the link state, and the next call resumes the link.
103
+
104
+ ### Fixed
105
+
106
+ - **Hosted identity docs.** The quickstart and API reference describe both
107
+ Production modes: application-bound and device-owned.
108
+ `hostedRelaySandboxIdentity` remains limited to Sandbox. The key-label note
109
+ states the session interoperability limit.
110
+
111
+ - **A link whose first sync fails rejects and can resume.**
112
+ `linkHostedRelayDevice` stops the client and rejects with
113
+ `OpenE2EE Signal Protocol Relay initial synchronization failed` when the
114
+ client's first sync fails. In 12.0.1 and earlier, it returned the client with
115
+ `syncStatus` `'failed'`. The next call with the same stores resumes the link
116
+ and gets the same device.
117
+
118
+ - **Fixed: removing a web SQLite file also removes its OPFS pool directory.**
119
+
120
+ - **A received message gets one delivery receipt.** When the Relay accepted
121
+ or refused a delivery receipt, the receive queue completed its record
122
+ outside the queue's passes. A pass that read the record before that
123
+ completion could put the receipt in the batch again after it. In 12.0.1
124
+ and earlier, the sender could then get a second delivery receipt for the
125
+ same message. The completion now runs between passes.
126
+
127
+ - **Fixed: the web SQLite store retries a transient OPFS failure of its
128
+ open.** WebKit can reject an access handle with `UnknownError` under load,
129
+ and the store then rejected the open with `OPFS_FILE_BUSY`. Now the store
130
+ attaches the pool of the file again, up to four attempts, 100 ms apart. It
131
+ retries only before the first statement of the request, so the file stays
132
+ unchanged. It does not retry a full quota or any other error. After the
133
+ fourth attempt the store rejects with `OPFS_FILE_BUSY` as before.
134
+
135
+ ## 12.0.1
136
+
137
+ - **Fixed: a web SQLite store restores the last commit after a tab died inside a
138
+ commit.** The `opfs-sahpool` VFS of the vendored engine reported a reserved
139
+ lock on every check. SQLite then took the hot journal that a tab killed
140
+ inside a commit left for the journal of a live transaction and never played
141
+ it back, so the next open read the half-written commit. In 12.0.0 and
142
+ earlier, such a store could report `database disk image is malformed`. The
143
+ patched engine reports no reserved lock, and the next open of such a store
144
+ plays the journal back.
145
+
146
+ - **Fixed: a web SQLite open with the wrong key state leaves the file as it was.**
147
+ The open reads the first page of the file through an immutable read-only
148
+ connection with no key before it opens the file. An open with no key of an
149
+ encrypted file, or an open with a key of a plaintext file, rejects with
150
+ `file is not a database` and plays no hot journal back. In 12.0.0 and
151
+ earlier, such an open of a file with a hot journal played the journal back
152
+ through the wrong key state and left the file corrupt.
153
+
154
+ - **Fixed: `ratchetConfig.maxSkip` sets the skip limit.** The client passes
155
+ `SignalProtocolClientConfig.ratchetConfig.maxSkip` to the session cipher of
156
+ the protocol manager that it creates. In 12.0.0 and earlier, the client did
157
+ not read the option. A gap above the limit fails with
158
+ `TOO_MANY_SKIPPED_MESSAGES`. The default is 25000, which is the value that
159
+ the cipher used before. The API reference said 1000 and now says 25000. A
160
+ value that is not a positive integer fails at client creation with
161
+ `ratchetConfig.maxSkip must be a positive integer.` A `protocolManager` that
162
+ the caller supplies keeps its own limit. The client does not read
163
+ `maxMessageKeysStored` or `keyExpirationMs`. Their reference now states the
164
+ fixed values: 2000 skipped message keys per receiver chain, deleted after 7
165
+ days.
166
+
167
+
3
168
  ## 12.0.0
4
169
 
5
170
  - **Breaking: every new session uses PQXDH, and the SDK has no classical key
package/README.md CHANGED
@@ -39,7 +39,7 @@ The relay never needs message plaintext or device private keys.
39
39
 
40
40
  The OpenE2EE Signal Protocol SDK 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).
41
41
 
42
- Version `12.0.x`. Public APIs and persisted formats follow semantic versioning.
42
+ Version `13.0.x`. Public APIs and persisted formats follow semantic versioning.
43
43
 
44
44
  ## Install
45
45
 
package/SECURITY.md CHANGED
@@ -7,8 +7,8 @@ backports.
7
7
 
8
8
  | Version | Supported |
9
9
  | -------- | ------------------ |
10
- | 12.0.x | :white_check_mark: |
11
- | < 12.0.0 | :x: |
10
+ | 13.0.x | :white_check_mark: |
11
+ | < 13.0.0 | :x: |
12
12
 
13
13
  ## Reporting a Vulnerability
14
14
 
@@ -110,7 +110,7 @@ await signal.encryptMessage('bob:2', 'Hello'); // Secondary device
110
110
  The protocol handles out-of-order messages automatically via MKSKIPPED. For failures:
111
111
 
112
112
  1. Check that both parties established sessions
113
- 2. Verify message counters are not too far apart (maxSkip limit: 1000)
113
+ 2. Verify message counters are not too far apart (default `maxSkip` limit: 25000)
114
114
  3. Check that no sender or transport duplicates messages
115
115
  4. Check that skipped keys did not expire (7-day default)
116
116
 
@@ -118,12 +118,12 @@ The protocol handles out-of-order messages automatically via MKSKIPPED. For fail
118
118
 
119
119
  **"Failed to decrypt" or "MAC verification failed"**
120
120
 
121
- | Symptom | Cause | Solution |
122
- | ----------- | ----------------------- | ------------------------------------------------ |
123
- | MAC failed | Data corrupted | Check network, verify no modification in transit |
124
- | Wrong key | Session mismatch | Verify sessionId matches sender |
125
- | Key expired | Message > 7 days old | Cannot recover; re-send message |
126
- | Counter gap | > 1000 messages skipped | Increase `maxSkip` or re-establish session |
121
+ | Symptom | Cause | Solution |
122
+ | ----------- | ------------------------ | ------------------------------------------------ |
123
+ | MAC failed | Data corrupted | Check network, verify no modification in transit |
124
+ | Wrong key | Session mismatch | Verify sessionId matches sender |
125
+ | Key expired | Message > 7 days old | Cannot recover; re-send message |
126
+ | Counter gap | > 25000 messages skipped | Increase `maxSkip` or re-establish session |
127
127
 
128
128
  ---
129
129
 
package/client/README.md CHANGED
@@ -325,6 +325,46 @@ A wake client has no socket. Use `hostedRelayWakePresence(client)` beside
325
325
  `pullHostedRelayAfterWake()`. It has the same members without `watch()`, and
326
326
  it sends each request as one authenticated HTTP request.
327
327
 
328
+ ### Group init status
329
+
330
+ `getGroupInitStatus(groupId)` gives the init status of a group on this device.
331
+ It gives null when the device has no record of the group.
332
+
333
+ - `ready` means that the device holds the group key and the newest group state
334
+ that it knows.
335
+ - `stale` means that a sender named a newer revision than the stored state.
336
+ The client fetches the newer state.
337
+ - `pending` means that the device holds the group key and has no group state
338
+ yet. The client fetches the state.
339
+ - `no-key` means that the device knows the group but holds no group key. The
340
+ client cannot fetch the group until the device gets the key.
341
+ - `denied` means that the group server refused the newest revision that the
342
+ device knows.
343
+
344
+ `onGroupInitStatus(groupId, status)` runs when a client write to the record of
345
+ a group changes its status. It does not run when the status stays the same, or
346
+ when a write deletes the record. It also does not run for a status that the
347
+ store holds when the client starts, or for a write that the application makes
348
+ to the group store. So read each status at start, and then use the hook.
349
+
350
+ <!-- doc-snippet:skip requires-external-context -->
351
+ ```ts
352
+ import { createSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
353
+
354
+ const client = await createSignalProtocolClient({
355
+ identity,
356
+ adapters: { storage, relay },
357
+ groups,
358
+ hooks: {
359
+ onGroupInitStatus: (groupId, status) => groupList.setInitStatus(groupId, status),
360
+ },
361
+ });
362
+
363
+ for (const groupId of groupList.groupIds()) {
364
+ groupList.setInitStatus(groupId, await client.getGroupInitStatus(groupId));
365
+ }
366
+ ```
367
+
328
368
  ### Background key maintenance
329
369
 
330
370
  Use the dedicated headless entry point from a background task after restoring
package/device/README.md CHANGED
@@ -118,9 +118,35 @@ challenge in the calling process. Thus that process must hold the active
118
118
  device's store, private keys included. The adapter's `linkDevice()` gets a
119
119
  challenge signer for each device and no private key.
120
120
 
121
- The link copies no protocol state and no group state. Sessions start fresh.
122
- For each group, the application brings the group master key to the new device,
123
- and the new device then calls `syncGroup()`.
121
+ The link copies the master key of each group that the active device's group
122
+ store lists into the new device's group store. The copy runs in the calling
123
+ process, so no master key crosses the Relay. A client with `groups` on the new
124
+ device then fetches each copied group. The application calls no group method
125
+ for this. The link copies no protocol state, so sessions start fresh.
126
+
127
+ A group record that a release before 12.0.0 wrote, and that the active device
128
+ has not read since, is not listed and is not copied. Read each group once on
129
+ the active device before the link to copy it. Otherwise the group initializes
130
+ on the new device from its first group message.
131
+
132
+ If a client runs on the active device during the link, pass its group store as
133
+ `activeGroupStore`, or stop that client first. The new device's store must hold
134
+ no group state. The link refuses a store that lists a group with
135
+ `HostedRelayDeviceLinkError`.
136
+
137
+ The copied keys live in the new device's group store. The SDK does not move
138
+ them again. A later move of that store is the application's store move.
139
+
140
+ The new device gets its own registration ID. The link writes it into the new
141
+ device's store before it registers. A device that a 12.0.x release linked
142
+ keeps the ID that it has.
143
+
144
+ The application calls no sender-key method for the new device. A group send
145
+ gives the sender key to the listed devices of other members that have no
146
+ handoff row. A handoff row records that the Relay accepted a distribution of
147
+ the sender's key for one device. So the next group send of each other member
148
+ that lists the new device gives it that member's key. The sender's own other
149
+ devices get the sent transcript and no distribution.
124
150
 
125
151
  ## Transfer cryptographic state
126
152
 
@@ -49,6 +49,7 @@ import type { SesameMessage, SesameStats } from '../internal/sesame/types.js';
49
49
  import { type Logger } from '../logger.js';
50
50
  import { type SenderKeyDistributionMessage } from '../internal/protocol/sender-keys/index.js';
51
51
  import { type BlockedRecipientsSyncInput, type MediaAttachmentDeleteSyncInput, type GroupContentContext, type ReadSyncEntryInput, type RecipientUsernameSyncInput, type ViewOnceOpenSyncInput } from './content-adapter.js';
52
+ import { type GroupInitStatus } from './group-init-status.js';
52
53
  import type { ContentRecoveryStatus } from '../types/protocol-config.js';
53
54
  import type { DataMessageInput } from './types.js';
54
55
  import type { AttachmentTransferOptions, SendOptions, SendResult, SafetyNumber, IncomingEnvelope, PendingReceive, ProcessEnvelopeOptions, ReceiveOutcome } from './types.js';
@@ -1651,6 +1652,13 @@ export declare class DefaultSignalProtocolClient implements SignalProtocolClient
1651
1652
  * Get decrypted group state (from cache or server).
1652
1653
  */
1653
1654
  getGroupState(groupId: GroupId): Promise<DecryptedGroup>;
1655
+ /**
1656
+ * Get the init status of a group on this device.
1657
+ *
1658
+ * @returns The status, or null when this device has no record of the group
1659
+ * @throws {EncryptionError} When the client has no groups config
1660
+ */
1661
+ getGroupInitStatus(groupId: GroupId): Promise<GroupInitStatus | null>;
1654
1662
  /**
1655
1663
  * Sync group state from server.
1656
1664
  */
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../client/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;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,aAAa,EACb,oBAAoB,EAIrB,MAAM,UAAU,CAAC;AAoBlB,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAChC,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAiB,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAA+B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,KAAK,0BAA0B,EAE/B,KAAK,8BAA8B,EAEnC,KAAK,mBAAmB,EAExB,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAE/B,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAkC3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAA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,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"}
@@ -62,6 +62,7 @@ import { SenderKeyManager, } from '../internal/protocol/sender-keys/index.js';
62
62
  import { createDefaultSignalProtocolContentAdapter, } from './content-adapter.js';
63
63
  // Note: group utilities (isGroupId, extractGroupId, createGroupId) are used by SignalProtocolServiceCipher
64
64
  import { createGroupId, extractGroupId, isGroupId } from '../internal/groups/index.js';
65
+ import { observeGroupInitStatus, readGroupInitStatus, } from './group-init-status.js';
65
66
  import { removeDistributionsFromMessageRecords } from './distribution-records.js';
66
67
  import { GroupSenderKeyOperations } from './group-sender-key-operations.js';
67
68
  import { GroupReceiveRefusedError, classifyGroupContent, createGroupMembershipChecker, createGroupReceiveEvaluator, groupOfContext, } from './group-receive-authorization.js';
@@ -333,6 +334,10 @@ export class DefaultSignalProtocolClient {
333
334
  !['auto', 'always', 'off'].includes(config.deliveryReceipts)) {
334
335
  throw new Error("deliveryReceipts must be 'auto', 'always', or 'off'");
335
336
  }
337
+ const maxSkip = config.ratchetConfig?.maxSkip;
338
+ if (maxSkip !== undefined && (!Number.isSafeInteger(maxSkip) || maxSkip <= 0)) {
339
+ throw new Error('ratchetConfig.maxSkip must be a positive integer.');
340
+ }
336
341
  this._userId = userId;
337
342
  this.deviceId = deviceId;
338
343
  this.config = config;
@@ -383,10 +388,11 @@ export class DefaultSignalProtocolClient {
383
388
  remoteObjectStore: this.remoteObjectStore,
384
389
  config: config.media,
385
390
  });
386
- // Dependency injection: Use provided protocol manager or create new one with our storage and protocol strategy
391
+ // Dependency injection: Use provided protocol manager or create new one with our storage,
392
+ // protocol strategy, and skip limit. A provided manager keeps its own skip limit.
387
393
  this.manager =
388
394
  config.protocolManager ??
389
- new DefaultSignalProtocolManager(this._storage, config.protocolStrategy, this.logger);
395
+ new DefaultSignalProtocolManager(this._storage, config.protocolStrategy, this.logger, config.ratchetConfig?.maxSkip);
390
396
  // Validate manager was created successfully before initializing Sesame
391
397
  if (!this.manager) {
392
398
  throw new EncryptionError('Protocol manager must be initialized before Sesame manager', EncryptionErrorCode.INITIALIZATION_FAILED);
@@ -407,7 +413,12 @@ export class DefaultSignalProtocolClient {
407
413
  // Initialize the group manager if configured
408
414
  if (config?.groups) {
409
415
  const groupConfig = config.groups;
410
- this.groupStore = config.groups.store ?? new SignalProtocolGroupStateStore(this._storage);
416
+ // Each client write to a group record reports a changed init status.
417
+ this.groupStore = observeGroupInitStatus(config.groups.store ?? new SignalProtocolGroupStateStore(this._storage), {
418
+ isObserved: () => typeof this.hooks.onGroupInitStatus === 'function',
419
+ report: (groupId, status) => callHook(this.hooks, 'onGroupInitStatus', createGroupId(groupId), status),
420
+ logger: this.logger,
421
+ });
411
422
  const sessions = new WeakMap();
412
423
  this.groupSessionFor = (authority) => {
413
424
  const cached = sessions.get(authority);
@@ -3709,6 +3720,18 @@ export class DefaultSignalProtocolClient {
3709
3720
  async getGroupState(groupId) {
3710
3721
  return GroupOps.getGroupState(this.ctx, await this.groups, groupId);
3711
3722
  }
3723
+ /**
3724
+ * Get the init status of a group on this device.
3725
+ *
3726
+ * @returns The status, or null when this device has no record of the group
3727
+ * @throws {EncryptionError} When the client has no groups config
3728
+ */
3729
+ async getGroupInitStatus(groupId) {
3730
+ if (!this.groupStore) {
3731
+ throw new EncryptionError('Groups not configured. Provide groups config to DefaultSignalProtocolClient.create().', EncryptionErrorCode.INITIALIZATION_FAILED);
3732
+ }
3733
+ return readGroupInitStatus(this.groupStore, extractGroupId(groupId));
3734
+ }
3712
3735
  /**
3713
3736
  * Sync group state from server.
3714
3737
  */