@open-e2ee/signal-protocol-sdk 11.0.0 → 12.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 (583) hide show
  1. package/ADAPTERS.md +4 -4
  2. package/ARCHITECTURE.md +6 -8
  3. package/CHANGELOG.md +1315 -0
  4. package/README.md +1 -1
  5. package/SECURITY.md +2 -2
  6. package/TROUBLESHOOTING.md +1 -1
  7. package/client/README.md +70 -37
  8. package/device/README.md +39 -85
  9. package/dist/client/client.d.ts +334 -63
  10. package/dist/client/client.d.ts.map +1 -1
  11. package/dist/client/client.js +1168 -184
  12. package/dist/client/client.js.map +1 -1
  13. package/dist/client/config.d.ts +40 -32
  14. package/dist/client/config.d.ts.map +1 -1
  15. package/dist/client/config.js +1 -1
  16. package/dist/client/config.js.map +1 -1
  17. package/dist/client/constants.d.ts +42 -8
  18. package/dist/client/constants.d.ts.map +1 -1
  19. package/dist/client/constants.js +48 -3
  20. package/dist/client/constants.js.map +1 -1
  21. package/dist/client/content-adapter.d.ts +80 -0
  22. package/dist/client/content-adapter.d.ts.map +1 -1
  23. package/dist/client/content-adapter.js +225 -12
  24. package/dist/client/content-adapter.js.map +1 -1
  25. package/dist/client/delivery-error.d.ts +150 -0
  26. package/dist/client/delivery-error.d.ts.map +1 -0
  27. package/dist/client/delivery-error.js +226 -0
  28. package/dist/client/delivery-error.js.map +1 -0
  29. package/dist/client/delivery-status.d.ts +32 -6
  30. package/dist/client/delivery-status.d.ts.map +1 -1
  31. package/dist/client/delivery-status.js +61 -13
  32. package/dist/client/delivery-status.js.map +1 -1
  33. package/dist/client/device-set-reconciliation.d.ts +196 -0
  34. package/dist/client/device-set-reconciliation.d.ts.map +1 -0
  35. package/dist/client/device-set-reconciliation.js +282 -0
  36. package/dist/client/device-set-reconciliation.js.map +1 -0
  37. package/dist/client/distribution-records.d.ts +29 -0
  38. package/dist/client/distribution-records.d.ts.map +1 -0
  39. package/dist/client/distribution-records.js +33 -0
  40. package/dist/client/distribution-records.js.map +1 -0
  41. package/dist/client/event-hooks.d.ts +280 -14
  42. package/dist/client/event-hooks.d.ts.map +1 -1
  43. package/dist/client/event-hooks.js +8 -0
  44. package/dist/client/event-hooks.js.map +1 -1
  45. package/dist/client/group-device-set.d.ts +47 -0
  46. package/dist/client/group-device-set.d.ts.map +1 -0
  47. package/dist/client/group-device-set.js +65 -0
  48. package/dist/client/group-device-set.js.map +1 -0
  49. package/dist/client/group-fetcher.d.ts +116 -0
  50. package/dist/client/group-fetcher.d.ts.map +1 -0
  51. package/dist/client/group-fetcher.js +598 -0
  52. package/dist/client/group-fetcher.js.map +1 -0
  53. package/dist/client/group-outbox.d.ts +172 -10
  54. package/dist/client/group-outbox.d.ts.map +1 -1
  55. package/dist/client/group-outbox.js +915 -74
  56. package/dist/client/group-outbox.js.map +1 -1
  57. package/dist/client/group-receive-authorization.d.ts +127 -4
  58. package/dist/client/group-receive-authorization.d.ts.map +1 -1
  59. package/dist/client/group-receive-authorization.js +270 -20
  60. package/dist/client/group-receive-authorization.js.map +1 -1
  61. package/dist/client/group-sealed-sender.d.ts +3 -0
  62. package/dist/client/group-sealed-sender.d.ts.map +1 -1
  63. package/dist/client/group-sealed-sender.js +1 -0
  64. package/dist/client/group-sealed-sender.js.map +1 -1
  65. package/dist/client/group-sender-key-operations.d.ts +14 -3
  66. package/dist/client/group-sender-key-operations.d.ts.map +1 -1
  67. package/dist/client/group-sender-key-operations.js +26 -5
  68. package/dist/client/group-sender-key-operations.js.map +1 -1
  69. package/dist/client/groups.d.ts +5 -5
  70. package/dist/client/groups.d.ts.map +1 -1
  71. package/dist/client/groups.js +5 -4
  72. package/dist/client/groups.js.map +1 -1
  73. package/dist/client/hosted-anonymous-delivery.d.ts +61 -9
  74. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  75. package/dist/client/hosted-anonymous-delivery.js +242 -48
  76. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  77. package/dist/client/hosted-assertion-id.d.ts +7 -0
  78. package/dist/client/hosted-assertion-id.d.ts.map +1 -0
  79. package/dist/client/hosted-assertion-id.js +51 -0
  80. package/dist/client/hosted-assertion-id.js.map +1 -0
  81. package/dist/client/hosted-mailbox-subscription.d.ts +34 -2
  82. package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
  83. package/dist/client/hosted-mailbox-subscription.js +87 -17
  84. package/dist/client/hosted-mailbox-subscription.js.map +1 -1
  85. package/dist/client/hosted-push.d.ts +22 -4
  86. package/dist/client/hosted-push.d.ts.map +1 -1
  87. package/dist/client/hosted-push.js +75 -22
  88. package/dist/client/hosted-push.js.map +1 -1
  89. package/dist/client/hosted-transport.d.ts +22 -28
  90. package/dist/client/hosted-transport.d.ts.map +1 -1
  91. package/dist/client/hosted-transport.js +115 -55
  92. package/dist/client/hosted-transport.js.map +1 -1
  93. package/dist/client/hosted.d.ts +10 -4
  94. package/dist/client/hosted.d.ts.map +1 -1
  95. package/dist/client/hosted.js +10 -4
  96. package/dist/client/hosted.js.map +1 -1
  97. package/dist/client/index.d.ts +5 -3
  98. package/dist/client/index.d.ts.map +1 -1
  99. package/dist/client/index.js +2 -0
  100. package/dist/client/index.js.map +1 -1
  101. package/dist/client/messages.d.ts +25 -3
  102. package/dist/client/messages.d.ts.map +1 -1
  103. package/dist/client/messages.js +111 -20
  104. package/dist/client/messages.js.map +1 -1
  105. package/dist/client/receive-admission.d.ts +58 -0
  106. package/dist/client/receive-admission.d.ts.map +1 -0
  107. package/dist/client/receive-admission.js +78 -0
  108. package/dist/client/receive-admission.js.map +1 -0
  109. package/dist/client/receive-expiry.d.ts +31 -0
  110. package/dist/client/receive-expiry.d.ts.map +1 -0
  111. package/dist/client/receive-expiry.js +35 -0
  112. package/dist/client/receive-expiry.js.map +1 -0
  113. package/dist/client/receive-hook-bound.d.ts +50 -0
  114. package/dist/client/receive-hook-bound.d.ts.map +1 -0
  115. package/dist/client/receive-hook-bound.js +115 -0
  116. package/dist/client/receive-hook-bound.js.map +1 -0
  117. package/dist/client/receive-queue.d.ts +299 -0
  118. package/dist/client/receive-queue.d.ts.map +1 -0
  119. package/dist/client/receive-queue.js +1420 -0
  120. package/dist/client/receive-queue.js.map +1 -0
  121. package/dist/client/receive-work-seed.d.ts +54 -0
  122. package/dist/client/receive-work-seed.d.ts.map +1 -0
  123. package/dist/client/receive-work-seed.js +116 -0
  124. package/dist/client/receive-work-seed.js.map +1 -0
  125. package/dist/client/recovery-driver.d.ts +25 -0
  126. package/dist/client/recovery-driver.d.ts.map +1 -0
  127. package/dist/client/recovery-driver.js +121 -0
  128. package/dist/client/recovery-driver.js.map +1 -0
  129. package/dist/client/relay-acceptance.d.ts +20 -7
  130. package/dist/client/relay-acceptance.d.ts.map +1 -1
  131. package/dist/client/relay-acceptance.js +30 -12
  132. package/dist/client/relay-acceptance.js.map +1 -1
  133. package/dist/client/relay-device-refusal.d.ts +18 -0
  134. package/dist/client/relay-device-refusal.d.ts.map +1 -1
  135. package/dist/client/relay-device-refusal.js +31 -0
  136. package/dist/client/relay-device-refusal.js.map +1 -1
  137. package/dist/client/relay-sealed-route.d.ts +36 -0
  138. package/dist/client/relay-sealed-route.d.ts.map +1 -0
  139. package/dist/client/relay-sealed-route.js +45 -0
  140. package/dist/client/relay-sealed-route.js.map +1 -0
  141. package/dist/client/relay-subscription.d.ts +56 -13
  142. package/dist/client/relay-subscription.d.ts.map +1 -1
  143. package/dist/client/relay-subscription.js +193 -123
  144. package/dist/client/relay-subscription.js.map +1 -1
  145. package/dist/client/resendable-content.d.ts +98 -0
  146. package/dist/client/resendable-content.d.ts.map +1 -0
  147. package/dist/client/resendable-content.js +136 -0
  148. package/dist/client/resendable-content.js.map +1 -0
  149. package/dist/client/retry-family.d.ts +57 -10
  150. package/dist/client/retry-family.d.ts.map +1 -1
  151. package/dist/client/retry-family.js +54 -12
  152. package/dist/client/retry-family.js.map +1 -1
  153. package/dist/client/retry-request-envelope.d.ts +107 -8
  154. package/dist/client/retry-request-envelope.d.ts.map +1 -1
  155. package/dist/client/retry-request-envelope.js +172 -23
  156. package/dist/client/retry-request-envelope.js.map +1 -1
  157. package/dist/client/retry-request-lifecycle.d.ts +70 -14
  158. package/dist/client/retry-request-lifecycle.d.ts.map +1 -1
  159. package/dist/client/retry-request-lifecycle.js +162 -32
  160. package/dist/client/retry-request-lifecycle.js.map +1 -1
  161. package/dist/client/retry-terminal-recovery.d.ts +100 -0
  162. package/dist/client/retry-terminal-recovery.d.ts.map +1 -0
  163. package/dist/client/retry-terminal-recovery.js +164 -0
  164. package/dist/client/retry-terminal-recovery.js.map +1 -0
  165. package/dist/client/retry-utils.d.ts +27 -0
  166. package/dist/client/retry-utils.d.ts.map +1 -1
  167. package/dist/client/retry-utils.js +46 -0
  168. package/dist/client/retry-utils.js.map +1 -1
  169. package/dist/client/retry.d.ts +100 -12
  170. package/dist/client/retry.d.ts.map +1 -1
  171. package/dist/client/retry.js +619 -116
  172. package/dist/client/retry.js.map +1 -1
  173. package/dist/client/sealed-sender.d.ts +23 -6
  174. package/dist/client/sealed-sender.d.ts.map +1 -1
  175. package/dist/client/sealed-sender.js +30 -6
  176. package/dist/client/sealed-sender.js.map +1 -1
  177. package/dist/client/sessions.d.ts +2 -2
  178. package/dist/client/sessions.js +2 -2
  179. package/dist/client/signal-service-cipher.d.ts +726 -19
  180. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  181. package/dist/client/signal-service-cipher.js +2260 -342
  182. package/dist/client/signal-service-cipher.js.map +1 -1
  183. package/dist/client/state.d.ts +5 -0
  184. package/dist/client/state.d.ts.map +1 -1
  185. package/dist/client/state.js +11 -1
  186. package/dist/client/state.js.map +1 -1
  187. package/dist/client/storage-protection.d.ts +64 -0
  188. package/dist/client/storage-protection.d.ts.map +1 -0
  189. package/dist/client/storage-protection.js +150 -0
  190. package/dist/client/storage-protection.js.map +1 -0
  191. package/dist/client/types.d.ts +149 -15
  192. package/dist/client/types.d.ts.map +1 -1
  193. package/dist/client/types.js +1 -1
  194. package/dist/client/types.js.map +1 -1
  195. package/dist/device/constants.d.ts +0 -5
  196. package/dist/device/constants.d.ts.map +1 -1
  197. package/dist/device/constants.js +0 -5
  198. package/dist/device/constants.js.map +1 -1
  199. package/dist/device/expo/index.d.ts +4 -17
  200. package/dist/device/expo/index.d.ts.map +1 -1
  201. package/dist/device/expo/index.js +4 -23
  202. package/dist/device/expo/index.js.map +1 -1
  203. package/dist/device/index.d.ts +0 -2
  204. package/dist/device/index.d.ts.map +1 -1
  205. package/dist/device/index.js +0 -7
  206. package/dist/device/index.js.map +1 -1
  207. package/dist/device/lifecycle/manager.d.ts +5 -4
  208. package/dist/device/lifecycle/manager.d.ts.map +1 -1
  209. package/dist/device/lifecycle/manager.js +16 -16
  210. package/dist/device/lifecycle/manager.js.map +1 -1
  211. package/dist/device/lifecycle/types.d.ts +2 -2
  212. package/dist/device/lifecycle/types.d.ts.map +1 -1
  213. package/dist/device/react-native/index.d.ts +4 -15
  214. package/dist/device/react-native/index.d.ts.map +1 -1
  215. package/dist/device/react-native/index.js +4 -21
  216. package/dist/device/react-native/index.js.map +1 -1
  217. package/dist/device/types.d.ts +1 -1
  218. package/dist/groups/index.d.ts +1 -1
  219. package/dist/groups/index.d.ts.map +1 -1
  220. package/dist/index.d.ts +8 -6
  221. package/dist/index.d.ts.map +1 -1
  222. package/dist/index.js +2 -1
  223. package/dist/index.js.map +1 -1
  224. package/dist/internal/crypto/ec/x25519-validation.d.ts +0 -1
  225. package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
  226. package/dist/internal/crypto/ec/x25519-validation.js +0 -1
  227. package/dist/internal/crypto/ec/x25519-validation.js.map +1 -1
  228. package/dist/internal/crypto/validation.d.ts +2 -2
  229. package/dist/internal/groups/index.d.ts +1 -0
  230. package/dist/internal/groups/index.d.ts.map +1 -1
  231. package/dist/internal/groups/index.js +1 -0
  232. package/dist/internal/groups/index.js.map +1 -1
  233. package/dist/internal/groups/manager.d.ts +37 -16
  234. package/dist/internal/groups/manager.d.ts.map +1 -1
  235. package/dist/internal/groups/manager.js +46 -1
  236. package/dist/internal/groups/manager.js.map +1 -1
  237. package/dist/internal/groups/receive-record.d.ts +78 -0
  238. package/dist/internal/groups/receive-record.d.ts.map +1 -0
  239. package/dist/internal/groups/receive-record.js +43 -0
  240. package/dist/internal/groups/receive-record.js.map +1 -0
  241. package/dist/internal/groups/sdk-store.d.ts +27 -3
  242. package/dist/internal/groups/sdk-store.d.ts.map +1 -1
  243. package/dist/internal/groups/sdk-store.js +151 -19
  244. package/dist/internal/groups/sdk-store.js.map +1 -1
  245. package/dist/internal/groups/wire.d.ts +12 -1
  246. package/dist/internal/groups/wire.d.ts.map +1 -1
  247. package/dist/internal/groups/wire.js +36 -0
  248. package/dist/internal/groups/wire.js.map +1 -1
  249. package/dist/internal/manager/index.d.ts +1 -1
  250. package/dist/internal/manager/manager.d.ts +20 -19
  251. package/dist/internal/manager/manager.d.ts.map +1 -1
  252. package/dist/internal/manager/manager.js +56 -39
  253. package/dist/internal/manager/manager.js.map +1 -1
  254. package/dist/internal/protocol/double-ratchet/chains.d.ts +4 -18
  255. package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
  256. package/dist/internal/protocol/double-ratchet/chains.js +23 -74
  257. package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
  258. package/dist/internal/protocol/double-ratchet/index.d.ts +1 -1
  259. package/dist/internal/protocol/double-ratchet/index.d.ts.map +1 -1
  260. package/dist/internal/protocol/double-ratchet/index.js +1 -1
  261. package/dist/internal/protocol/double-ratchet/index.js.map +1 -1
  262. package/dist/internal/protocol/double-ratchet/ratchet.d.ts +5 -7
  263. package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
  264. package/dist/internal/protocol/double-ratchet/ratchet.js +4 -6
  265. package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
  266. package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
  267. package/dist/internal/protocol/pqxdh/pqxdh.js +2 -1
  268. package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
  269. package/dist/internal/protocol/sealed-sender/types.d.ts +6 -8
  270. package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
  271. package/dist/internal/protocol/sealed-sender/types.js +8 -9
  272. package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
  273. package/dist/internal/protocol/sender-keys/handoff-ledger.d.ts +110 -0
  274. package/dist/internal/protocol/sender-keys/handoff-ledger.d.ts.map +1 -0
  275. package/dist/internal/protocol/sender-keys/handoff-ledger.js +124 -0
  276. package/dist/internal/protocol/sender-keys/handoff-ledger.js.map +1 -0
  277. package/dist/internal/protocol/sender-keys/manager.d.ts +71 -62
  278. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  279. package/dist/internal/protocol/sender-keys/manager.js +228 -175
  280. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  281. package/dist/internal/protocol/spqr/index.d.ts +2 -2
  282. package/dist/internal/protocol/spqr/index.d.ts.map +1 -1
  283. package/dist/internal/protocol/spqr/index.js +2 -2
  284. package/dist/internal/protocol/spqr/index.js.map +1 -1
  285. package/dist/internal/protocol/spqr/serialize.d.ts +9 -1
  286. package/dist/internal/protocol/spqr/serialize.d.ts.map +1 -1
  287. package/dist/internal/protocol/spqr/serialize.js +56 -16
  288. package/dist/internal/protocol/spqr/serialize.js.map +1 -1
  289. package/dist/internal/protocol/spqr/spqr.d.ts +1 -14
  290. package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
  291. package/dist/internal/protocol/spqr/spqr.js +54 -42
  292. package/dist/internal/protocol/spqr/spqr.js.map +1 -1
  293. package/dist/internal/protocol/spqr/validate.d.ts +26 -6
  294. package/dist/internal/protocol/spqr/validate.d.ts.map +1 -1
  295. package/dist/internal/protocol/spqr/validate.js +49 -21
  296. package/dist/internal/protocol/spqr/validate.js.map +1 -1
  297. package/dist/internal/sesame/index.d.ts +1 -1
  298. package/dist/internal/sesame/index.d.ts.map +1 -1
  299. package/dist/internal/sesame/index.js.map +1 -1
  300. package/dist/internal/sesame/manager.d.ts +66 -13
  301. package/dist/internal/sesame/manager.d.ts.map +1 -1
  302. package/dist/internal/sesame/manager.js +221 -87
  303. package/dist/internal/sesame/manager.js.map +1 -1
  304. package/dist/internal/sesame/types.d.ts +95 -17
  305. package/dist/internal/sesame/types.d.ts.map +1 -1
  306. package/dist/internal/sesame/types.js +17 -0
  307. package/dist/internal/sesame/types.js.map +1 -1
  308. package/dist/internal/session/builder.d.ts +5 -5
  309. package/dist/internal/session/builder.d.ts.map +1 -1
  310. package/dist/internal/session/builder.js +12 -17
  311. package/dist/internal/session/builder.js.map +1 -1
  312. package/dist/internal/session/cipher.d.ts +13 -11
  313. package/dist/internal/session/cipher.d.ts.map +1 -1
  314. package/dist/internal/session/cipher.js +40 -22
  315. package/dist/internal/session/cipher.js.map +1 -1
  316. package/dist/internal/session/factory.d.ts +5 -5
  317. package/dist/internal/session/factory.d.ts.map +1 -1
  318. package/dist/internal/session/factory.js +4 -4
  319. package/dist/internal/session/factory.js.map +1 -1
  320. package/dist/internal/session/handshake.d.ts +14 -16
  321. package/dist/internal/session/handshake.d.ts.map +1 -1
  322. package/dist/internal/session/handshake.js +18 -75
  323. package/dist/internal/session/handshake.js.map +1 -1
  324. package/dist/internal/session/index.d.ts +1 -1
  325. package/dist/internal/session/index.js +1 -1
  326. package/dist/internal/session/record-locks.d.ts +17 -6
  327. package/dist/internal/session/record-locks.d.ts.map +1 -1
  328. package/dist/internal/session/record-locks.js +43 -7
  329. package/dist/internal/session/record-locks.js.map +1 -1
  330. package/dist/internal/session/session-resolver.d.ts +1 -1
  331. package/dist/internal/session/session-resolver.js +1 -1
  332. package/dist/internal/session/state.d.ts +2 -2
  333. package/dist/internal/session/state.js +1 -1
  334. package/dist/internal/session/types.d.ts +4 -12
  335. package/dist/internal/session/types.d.ts.map +1 -1
  336. package/dist/internal/session/types.js +1 -1
  337. package/dist/keys/generation.d.ts +2 -2
  338. package/dist/keys/generation.js +2 -2
  339. package/dist/keys/types.d.ts +5 -5
  340. package/dist/keys/types.d.ts.map +1 -1
  341. package/dist/keys/types.js +1 -1
  342. package/dist/layers.d.ts +1 -1
  343. package/dist/layers.js +2 -2
  344. package/dist/layers.js.map +1 -1
  345. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  346. package/dist/local/store/expo/adapter.js +12 -8
  347. package/dist/local/store/expo/adapter.js.map +1 -1
  348. package/dist/local/store/key-value/adapter.d.ts +76 -10
  349. package/dist/local/store/key-value/adapter.d.ts.map +1 -1
  350. package/dist/local/store/key-value/adapter.js +367 -61
  351. package/dist/local/store/key-value/adapter.js.map +1 -1
  352. package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -1
  353. package/dist/local/store/key-value/backend-conformance.js +74 -0
  354. package/dist/local/store/key-value/backend-conformance.js.map +1 -1
  355. package/dist/local/store/key-value/batch.d.ts +2 -0
  356. package/dist/local/store/key-value/batch.d.ts.map +1 -1
  357. package/dist/local/store/key-value/batch.js +26 -0
  358. package/dist/local/store/key-value/batch.js.map +1 -1
  359. package/dist/local/store/key-value/receive-work.d.ts +55 -0
  360. package/dist/local/store/key-value/receive-work.d.ts.map +1 -0
  361. package/dist/local/store/key-value/receive-work.js +162 -0
  362. package/dist/local/store/key-value/receive-work.js.map +1 -0
  363. package/dist/local/store/key-value/send-log.d.ts +61 -0
  364. package/dist/local/store/key-value/send-log.d.ts.map +1 -0
  365. package/dist/local/store/key-value/send-log.js +430 -0
  366. package/dist/local/store/key-value/send-log.js.map +1 -0
  367. package/dist/local/store/key-value/sender-key-handoff.d.ts +68 -0
  368. package/dist/local/store/key-value/sender-key-handoff.d.ts.map +1 -0
  369. package/dist/local/store/key-value/sender-key-handoff.js +189 -0
  370. package/dist/local/store/key-value/sender-key-handoff.js.map +1 -0
  371. package/dist/local/store/key-value/storage.d.ts +15 -0
  372. package/dist/local/store/key-value/storage.d.ts.map +1 -1
  373. package/dist/local/store/keyed-index.d.ts +23 -0
  374. package/dist/local/store/keyed-index.d.ts.map +1 -0
  375. package/dist/local/store/keyed-index.js +41 -0
  376. package/dist/local/store/keyed-index.js.map +1 -0
  377. package/dist/local/store/memory/adapter.d.ts +44 -12
  378. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  379. package/dist/local/store/memory/adapter.js +197 -46
  380. package/dist/local/store/memory/adapter.js.map +1 -1
  381. package/dist/local/store/memory/send-log.d.ts +42 -0
  382. package/dist/local/store/memory/send-log.d.ts.map +1 -0
  383. package/dist/local/store/memory/send-log.js +190 -0
  384. package/dist/local/store/memory/send-log.js.map +1 -0
  385. package/dist/local/store/node/adapter.d.ts.map +1 -1
  386. package/dist/local/store/node/adapter.js +8 -6
  387. package/dist/local/store/node/adapter.js.map +1 -1
  388. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  389. package/dist/local/store/react-native/adapter.js +12 -8
  390. package/dist/local/store/react-native/adapter.js.map +1 -1
  391. package/dist/local/store/receive-work.d.ts +87 -0
  392. package/dist/local/store/receive-work.d.ts.map +1 -0
  393. package/dist/local/store/receive-work.js +204 -0
  394. package/dist/local/store/receive-work.js.map +1 -0
  395. package/dist/local/store/received-content.d.ts +3 -3
  396. package/dist/local/store/received-content.d.ts.map +1 -1
  397. package/dist/local/store/received-content.js +2 -11
  398. package/dist/local/store/received-content.js.map +1 -1
  399. package/dist/local/store/reliability.d.ts +317 -18
  400. package/dist/local/store/reliability.d.ts.map +1 -1
  401. package/dist/local/store/reliability.js +371 -46
  402. package/dist/local/store/reliability.js.map +1 -1
  403. package/dist/local/store/send-log-order.d.ts +15 -0
  404. package/dist/local/store/send-log-order.d.ts.map +1 -0
  405. package/dist/local/store/send-log-order.js +24 -0
  406. package/dist/local/store/send-log-order.js.map +1 -0
  407. package/dist/local/store/sender-key-handoff-index.d.ts +38 -0
  408. package/dist/local/store/sender-key-handoff-index.d.ts.map +1 -0
  409. package/dist/local/store/sender-key-handoff-index.js +101 -0
  410. package/dist/local/store/sender-key-handoff-index.js.map +1 -0
  411. package/dist/local/store/sender-key-handoff-table.d.ts +29 -0
  412. package/dist/local/store/sender-key-handoff-table.d.ts.map +1 -0
  413. package/dist/local/store/sender-key-handoff-table.js +97 -0
  414. package/dist/local/store/sender-key-handoff-table.js.map +1 -0
  415. package/dist/local/store/sqlite/encryption.d.ts +8 -1
  416. package/dist/local/store/sqlite/encryption.d.ts.map +1 -1
  417. package/dist/local/store/sqlite/encryption.js +9 -0
  418. package/dist/local/store/sqlite/encryption.js.map +1 -1
  419. package/dist/local/store/sqlite/key-storage/index.d.ts +25 -4
  420. package/dist/local/store/sqlite/key-storage/index.d.ts.map +1 -1
  421. package/dist/local/store/sqlite/key-storage/index.js +68 -7
  422. package/dist/local/store/sqlite/key-storage/index.js.map +1 -1
  423. package/dist/local/store/sqlite/key-storage/message-records.d.ts +16 -4
  424. package/dist/local/store/sqlite/key-storage/message-records.d.ts.map +1 -1
  425. package/dist/local/store/sqlite/key-storage/message-records.js +49 -6
  426. package/dist/local/store/sqlite/key-storage/message-records.js.map +1 -1
  427. package/dist/local/store/sqlite/key-storage/metadata.d.ts +8 -7
  428. package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -1
  429. package/dist/local/store/sqlite/key-storage/metadata.js +17 -15
  430. package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -1
  431. package/dist/local/store/sqlite/key-storage/receive-work.d.ts +27 -0
  432. package/dist/local/store/sqlite/key-storage/receive-work.d.ts.map +1 -0
  433. package/dist/local/store/sqlite/key-storage/receive-work.js +98 -0
  434. package/dist/local/store/sqlite/key-storage/receive-work.js.map +1 -0
  435. package/dist/local/store/sqlite/key-storage/send-log.d.ts +27 -0
  436. package/dist/local/store/sqlite/key-storage/send-log.d.ts.map +1 -0
  437. package/dist/local/store/sqlite/key-storage/send-log.js +178 -0
  438. package/dist/local/store/sqlite/key-storage/send-log.js.map +1 -0
  439. package/dist/local/store/sqlite/key-storage/sender-key-handoff.d.ts +27 -0
  440. package/dist/local/store/sqlite/key-storage/sender-key-handoff.d.ts.map +1 -0
  441. package/dist/local/store/sqlite/key-storage/sender-key-handoff.js +75 -0
  442. package/dist/local/store/sqlite/key-storage/sender-key-handoff.js.map +1 -0
  443. package/dist/local/store/sqlite/key-storage/session-trust.d.ts +2 -2
  444. package/dist/local/store/sqlite/key-storage/session-trust.js +5 -5
  445. package/dist/local/store/sqlite/key-storage/session-trust.js.map +1 -1
  446. package/dist/local/store/sqlite/migrations.d.ts.map +1 -1
  447. package/dist/local/store/sqlite/migrations.js +101 -0
  448. package/dist/local/store/sqlite/migrations.js.map +1 -1
  449. package/dist/local/store/sqlite/models/index.d.ts +2 -1
  450. package/dist/local/store/sqlite/models/index.d.ts.map +1 -1
  451. package/dist/local/store/sqlite/models/index.js +5 -1
  452. package/dist/local/store/sqlite/models/index.js.map +1 -1
  453. package/dist/local/store/sqlite/models/message-record.d.ts +15 -0
  454. package/dist/local/store/sqlite/models/message-record.d.ts.map +1 -1
  455. package/dist/local/store/sqlite/models/message-record.js +24 -0
  456. package/dist/local/store/sqlite/models/message-record.js.map +1 -1
  457. package/dist/local/store/sqlite/models/send-log.d.ts +51 -0
  458. package/dist/local/store/sqlite/models/send-log.d.ts.map +1 -0
  459. package/dist/local/store/sqlite/models/send-log.js +206 -0
  460. package/dist/local/store/sqlite/models/send-log.js.map +1 -0
  461. package/dist/local/store/sqlite/open-store.d.ts +9 -1
  462. package/dist/local/store/sqlite/open-store.d.ts.map +1 -1
  463. package/dist/local/store/sqlite/open-store.js +20 -1
  464. package/dist/local/store/sqlite/open-store.js.map +1 -1
  465. package/dist/local/store/sqlite/schema.d.ts +34 -1
  466. package/dist/local/store/sqlite/schema.d.ts.map +1 -1
  467. package/dist/local/store/sqlite/schema.js +14 -0
  468. package/dist/local/store/sqlite/schema.js.map +1 -1
  469. package/dist/local/store/sqlite/store.d.ts +61 -11
  470. package/dist/local/store/sqlite/store.d.ts.map +1 -1
  471. package/dist/local/store/sqlite/store.js +191 -27
  472. package/dist/local/store/sqlite/store.js.map +1 -1
  473. package/dist/local/store/web/adapter.d.ts +76 -8
  474. package/dist/local/store/web/adapter.d.ts.map +1 -1
  475. package/dist/local/store/web/adapter.js +579 -127
  476. package/dist/local/store/web/adapter.js.map +1 -1
  477. package/dist/local/store/web/receive-work.d.ts +57 -0
  478. package/dist/local/store/web/receive-work.d.ts.map +1 -0
  479. package/dist/local/store/web/receive-work.js +99 -0
  480. package/dist/local/store/web/receive-work.js.map +1 -0
  481. package/dist/local/store/web/send-log.d.ts +92 -0
  482. package/dist/local/store/web/send-log.d.ts.map +1 -0
  483. package/dist/local/store/web/send-log.js +267 -0
  484. package/dist/local/store/web/send-log.js.map +1 -0
  485. package/dist/local/store/web/sender-key-handoff.d.ts +81 -0
  486. package/dist/local/store/web/sender-key-handoff.d.ts.map +1 -0
  487. package/dist/local/store/web/sender-key-handoff.js +156 -0
  488. package/dist/local/store/web/sender-key-handoff.js.map +1 -0
  489. package/dist/local/store/web-sqlite/adapter.d.ts +2 -0
  490. package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -1
  491. package/dist/local/store/web-sqlite/adapter.js +12 -6
  492. package/dist/local/store/web-sqlite/adapter.js.map +1 -1
  493. package/dist/local/vault/custody.d.ts +8 -0
  494. package/dist/local/vault/custody.d.ts.map +1 -0
  495. package/dist/local/vault/custody.js +9 -0
  496. package/dist/local/vault/custody.js.map +1 -0
  497. package/dist/local/vault/electron-safe-storage.d.ts +3 -1
  498. package/dist/local/vault/electron-safe-storage.d.ts.map +1 -1
  499. package/dist/local/vault/electron-safe-storage.js +2 -0
  500. package/dist/local/vault/electron-safe-storage.js.map +1 -1
  501. package/dist/local/vault/expo-secure-store.d.ts +3 -1
  502. package/dist/local/vault/expo-secure-store.d.ts.map +1 -1
  503. package/dist/local/vault/expo-secure-store.js +2 -0
  504. package/dist/local/vault/expo-secure-store.js.map +1 -1
  505. package/dist/local/vault/indexed-db.d.ts +3 -1
  506. package/dist/local/vault/indexed-db.d.ts.map +1 -1
  507. package/dist/local/vault/indexed-db.js +2 -0
  508. package/dist/local/vault/indexed-db.js.map +1 -1
  509. package/dist/local/vault/react-native-keychain.d.ts +3 -1
  510. package/dist/local/vault/react-native-keychain.d.ts.map +1 -1
  511. package/dist/local/vault/react-native-keychain.js +2 -0
  512. package/dist/local/vault/react-native-keychain.js.map +1 -1
  513. package/dist/remote/relay/device-set.d.ts +94 -0
  514. package/dist/remote/relay/device-set.d.ts.map +1 -0
  515. package/dist/remote/relay/device-set.js +156 -0
  516. package/dist/remote/relay/device-set.js.map +1 -0
  517. package/dist/remote/relay/types.d.ts +92 -107
  518. package/dist/remote/relay/types.d.ts.map +1 -1
  519. package/dist/safety/core.d.ts +15 -6
  520. package/dist/safety/core.d.ts.map +1 -1
  521. package/dist/safety/core.js +41 -27
  522. package/dist/safety/core.js.map +1 -1
  523. package/dist/safety/index.d.ts +2 -1
  524. package/dist/safety/index.d.ts.map +1 -1
  525. package/dist/safety/index.js +12 -18
  526. package/dist/safety/index.js.map +1 -1
  527. package/dist/types/api.d.ts +707 -62
  528. package/dist/types/api.d.ts.map +1 -1
  529. package/dist/types/errors.d.ts +14 -33
  530. package/dist/types/errors.d.ts.map +1 -1
  531. package/dist/types/errors.js +14 -24
  532. package/dist/types/errors.js.map +1 -1
  533. package/dist/types/messages.d.ts +2 -2
  534. package/dist/types/messages.js +1 -1
  535. package/dist/types/protocol-config.d.ts +175 -42
  536. package/dist/types/protocol-config.d.ts.map +1 -1
  537. package/dist/types/protocol-config.js +19 -38
  538. package/dist/types/protocol-config.js.map +1 -1
  539. package/dist/types/protocol-constants.d.ts +6 -6
  540. package/dist/types/protocol-constants.js +6 -6
  541. package/dist/types/session.d.ts +7 -7
  542. package/dist/types/session.d.ts.map +1 -1
  543. package/dist/types/session.js +39 -21
  544. package/dist/types/session.js.map +1 -1
  545. package/dist/username/link.d.ts +2 -2
  546. package/dist/username/link.js +2 -2
  547. package/dist/utils/origin-lock.d.ts +45 -0
  548. package/dist/utils/origin-lock.d.ts.map +1 -0
  549. package/dist/utils/origin-lock.js +80 -0
  550. package/dist/utils/origin-lock.js.map +1 -0
  551. package/docs/ASSURANCE.md +6 -6
  552. package/docs/CLIENT_COMPOSITION.md +2 -2
  553. package/docs/DEVIATIONS.md +677 -182
  554. package/docs/E2EE.md +1 -1
  555. package/docs/ERROR_HANDLING.md +165 -2
  556. package/docs/GETTING_STARTED.md +7 -4
  557. package/docs/INTERFACES.md +1 -1
  558. package/docs/PACKAGE_SURFACE.md +6 -5
  559. package/docs/PROTOCOL_POLICY.md +102 -22
  560. package/docs/RECIPES.md +3 -15
  561. package/docs/SECURITY.md +90 -5
  562. package/keys/README.md +3 -3
  563. package/local/store/README.md +78 -14
  564. package/local/store/key-value/README.md +14 -3
  565. package/local/store/node/README.md +8 -3
  566. package/local/store/web/README.md +9 -0
  567. package/local/store/web-sqlite/README.md +14 -2
  568. package/local/vault/README.md +21 -0
  569. package/package.json +1 -6
  570. package/remote/README.md +0 -1
  571. package/remote/relay/README.md +2 -2
  572. package/dist/device/provisioning.d.ts +0 -242
  573. package/dist/device/provisioning.d.ts.map +0 -1
  574. package/dist/device/provisioning.js +0 -421
  575. package/dist/device/provisioning.js.map +0 -1
  576. package/dist/internal/protocol/x3dh/index.d.ts +0 -15
  577. package/dist/internal/protocol/x3dh/index.d.ts.map +0 -1
  578. package/dist/internal/protocol/x3dh/index.js +0 -13
  579. package/dist/internal/protocol/x3dh/index.js.map +0 -1
  580. package/dist/internal/protocol/x3dh/x3dh.d.ts +0 -131
  581. package/dist/internal/protocol/x3dh/x3dh.d.ts.map +0 -1
  582. package/dist/internal/protocol/x3dh/x3dh.js +0 -261
  583. package/dist/internal/protocol/x3dh/x3dh.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,1320 @@
1
1
  # Changelog
2
2
 
3
+ ## 12.0.0
4
+
5
+ - **Breaking: every new session uses PQXDH, and the SDK has no classical key
6
+ agreement.** A peer bundle without an ML-KEM prekey fails with
7
+ `PQXDH_REQUIRED`, and no setting allows a classical X3DH session.
8
+ `'required'` is the only `postQuantum` value. `PostQuantumPolicy.Compatible`
9
+ and the `'compatible'` value are removed, and `postQuantum: 'compatible'`
10
+ throws `Unsupported postQuantum policy` at client creation.
11
+ `ProtocolStrategyConfig.allowClassicalFallback` is removed, and the SDK
12
+ ignores the key from an untyped caller. `ClassicalFallbackReason` is removed
13
+ from `./client/config` and `./types`. `ProtocolSelectionEvent` no longer
14
+ carries `usedClassicalFallback` or `classicalFallbackReason`.
15
+ `X3DH_INFO_DEFAULT` is removed from `./client/config` and `./types`, and
16
+ `ResolvedKeyExchangeInfoStrings` carries only `pqxdh`. `PQXDHFallbackType`,
17
+ `PQXDHRequiredErrorOptions.fallbackType`, and `PQXDHRequiredError.fallbackType`
18
+ are removed; read `PQXDHRequiredError.reason` (`no_kyber_prekey` or
19
+ `pqxdh_failed`) instead. The X3DH module and its `performX3DH`,
20
+ `performX3DHResponder`, `calculateX3DHSharedSecret`, `EphemeralKeyPair`,
21
+ `X3DHResult`, `X3DHResponderInput`, and `X3DHResponderResult` exports are
22
+ removed. `validateProtocolStrategy` no
23
+ longer warns about a classical fallback. A stored 11.x classical session
24
+ continues as a Double Ratchet session.
25
+ - **Breaking: the managed device link is the one link path.** The SDK no
26
+ longer ships the device provisioning protocol. `linkHostedRelayDevice()` is
27
+ the one way to link a device. A linked device gets the account identity by
28
+ device transfer or by an application-owned channel. The managed device link
29
+ runs in one process that holds the active device's store and the new
30
+ device's store. It sends no private key to the Relay. These public names
31
+ are removed: the `./device/provisioning` subpath and its exports
32
+ `DEFAULT_PROVISIONING_LINK_PREFIX`, `LocalDeviceMetadata`,
33
+ `ProvisioningGroupStateStore`, `ProvisioningIdentityStore`,
34
+ `ProvisioningKeyPair`, `ProvisioningLocalStateStore`, `ProvisioningMessage`,
35
+ `ProvisioningQRData`, `ProvisioningReceiveOptions`, `ProvisioningSendOptions`,
36
+ `ProvisioningUsernameStateStore`, `UserProfile`, `cancelProvisioning`,
37
+ `connectToProvisioningSession`, `generateProvisioningQR`,
38
+ `parseProvisioningQR`, `provisionDevice` and `receiveProvisioningMessage`,
39
+ with their `./device` re-exports; `PROVISIONING_SESSION_TTL_MS` from
40
+ `./device/constants`; `getDeviceMetadata` from `./device/expo` and
41
+ `./device/react-native`; `ProvisioningService` from `./remote/relay/types`;
42
+ the `SignalProtocolRelayServer` methods `createProvisioningSession`,
43
+ `connectNewDevice`, `sendProvisioningMessage`, `getProvisioningMessage`,
44
+ `completeProvisioning`, `acknowledgeProvisioning`, `rollbackProvisioning` and
45
+ `deleteProvisioningSession`, with their `HostedRelayHttpTransport` members;
46
+ and `DeviceChoice.requiresQR`. A relay adapter drops these methods.
47
+ - **Fixed: a blocked head of the mailbox no longer stalls the HTTP pull.**
48
+ A mailbox pull, and so `pullHostedRelayAfterWake`, now sends the Relay
49
+ cursor of the page before it, so the pull moves past a full page of
50
+ unacknowledged envelopes and gives the messages and Relay receipts behind
51
+ it. Three kinds of envelope stay unacknowledged: an envelope that the
52
+ receive bounds refuse, a decrypt failure that no retry request owns, and
53
+ a retry request that waits for the next group fetch. The cursor lives in
54
+ memory only. An empty page, a page without a Relay cursor, a failed pull,
55
+ and a restart clear it, so the next pull starts at the head and offers
56
+ those envelopes again. The recovery pull after failed work also starts at
57
+ the head. Advancing
58
+ the cursor acknowledges nothing, so the Relay keeps each envelope. Before,
59
+ a full page of such envelopes came back on each pull, and the messages
60
+ behind it waited.
61
+ - **Changed: hosted registration and recovery accept a native assertion with
62
+ no `jti`.** The transport binds the challenge to the exact assertion,
63
+ purpose, and operation ID. The Relay verifies the configured provider and
64
+ rejects an invalid token. An assertion with a valid `jti` keeps that
65
+ identifier.
66
+ - **Breaking: a send declares its device sets, and the Relay compares
67
+ them.** Each post to an account declares the device IDs that the sender
68
+ holds records for. `Envelope.declaredDeviceIds` carries the declaration of
69
+ a direct post, and the hosted transport sends it as `deviceSets`.
70
+ `SignalProtocolRelayServer.sendMultiRecipientUnidentified` takes a 9th
71
+ argument, `deviceSets`, for a sealed post. The relay `send()` returns the
72
+ optional `deviceSetChecked` and `needsSync`.
73
+ `sendMultiRecipientUnidentified` returns the optional `deviceSetChecked`
74
+ and `refusals`. The Relay refuses a declaration that does not match with
75
+ 409 `DEVICE_SET_MISMATCH`, which names the missing and the extra devices,
76
+ or with 410 `STALE_DEVICE`, which names the devices whose registration
77
+ changed. The SDK then removes each extra device record, starts a new
78
+ session with each missing or stale device, encrypts the message again only
79
+ for those devices, and posts again. The hosted transport finds each device
80
+ in the device directory before it posts, on the identified and on the
81
+ sealed route. A declared post to a device that the directory does not list
82
+ fails before the post with the 409 `DEVICE_SET_MISMATCH` refusal of the
83
+ Relay, which names the device as extra, so the SDK removes the device
84
+ record and posts again. A device that the Relay accepted keeps
85
+ its stored post. A send has a recipient phase and then a sync phase, and
86
+ each phase can restart 10 times. When the recipient phase does not match
87
+ after the 10th restart, or the Relay refuses a restart post with
88
+ `OPERATION_EXPIRED`, the send throws the new
89
+ `DeviceSetReconciliationError`. The outbox keeps the send as terminal, and
90
+ a call of `send()` with the same `clientMessageId` starts a new run at 0
91
+ restarts. A group restart keeps the group ciphertext, seals the shared body
92
+ again, and replaces it in one write. A device-specific resend, a receipt,
93
+ and a retry request declare nothing. A custom relay and a wrapper of a
94
+ relay do not compare, get no declaration, and keep the device list reads. `docs/DEVIATIONS.md` sections 5.5 and 5.6 compare this
95
+ loop with Signal's.
96
+ - **Breaking: a send to a recipient with a session reads no device list on a
97
+ comparing relay.** The Relay refuses a declared post that misses a device
98
+ or names a removed one, so the 60 s freshness window applies only to a
99
+ relay that does not compare. A recipient with no session gets one list
100
+ read to start the sessions. A group send declares the devices of its
101
+ records, and reads the list of a member only when it holds no record for
102
+ that member. A replay reads no device list. One exception holds in a live
103
+ send and in a replay. A repair that leaves an account with no device
104
+ record reads the list of that account once.
105
+ - **Breaking: the own device list is read only on `needsSync`.** On a
106
+ comparing relay, the recipient phase posts first. Its receipt sets
107
+ `needsSync` when the sender account has other devices. The sync phase then
108
+ declares the own devices that the sender holds records for. When the
109
+ sender holds no record of another own device, the send reads the own list
110
+ once. A failed read no longer fails the send. The recipient result is
111
+ stored first, and the result carries `syncPending: true` when the sync
112
+ phase does not complete or the own list cannot be read. Call `send()`
113
+ again with the same `clientMessageId` to post the pending copies. A replay
114
+ reads the own list again when the send could not read it. The SDK makes no
115
+ sync post without a destination.
116
+ - **Breaking: a custom store keeps the device-set fields of an outgoing
117
+ intent.** An outgoing intent adds `deviceSetRestarts`,
118
+ `deviceSetUnresolved`, `deviceSetBundleMissing`, and `syncPending`. A
119
+ custom metadata store must keep each field of the stored intent value,
120
+ also a field that it does not know.
121
+ The fields need no schema step, because they live in the existing JSON
122
+ value of the intent.
123
+ - **Breaking: a refused group-token destination is no longer inferred as
124
+ stale.** The group-token receipt names each refused destination with its
125
+ code in `refusals`. A `STALE_DEVICE` destination leaves the shared group
126
+ message and gets the device repair once. A `NOT_FOUND` destination of a
127
+ declared post settles a removed account: the SDK adds nothing for it, and
128
+ `uuids404` names the account only when the receipt is not a duplicate.
129
+ `SendResult.refusedDestinationCount` stays a count, and the SDK infers no
130
+ code from it.
131
+ - **Breaking: a repair fails the send on a session error other than a
132
+ missing bundle.** When the start of a new session for a refused device
133
+ fails for another reason, such as an untrusted identity, the send fails
134
+ with that error. A listed device with no prekey bundle makes the send wait
135
+ and restart, and counts each restart. The repair write stores each such
136
+ device in the outbox. A replay after a process restart, a stop, or a
137
+ terminal end starts a session with each stored device before its first
138
+ post, so the device gets the message when it has a bundle again. When the
139
+ send holds no message for an account, a bundle fetch that the Relay
140
+ answers with `NOT_FOUND` removes the record of the device. The Relay gives
141
+ that answer for an unregistered device, and for a registered device with
142
+ no uploaded prekeys. Each other device that the account record holds gets
143
+ the message in the same repair when it has a session or a bundle. An
144
+ account left with no device record gets one list read, and a listed device
145
+ with no bundle waits again within the restart bound. Thus a replay reaches a device that the account linked
146
+ after an unlink. Before, a replay of a send whose recipient had no other
147
+ device failed with `SESSION_NOT_FOUND`, and a group replay completed
148
+ without the member.
149
+ - **Added: `SendResult.syncPending`.** It is true when the Relay accepted
150
+ the send for every recipient device and the copies for the other devices
151
+ of the own account are not posted yet.
152
+ - **Added: the `onRelayProtocolError` hook and `RelayProtocolError`.** The
153
+ Relay marks each accepted declared post with `deviceSetChecked`. When an
154
+ accepted declared post has no mark, the send is delivered and its result
155
+ does not change. The client reports a `RelayProtocolError` with the code
156
+ `DEVICE_SET_UNCHECKED` and the route of the post once for the send through
157
+ `onRelayProtocolError`. A sync copy to another own device is a declared
158
+ post too, on the `identified-direct` route. A sync payload of a method such
159
+ as `syncReadToLinkedDevices` reports its error once with no
160
+ `clientMessageId`. The new exported types are
161
+ `DeviceSetReconciliationError`, `RelayProtocolError`, `DeviceSetDevice`,
162
+ `DeviceSetLastRefusal`, `DeviceSetPhase`, `DeviceSetRefusalAccount`,
163
+ `DeviceSetUnresolved`, `DeviceSetUnresolvedReason`,
164
+ `RelayProtocolErrorCode`, and `RelayProtocolRoute`.
165
+ - **Added: `HostedAnonymousDeliveryError.data`.** The error keeps the
166
+ `details` object of the Relay answer. For a refused declared post, it
167
+ names the missing, the extra, or the stale devices.
168
+ - **Breaking: the skipped-key cap applies to each receiver chain.** A
169
+ receiver chain keeps at most `maxMessageKeysStored` skipped message keys,
170
+ 2000 by default, as libsignal keeps `MAX_MESSAGE_KEYS` for each chain. When
171
+ a chain is at the cap, its key with the lowest index leaves. A store to one
172
+ chain never evicts a key of another chain. Before this change, the cap
173
+ applied to all five chains together, and the oldest key of any chain left.
174
+ A session now keeps up to 2000 keys in each of its five chains. The 7-day
175
+ `maxMessageKeyAge` limit does not change. `countTotalMessageKeys` and
176
+ `evictOldestMessageKey` are removed from the double-ratchet exports.
177
+ - **Breaking: a receive pass waits for each hook for at most 2 minutes.**
178
+ The new `protocol.receiveQueue.receiveHookTimeoutMs` option sets the
179
+ bound. The default is 120000 ms. The value must be a positive integer of
180
+ at most 2147483647 ms, so `create()` refuses zero, a negative value, a
181
+ fraction, and `Infinity`. The bound applies to each hook that a receive
182
+ pass awaits. At the bound, the SDK logs a warning with the
183
+ `RECEIVE_HOOK_TIMEOUT` behavior and no longer waits for the hook. A
184
+ timeout of `onMessageDecrypted` or `onDelivered` counts as one failed hook
185
+ attempt, with the normal backoff and attempt cap, and it logs no
186
+ `RECEIVE_HOOK_FAILED` warning. A timeout of another hook ends that call,
187
+ and the pass continues. A hook that settles after its bound writes
188
+ nothing. An application whose hook can run longer than 2 minutes sets a
189
+ larger bound.
190
+ - **Breaking: a delivery receipt stops its retries 1 day after it becomes
191
+ due.** One Signal client gives its delivery receipt job the same 1-day
192
+ lifespan.
193
+ When a receive record waits for its delivery receipt for 1 day,
194
+ the SDK completes the record. It sends no receipt, it does not call
195
+ `onMessageDecrypted` again, and it gives no `onReceiveExpired` report,
196
+ because the application already has the content. A resend record still
197
+ reports `onDeliveryRecovered`. The 30-day receive age still applies, so a
198
+ record whose age ends first completes at its age. Before this change, a
199
+ receipt retried until the receive age of 30 days.
200
+ - **Breaking: SPQR skipped keys leave by index distance in each epoch, not
201
+ by age.** The SPQR receive path now keeps held skipped keys as the
202
+ SparsePostQuantumRatchet chain keeps its key history. Each epoch keeps at
203
+ most `maxOutOfOrderKeys` keys after a trim, 2000 by default. A key whose
204
+ index plus `maxOutOfOrderKeys` is below the receive counter of its epoch
205
+ is refused with `DECRYPTION_FAILED` and the reason `key-trimmed`. A
206
+ receive holds only the skipped keys at or above its own horizon. A jump
207
+ above `maxOutOfOrderKeys` clears the held keys of that epoch. When an epoch
208
+ holds 2201 keys, the keys behind the horizon leave. No eviction reads the
209
+ clock, and the `timestamp` field stays in the persisted shape. When the
210
+ send epoch prunes an old epoch, the held keys of that epoch leave with its
211
+ chains, so a key of a pruned epoch no longer decrypts. Before this change,
212
+ the trim ran only when all epochs together held 2000 keys, and one receive
213
+ then added every key of its gap, up to 24999 keys. The internal
214
+ `deserializeSPQRState` loader refused a state above 2000 keys. It now
215
+ keeps the highest 2200 indexes of each epoch, drops the keys of an epoch
216
+ with no chain, and logs one warning with the dropped count. The
217
+ `cleanupSPQRState` export and `SPQR_CONFIG.MAX_SKIPPED_KEY_AGE` are
218
+ removed from the SPQR module for the 12.0.0 cut, because no receive path
219
+ called them. `trimSkippedKeys` is replaced by
220
+ `trimEpochSkippedKeys(state, epoch)`.
221
+ - **Breaking: safety numbers order the two parties as libsignal does.**
222
+ Each party gets its own 30-digit display string. The string that is lower
223
+ by byte comparison comes first, in the 60 digits, the emoji, and the hex.
224
+ The SDK no longer compares the two user identifiers, so no locale and no
225
+ identifier character can change the order. For some identifier pairs, the
226
+ displayed safety number of 12.0.0 differs from the one of 11.x. The 30
227
+ digits of each party do not change, and only their order changes. This
228
+ applies to `client.verify()` and `generateCompositeSafetyNumber`, and also
229
+ to `generateSingleKeyReferenceSafetyNumber`, `Fingerprint`, and
230
+ `createFingerprintData`. The composite QR profile version steps from 3 to
231
+ 4 for the 12.0.0 cut. A QR code from an 11.x client then reports
232
+ `version_mismatch`, not `no_match`. The single-key QR profile stays at
233
+ version 2, because the new order makes its output equal to libsignal
234
+ version 2.
235
+ - **Breaking: a safety-number confirmation from an earlier version is
236
+ refused.** `SafetyNumberConfirmation.version` steps from 1 to 2 with the
237
+ composite QR profile step. `confirmSafetyNumber` refuses a version 1
238
+ confirmation with the unsupported-version error, not with
239
+ `IDENTITY_MISMATCH`. The app calls `verify()` again and shows the new safety
240
+ number.
241
+ - **Fixed: a cached safety number keeps the QR orientation of its caller.**
242
+ Before, the cache gave the swapped call for the other party the same cached
243
+ result. Its QR code then carried the first caller's orientation, so a scan
244
+ against the other party's QR code reported `no_match`. The cache now keeps
245
+ one entry for each orientation.
246
+ - **Fixed: an archived session no longer sends a PreKeyMessage.** When a
247
+ session moves to the archive, the SDK now clears its unacknowledged prekey
248
+ state: the pending flag, the prekey IDs, and the Kyber and KEM one-time
249
+ ciphertexts, as libsignal does. Before, a session that was archived before
250
+ the peer replied kept that state, and a later promotion made its next send
251
+ a PreKeyMessage for prekeys that the peer could already have deleted. The
252
+ in-memory store archive now follows the same record rule, so it also keeps
253
+ at most 40 archived sessions.
254
+ - **Changed: archived sessions are evicted by insertion order, not by last
255
+ use.** Over 40 archived sessions, the session that went into the archive
256
+ first leaves, as libsignal does. Before, the session with the oldest
257
+ `lastUsedAt` left. A session archived again under the same base key moves
258
+ to the newest end.
259
+ - **Breaking: a removed device keeps its record and its archived sessions.**
260
+ `SesameManager.removeDevice` now archives the current session of the
261
+ device, keeps the record, and marks it removed with the new
262
+ `DeviceRecord.removedAt` field. Before, the removal deleted the record and
263
+ its sessions, so a message that the device sent before its removal did not
264
+ decrypt. Now that message decrypts on the archived session. A removed
265
+ device gets no fan-out: a send, a sync copy, a receipt, and a sender-key
266
+ distribution skip it. A send to a user whose devices are all removed fails
267
+ with `NO_DEVICES`. A second removal of the same device writes nothing and
268
+ emits no second `onDeviceRemoved` event.
269
+ - **Changed: a device list that names a removed device again relists it.**
270
+ The removed marker clears, and the device returns to fan-out with no
271
+ current session. The archived sessions stay. The relist emits
272
+ `onDeviceAdded` once. A group send to a removed member device reads its
273
+ device list again before it gives the sender key. A device that is still
274
+ removed after that read gets no key. The new
275
+ `SesameManager.relistDevice` call relists one device.
276
+ - **Changed: a declared send counts a removed device record as absent.**
277
+ On a comparing relay, a send declares only the devices whose records are
278
+ not marked removed. A repair that removes an extra device, or a device
279
+ whose bundle fetch the Relay answers with `NOT_FOUND`, marks its record.
280
+ A member or an own account whose every record is marked removed gets the
281
+ list read of an account with no record. A repair that starts a session
282
+ with a missing device relists its record, so the next post declares it.
283
+ - **Changed: an identity change keeps the archived sessions.** When a device
284
+ list gives a new identity key for a device, the SDK archives the current
285
+ session, takes the new key, and marks the device pending verification.
286
+ Before, it deleted the record and its sessions and added the device again,
287
+ with an `onDeviceRemoved` and an `onDeviceAdded` event. Now a message under
288
+ the old session still decrypts, and the change emits no device event. A
289
+ removed device whose identity changes is relisted, with one
290
+ `onDeviceAdded` event.
291
+ - **Changed: the client deletes stale device records at each start.** The
292
+ receive queue runs `cleanupStaleRecords` once in each run, after its
293
+ resume. A removed record goes when its removal is older than `maxLatency`,
294
+ 30 days by default. The cleanup also deletes a record that has no session
295
+ and is older than `maxLatency`. Before, no SDK path ran the cleanup.
296
+ - **Breaking: a custom store keeps and deletes removed device records.** A
297
+ `SesameStore` must keep the `removedAt` field of a device record.
298
+ `deleteStaleRecords` must also delete a record for which
299
+ `isExpiredRemovedDevice` is true. `getSesameDeviceIds` still returns the
300
+ removed devices, and a caller that sends to the devices skips them with
301
+ `isRemovedDevice`.
302
+ - **Breaking: the SQLite schema moves to version 6 and the IndexedDB database
303
+ to version 11.** Neither step changes a table or an object store. The steps
304
+ keep an earlier SDK, which sends to a removed device, from opening the
305
+ store. An earlier SDK refuses the SQLite file with
306
+ `SqliteSchemaTooNewError`, and the browser refuses the IndexedDB open with
307
+ a `VersionError`. A downgrade is not supported.
308
+ - **Added: `isRemovedDevice` and `isExpiredRemovedDevice`.** The two
309
+ predicates are exported from the `types` entry point. `isRemovedDevice`
310
+ tells whether a device record is marked removed. `isExpiredRemovedDevice`
311
+ tells whether the stale-record cleanup deletes a removed record.
312
+ - **Changed: a waiting receive record holds back only its conversation.** A
313
+ record that waits for its group state, or for a hook retry below the
314
+ attempt cap, holds back the later records of its conversation, as one
315
+ Signal client queues its message jobs. Group content keys by its group,
316
+ a sent transcript of this account keys by its destination, and other
317
+ content keys by its sender account. Before this change, a waiting record
318
+ held back every later record of its sender device, in every group and in
319
+ direct chats. Now direct chats and other groups make progress, and a
320
+ blocked group holds back its later content from every sender. A record
321
+ that waits behind an earlier record of its group counts toward the share
322
+ of that group in the receive queue, so a stalled group reaches its share
323
+ sooner, and its new sender-key messages wait at the Relay. The order in
324
+ which the device commits its records stays per sender device.
325
+ - **Added: `discardPendingReceive` removes a receive that the application
326
+ cannot process.** The call takes the `messageId` that
327
+ `listPendingReceives` gives. It removes a receive that has not reached its
328
+ delivery receipt, and returns the removed receive, or `null` when no
329
+ listed receive matches. It sends no receipt, it does not call
330
+ `onMessageDecrypted`, and it gives no `onReceiveExpired` report. A
331
+ redelivery of the envelope then gives `duplicate` and decrypts nothing.
332
+ A hook call that already started still runs. Each
333
+ `PendingReceive` now gives `hookAttempts`, the count of failed
334
+ `onMessageDecrypted` attempts. Its `messageId` is now always set: a
335
+ receive stored before the client kept message IDs gives its record ID, as
336
+ the `processed` outcome does.
337
+ - **Changed: group sends and session locks order the tabs of one origin.**
338
+ When `navigator.locks.request` exists and the store has a
339
+ `storeIdentity`, a group Sender Key operation runs under the Web Lock
340
+ `open-e2ee:group-send:<store identity>:<lock key>`. The session lock, the
341
+ user lock, and the device-list sync lock run under
342
+ `open-e2ee:session:<store identity>:<lock key>`. Two tabs or workers of
343
+ one origin on one store then encrypt in turn, so two group messages never
344
+ carry one iteration and two direct messages never carry one counter.
345
+ Before this change, each tab had only its own in-process lock. A page or
346
+ engine with no Web Locks, and a store with no identity, keeps the
347
+ in-process locks. Two tabs on one store are then not ordered, and the
348
+ application must give one tab exclusive access to the store. The session
349
+ lock and the device-list sync lock still end a wait after 5 seconds. On
350
+ the Web Lock path the wait rejects with `ORIGIN_LOCK_TIMEOUT_MESSAGE`, and
351
+ on the in-process path with the message of the in-process lock. A stop of
352
+ the relay work still ends the wait of a group operation. A Web Lock has no limit on its waiting requests. The
353
+ in-process session lock still refuses a request when 1,000 requests wait.
354
+ - **Added: `storeIdentity` on the local store contract.** The optional
355
+ member names the data of a store, so that each tab and worker of an
356
+ origin gives the same name for the same data. The IndexedDB store and the
357
+ web SQLite store give their database names. A
358
+ custom web store that shares its data across tabs sets it, so that its
359
+ sends take the Web Locks.
360
+ - **Fixed: a sender-key rotation keeps the states that another client
361
+ wrote.** Each `SenderKeyManager` kept its own copy of the previous
362
+ states, and a rotation or a new distribution built the archive from that
363
+ copy. When two clients on one store rotated in turn, for example in two
364
+ tabs, the archive lost the states that the other client wrote, so the
365
+ earlier messages of those states no longer decrypted. The manager now
366
+ reads the archive from the stored record each time, and the record keeps
367
+ at most 5 states.
368
+ - **Breaking: a group send gives its sender key to each device that has no
369
+ handoff row.** The SDK keeps a sender-key handoff row for each device of
370
+ another member when the Relay accepts a distribution of the own sender key
371
+ for that device. The row names the group, the sender key ID, the
372
+ generation, the recipient device, and the registration ID of the session.
373
+ A group send reads the device list of each member. It gives the current key
374
+ to each listed device that has no row for the current sender key ID,
375
+ generation, and registration. A row records a handoff. It is not proof
376
+ that the device installed the key. The SDK writes the row after the Relay
377
+ accepts the distribution and before the send marks the distribution sent.
378
+ A dropped distribution writes no row. A new own key, a rotation, and a
379
+ delete of the own key delete the rows of the group. A PreKey session from
380
+ the device, a bundle session that replaces a current session, a session
381
+ archive, a session delete, and a device-record delete delete the rows of
382
+ the device in every group. An identity rotation of a contact deletes the
383
+ rows of each device of that account. A retry request deletes the rows of
384
+ the requester in the group of the failed message only. A session reset
385
+ after an expired retry request deletes the rows of each device of the
386
+ sender account in every group. Client start
387
+ deletes each row that no current own key covers. `docs/DEVIATIONS.md`
388
+ section 7.5 compares this record with the record of the Signal apps and
389
+ gives the reason for each difference.
390
+ `SenderKeyState.distributionPending`,
391
+ `SenderKeyManager.getPendingSenderKeyDistribution`, and
392
+ `SenderKeyManager.confirmSenderKeyDistributionSent` are removed.
393
+ `SenderKeyManager.rotateSenderKey` and `rotateGroupSenderKey` do not take
394
+ `options.distributionPending`. The manager ignores a `distributionPending`
395
+ field in a stored state, and the next write of the state omits it.
396
+ - **Breaking: a custom store keeps the sender-key handoff rows.**
397
+ `SignalProtocolLocalStore` extends the new `SenderKeyHandoffStore`. A
398
+ custom store must implement its six methods: `recordSenderKeyHandoff`,
399
+ `listSenderKeyHandoffs`, `invalidateSenderKeyHandoff`,
400
+ `invalidateAccountSenderKeyHandoffs`, `listSenderKeyHandoffGroupIds`, and
401
+ `retainSenderKeyHandoffs`. Each row delete must be in the same write as
402
+ the change that causes it.
403
+ `storeSenderKeyRecord` and `deleteSenderKey` take the new
404
+ `SenderKeyRecordWriteOptions`. With `deleteSenderKeyHandoffs`, the write
405
+ deletes the rows of the group. `setDeviceRecord` takes the new
406
+ `SetDeviceRecordOptions`, and `SessionTrustCommit` has the field
407
+ `senderKeyHandoffInvalidation`. With the device, the write deletes the
408
+ rows of that device in every group. `archiveCurrentSession`,
409
+ `deleteSessionRecord`, `deleteDeviceRecord`,
410
+ `deleteAllSenderKeysForGroup`, and
411
+ `acceptContactIdentityRotationAndDeleteSessions` always delete the rows
412
+ of their device, group, or account. The memory store keeps the rows in its
413
+ state. The IndexedDB, key-value, and SQLite stores keep the rows durably,
414
+ so a restart does not give the key to a listed device again. The SQLite
415
+ stores add the `sender_key_handoff` table in schema version 5, and the
416
+ IndexedDB store adds the `senderKeyHandoff` object store in database
417
+ version 10. The IndexedDB and key-value stores encrypt each row and find it
418
+ by keyed hashes, so they hold no group ID, account ID, or device in the
419
+ clear.
420
+ - **Breaking: a custom key-value backend must apply
421
+ `removeSenderKeyHandoffs` inside `atomicWrite`.** `KeyValueOperation` has
422
+ the new variant. The part of a key after `keyPrefix` has five
423
+ colon-separated segments: the group hash, the generation, the account
424
+ hash, the recipient hash, and the entry hash. The backend removes each key
425
+ whose group, account, and recipient segments equal every given hash, and
426
+ keeps a key of another shape. It applies the operation in the same
427
+ transaction as the other operations of the batch, and the operation
428
+ observes the earlier writes of the batch. A backend built with
429
+ `createTransactionalKeyValueBackend` applies it already.
430
+ `assertBackendConformance` checks it.
431
+ - **Breaking: the group outbox context and the sync send change.**
432
+ `GroupOutboxContext` does not have `confirmSenderKeyDistributionSent`.
433
+ It has the required members `recordSenderKeyHandoff`,
434
+ `prepareSenderKeyHandoffs`, `resolveOwnDevices`,
435
+ `isConclusiveDeviceRejection`, `repairStaleDevice`, and
436
+ `postSyncMessage`. `postSyncMessage` takes, as its third argument, a
437
+ function that encrypts the transcript again for one own device.
438
+ `prepareSyncMessages` takes the own devices of the send as its fifth
439
+ argument. `postPreMessage` resolves to the new
440
+ `PreMessagePostResult`. `appendOutgoingGroupDeviceMessages` is removed.
441
+ `reconcileOutgoingGroupDeviceSet` removes the messages of devices from an
442
+ intent and adds new messages in one write.
443
+ `DefaultSesameManager.sendToLocalOtherDevices` requires
444
+ `listedDeviceIds`, and it sends only to those own devices.
445
+ - **Changed: each send gives a sync copy to exactly the listed own
446
+ devices.** On a relay that does not compare device sets, each direct or
447
+ group send, and each replay, reads the device list of the own account,
448
+ with no freshness window. A failed
449
+ read stops the recipient post and fails the send, also for an account
450
+ with no linked device, and the outbox retries a stored send. The first
451
+ attempt of a send that fails on this read throws before the SDK stores
452
+ it. The error carries the `clientMessageId`, but the outbox holds no
453
+ transmission for it. The application calls `send()` again, and the SDK
454
+ encrypts the content again. The send gives
455
+ a sync copy to each listed own device other than the sending device. Each
456
+ sync copy is keyed by its device. An own device gets the transcript and
457
+ never a sender-key handoff row. When the Relay refuses an own device as
458
+ stale, the SDK refreshes the session of that device once and encrypts the
459
+ copy again for it. For the transcript of a stored send, the SDK replaces
460
+ the copy in the intent and posts the new copy under a repair ID. The
461
+ device then gets the transcript of that send. When the Relay refuses the
462
+ new copy too, the SDK archives the session, removes the copy from the
463
+ intent, and completes the send. When the refresh fails, or the encryption
464
+ for the new session gives no copy, the send fails. The copy and the new
465
+ session stay, and the outbox retries the stored send. A sync copy of
466
+ account state, such as a read sync, gets the same refresh. The SDK posts
467
+ the new copy again with no operation ID and changes no intent.
468
+ - **Changed: a group replay reads the device lists again.** On a relay that
469
+ does not compare device sets, before the replay of a stored group send, the
470
+ SDK reads the device lists of the members and of the own account. One intent write removes each message of
471
+ a device that the lists do not show. A listed device that the stored send
472
+ does not reach gets the current key of the send and the stored group
473
+ ciphertext. When the sender rotated the key after the send, the added
474
+ device gets only the stored group ciphertext, and the replay completes.
475
+ The device recovers the content through its retry request, and the next
476
+ send gives it the current key. The stored ciphertext does not change, because the Relay
477
+ refuses another operation under the same message ID. Thus a device that
478
+ the replay adds gets the content only through its retry request and the
479
+ resend of a `Resendable` send.
480
+
481
+ - **Breaking: a group state store keeps a receive record for each group.**
482
+ `GroupStateStore` adds `getGroupReceiveRecord`,
483
+ `updateGroupReceiveRecord`, and `listGroupReceiveRecords`. A receive
484
+ record holds the group's required revision, which is the highest revision
485
+ that an authenticated group context has claimed, and the fetch backoff and
486
+ the last verified denial. A custom store must implement the three methods.
487
+ An update that returns null deletes the group's whole record. The SDK
488
+ store writes version 2 group records with an index. It migrates a version
489
+ 1 record forward when it first reads or writes that group, and a crash at
490
+ any migration step reruns safely. A migrated group starts at required
491
+ revision 0 as a locally known group. A record that a context created
492
+ before the group's state was verified also names the sender device that
493
+ claimed it. `storeGroupState` and
494
+ `storeGroupStateWithSenderKeyRotationBarrier` must remove that origin in
495
+ the same write that stores the state. A custom store must do the same.
496
+ - **Breaking: managed group content carries its group context.** Each
497
+ send to a managed group, its sync transcript, and its send log entry now
498
+ carry the group's master key and the revision of the sender's verified
499
+ state inside the encrypted content, as Signal's `GroupContextV2` does. A
500
+ resend therefore carries the context of the original send. The receiving
501
+ client removes the context before it gives the content to the
502
+ application, so the application gets the bytes that the sender sent. An
503
+ ad hoc group send carries no context. `SignalProtocolContentAdapter` adds
504
+ two required methods, `serializeContentWithGroupContext` and
505
+ `withoutGroupContext`, and `inspectContent` reports `groupContext`, or
506
+ `'malformed'` for a context that does not decode. A custom adapter must
507
+ implement both methods and report the context. The default adapter puts
508
+ the context in a `groupContext` member of a JSON object and wraps any
509
+ other content in a `groupContent` member.
510
+ - **Breaking: a managed group receive follows Signal's order.** The
511
+ client decrypts, runs the replay check, and then installs a sender key
512
+ distribution with no group decision, as Signal does. Membership,
513
+ permission, and blocking no longer stop the install. After the install,
514
+ the client derives the group ID from the context's master key and
515
+ compares it with the group of the envelope and of the distribution. A
516
+ context that does not decode is refused as `malformed-context`, and a
517
+ context of another group as `context-mismatch`. Content that a sender
518
+ key decrypts, or that comes beside a distribution, is content of that
519
+ group in every shape. Sync content is content of this account. On the
520
+ Relay subscription, in `receiveIncomingEnvelopes`, and in
521
+ `processIncomingEnvelope` and `decryptGroupMessage`, content from
522
+ another account that carries a sync message is refused as
523
+ `sync-from-other-account` before the distribution install and before
524
+ any group decision, and the application gets no content. The raw
525
+ decrypt methods `receive`, `decryptMessage`, and `decryptMessages`
526
+ return the plaintext with no group classification and do not refuse
527
+ it. Sender-key content from another account is delivered under its
528
+ group, never under a conversation that its content names. When the
529
+ local state is
530
+ below the revision that the context claims, one fetcher brings the group
531
+ up to date before the client decides. The client decides each message
532
+ at the revision that its own context claims, so a false claim uses up
533
+ only its own fetch. The fetcher runs at most one fetch for each claimed
534
+ revision and at most 16 claims in a backoff window. A fetch that ends
535
+ below the claim is complete: the client decides that message at the
536
+ fetched state, the group's required revision becomes the server head,
537
+ or a higher claim that came while the fetch ran, and the backoff does
538
+ not grow. Only a fetch that fails or that the
539
+ server refuses backs off. A claim above the fetched state that the
540
+ window cannot fetch waits for the next window, so false claims hold an
541
+ honest claim for 30 s at most. When the trust
542
+ root has a server signing key, a context that carries the signed change
543
+ to the claimed revision applies that change with no fetch, also when
544
+ the window has fetched its 16 claims. Under
545
+ `allowUnauthenticatedGroupHistory`, the client never applies a carried
546
+ change. Content with no context is decided at the local state, and is
547
+ refused as `legacy-no-context` when the client has no state. While the
548
+ group cannot update, the content waits on the device in the receive
549
+ record that the decrypt committed with the ratchet state, and the receive
550
+ queue decides it when a fetch of its group completes. The client sends
551
+ no retry request and does not call `onDecryptionError`. The fetcher
552
+ tries again in the background and at start. `decryptGroupMessage` throws
553
+ `GroupReceiveUnavailableError` for such content, and the error carries
554
+ the `messageId` of the record. A second call with the same message
555
+ decides the stored content with no second decrypt, also after a restart.
556
+ Two concurrent calls with the same message give the content once. A sender
557
+ device can make at most 100 groups wait for verification. Past the cap,
558
+ a context for a new group is refused as `unverified-cap`. The new
559
+ `groups.isGroupBlocked` config drops the content of a blocked group with
560
+ no report and no fetch. The background fetcher also skips a blocked
561
+ group, at start and on its timer. A block hook that throws any value
562
+ skips only its own group. `decryptGroupMessage` now decrypts before it
563
+ decides, so a refused message uses its message key. `syncGroup` now runs
564
+ through the fetcher, so it joins a fetch in flight and records its
565
+ result. It returns that result only when the fetch called the group
566
+ server. After a fetch that only tried a carried change, it waits for the
567
+ next fetch, its own when no other caller starts one first. An ad hoc
568
+ distribution installs with no `groups` config. The
569
+ package root and the `client` entry export `GroupReceiveUnavailableError`,
570
+ `GroupReceiveRefusedError`, and `GroupResendDeferredError`.
571
+ `processIncomingEnvelope` returns `pending` for content that waits for
572
+ its group and `denied` for refused content, and the caller acknowledges
573
+ the envelope in both cases. A deferred resend leaves the retry request
574
+ with the Relay. See `docs/ERROR_HANDLING.md`.
575
+ - **Breaking: `processIncomingEnvelope` returns a receive outcome.** The
576
+ method now returns a `ReceiveOutcome` in place of the plaintext. Its
577
+ `kind` is `processed`, `pending`, `duplicate`, `null-message`, `denied`,
578
+ or `refused`. Acknowledge the envelope for each kind except `refused`,
579
+ which means that the receive queue has no room: nothing is decrypted or
580
+ stored, so give the envelope again later. A `processed` receive keeps
581
+ its content on the device until the application calls the new
582
+ `completeReceive` with its `messageId`, or until the new `onPersist`
583
+ option resolves. A redelivery before then returns the same outcome with
584
+ no second decrypt. A Relay delivery of an envelope that
585
+ `processIncomingEnvelope` committed reuses that record and installs no
586
+ sender key distribution from it. The new `listPendingReceives` lists the stored
587
+ receives one page at a time, and `{ ready: true }` lists only the
588
+ receives that wait for `completeReceive`. The new
589
+ `processPendingReceives` runs one pass of the receive queue now, and its
590
+ `deadlineMs` option bounds the pass. `processIncomingEnvelopes` returns
591
+ `{ envelope, outcome }` or `{ envelope, error }` for each envelope.
592
+ Before, the method returned the plaintext and deleted the stored content
593
+ before the application saved it, so a crash between the two lost the
594
+ message.
595
+ - **Breaking: a custom store commits a receive record with the ratchet
596
+ state.** `SessionTrustCommit.receiveWork` and
597
+ `SenderKeyReceiveCommit.work` replace `receivedContent` and `content`.
598
+ The store must write the `ReceiveWorkRecord` in the same transaction as
599
+ the session or sender key state, so the ratchet step and the record roll
600
+ back together. The store adds `getReceiveWork`,
601
+ `putReceiveWork`, `listReceiveWork`, `receiveWorkUsage`, and
602
+ `completeReceiveWork`, and removes `getReceivedContent`,
603
+ `deleteReceivedContent`, and `deleteExpiredReceivedContent`.
604
+ `listReceiveWork` returns records in arrival order, by `arrivalSeq` and
605
+ then `workId`, and its `after` query takes the last record of the page
606
+ before, so records with an equal `arrivalSeq` are never skipped.
607
+ `putReceiveWork` and `completeReceiveWork` compare the record revision
608
+ and write nothing on a mismatch. `completeReceiveWork` deletes the record
609
+ and writes its metadata in one transaction.
610
+ `SignalProtocolManager.decrypt` takes a `receiveWork` seed in place of
611
+ `receiveId`. The SQLite schema version 4 and the IndexedDB schema version
612
+ 9 add only the `receive_work` table and object store. After the first
613
+ open, an SDK earlier than 12 cannot open the store. There is no
614
+ downgrade path. At open, each SDK
615
+ store converts the received content rows of SDK 11 to receive records
616
+ that wait for the redelivery of their envelope, and writes its completion
617
+ marker last, so a stop during the conversion is safe. A row that does not
618
+ parse stays in place, and the store reports it with no content: the
619
+ SQLite store through its logger, the other stores through
620
+ `console.error`. When the Relay subscription, `receiveIncomingEnvelopes`,
621
+ or `pullHostedRelayAfterWake` gets the redelivered envelope of a converted
622
+ record, and the client already processed that envelope, the client
623
+ completes the record with no hook call.
624
+ - **Fixed: a receiver installs a sender key that the sender creates again.**
625
+ `processSenderKeyDistribution` matches a key by its sender key ID, as
626
+ Signal's published implementation matches a state by its chain ID and
627
+ signing key. The generation rules apply only to a distribution of the
628
+ current key, and a later generation of that key replaces it in place. A
629
+ distribution of a kept previous key changes nothing. A distribution of
630
+ another key becomes the current state, and the earlier current state
631
+ becomes a previous state, so a message in flight under it still decrypts.
632
+ Before, a receiver dropped each distribution whose generation was not
633
+ above the generation of its current state. `createGroupSenderKey` over an
634
+ existing key, and a delete followed by a create, start again at
635
+ generation 1, so each receiver that held the earlier key failed every
636
+ later group message of that sender device with `SENDER_KEY_MISMATCH`,
637
+ until a rotation took the sender's generation above the one the receiver
638
+ held.
639
+ - **Fixed: every send error carries the logical-send identifier.**
640
+ `send()` chooses the `clientMessageId` before any other step, so
641
+ `isOutgoingMessageError` is true also for an error before the encryption,
642
+ such as a failed content serialization or a failed read of the own device
643
+ list. The application calls `send()` again with the same
644
+ `clientMessageId`. Before, only an error of the encryption carried the
645
+ identifier.
646
+ - **Fixed: a group resend checks membership at the required revision.**
647
+ Before a sender gives group content again, it brings a managed group
648
+ up to the highest revision that an authenticated context claimed. The
649
+ check uses the same receive record, fetch window, and backoff as a
650
+ receive. A requester who is not a member at that revision gets no
651
+ content, and the answer ends as `membership-refused`. When the update
652
+ is fresh, the sender answers from the local state, also when a false
653
+ claim keeps the required revision above the server head, so a removed
654
+ member who claims a false revision is refused and not deferred. When
655
+ the update fails or waits for its backoff, the sender defers the resend
656
+ and does not refuse it. The resend job stays pending for the resend job
657
+ driver, and the retry request envelope stays unacknowledged for the next
658
+ Relay delivery. Before, the sender checked a stale local state, so it could
659
+ resend to a removed member or refuse an added member.
660
+ - **Fixed: unacknowledged messages no longer stall the socket backlog.**
661
+ The mailbox socket now ends each page of durable frames with one
662
+ `acknowledge` frame, with no ID when the page acknowledged nothing. The
663
+ Relay sends the next page of a backlog only on that frame. Before, a page
664
+ of messages that all stayed unacknowledged stalled every page behind it
665
+ until the socket reconnected.
666
+ - **Fixed: received content keeps the time of its first admission.**
667
+ `DecryptedEnvelope.receivedAt` is the time the device first committed
668
+ the content. A first pass, a retry, and a delivery after a restart give
669
+ the same value. Content with no timestamp of its own gives this time as
670
+ its `timestamp` for receipt matching, so each delivery gives the same
671
+ timestamp. The 30-day receive age of stored content
672
+ also counts from this time, through a retry, a redelivery, and a
673
+ restart. Before, the first pass read the clock again after it stored
674
+ the content.
675
+ - **Changed: the client acknowledges a Relay message after its commit.**
676
+ On the Relay subscription and in `pullHostedRelayAfterWake`, the client
677
+ decrypts each envelope and commits its content as a receive record in
678
+ the same transaction as the ratchet step. It acknowledges the envelope
679
+ only after that commit, and sends no acknowledgment when the commit
680
+ fails, as Signal does. The receive queue then decides the group, gives
681
+ the content to `onMessageDecrypted`, and sends the E2EE delivery
682
+ receipt. That receipt is the only proof that the application processed
683
+ the content. A Relay delivery receipt marks only the handoff of the
684
+ content to the device. Content that waits for its group state stays on
685
+ the device, not at the Relay. A hook that throws is tried again after a
686
+ backoff. The device stores the count of each attempt before it calls the
687
+ hook, so a hook call that ends the process also counts as an attempt.
688
+ After 10 attempts, the content no longer holds back the
689
+ later content of its conversation. Each start then offers it to the hook
690
+ once: in the start pass, or at the registration of `onMessageDecrypted`
691
+ when the start pass had no hook. After that offer, only
692
+ `processPendingReceives` tries it again before the next start, until it
693
+ expires or the application discards it. A pass of those that ends before
694
+ the retry, at a deadline or at a failed page read, leaves the retry to
695
+ the next pass. That retry runs after the other content
696
+ of the device, so a hook call that ends the process on it does not stop
697
+ the later content of its conversation. `pullHostedRelayAfterWake` commits, acknowledges, then
698
+ runs `processPendingReceives`, and its new `deadlineMs` option bounds
699
+ that pass. It gives no content to the application before the
700
+ acknowledgment settles. `HostedRelayWakeClient` adds
701
+ `processPendingReceives`. `receiveIncomingEnvelopes` commits each
702
+ envelope and sends no acknowledgment. The content reaches
703
+ `onMessageDecrypted` in a later pass of the receive queue, after the
704
+ call returns. After `stop()`, the content waits for the next start of the
705
+ queue from `startRelaySubscription`, or for `processPendingReceives`. At
706
+ start, the client admits a new envelope only after its first read of the
707
+ stored content ends, so new content of a sender device comes after its stored
708
+ content, also when the clock stepped back across the restart. This order
709
+ holds only when that first read completes. It does not hold after a first
710
+ read that failed, after a `stop()` during the first read, or for an
711
+ envelope received before the first start. Two processes that share one
712
+ store, such as two browser tabs, each keep their own arrival order, so
713
+ content of one process can come before content that the other process
714
+ received earlier. Before, the client acknowledged only after the
715
+ application had the content, so group content that waited for its group
716
+ stayed at the Relay and came back on each delivery.
717
+ - **Added: a bounded receive queue with an expiry hook.** The new
718
+ `protocol.receiveQueue` config sets how much the device holds. Stored
719
+ content may wait 30 days, counted from its first commit on this
720
+ device. The age is fixed. `protocol.receiveQueue` has no age field, and
721
+ a client created with `protocol.receiveQueue.maxAgeMs` is refused with
722
+ an error that names 12.0.0 and the fixed 30 days. Content expires when
723
+ its age is equal to or more than
724
+ 30 days. The earlier prune deleted content only at an age of more
725
+ than 30 days, so the expiry now comes 1 ms sooner. `maxItems` is 3000 and `maxBytes` is 750 MiB by default. They are
726
+ provisional until a measurement sets them. `blockedGroupShare`, 0.25 by
727
+ default, is the part of each bound that the waiting records of one group
728
+ can fill. At a bound the client decrypts nothing more and does not
729
+ acknowledge the envelope, so the Relay keeps it. A refused envelope
730
+ expires at the Relay at the TTL of the Relay project, and no local hook
731
+ reports that expiry. While the mailbox of the device is full, the Relay
732
+ refuses a new message to it with `MAILBOX_FULL` to its sender. The new
733
+ `onReceiveExpired` hook gets a `ReceiveExpiredEvent` for content that
734
+ waited 30 days, before the client drops it. Before the hook, the
735
+ client reads the record again, so content that the client completed
736
+ before that read, such as at the redelivery of its envelope, gets no
737
+ report. Before, the client deleted stored content after 30 days with no
738
+ report.
739
+ - **Added: `decryptEnvelope` decrypts one envelope with no receive
740
+ record.** It installs a sender key distribution that the content
741
+ carries and checks the group context against the transport. It stores
742
+ no content, decides no group state, and sends no receipt. The decrypt
743
+ spends the ratchet step, so a plaintext that the application loses is
744
+ gone. Use `processIncomingEnvelope` to keep the content until the
745
+ application completes the receive.
746
+ - **Changed: `decryptGroupMessage` is deprecated.** Use
747
+ `processIncomingEnvelope`, which returns a receive outcome and keeps the
748
+ content until the application completes the receive.
749
+ `decryptGroupMessage` completes the receive before it returns, so a
750
+ plaintext that the application loses is gone. It throws
751
+ `EncryptionError` with `STORAGE_QUOTA_EXCEEDED` when the receive queue
752
+ has no room, and with `MESSAGE_DUPLICATE` for a message that this client
753
+ processed or that gives no content.
754
+ - **Fixed: a retry deadline no longer resets a session whose resend
755
+ arrived.** The commit of a resend now records its failed envelope as
756
+ fulfilled before the client acknowledges the resend. At start, the
757
+ client records it again for each stored resend before the retry request
758
+ lifecycle starts. Before, a resend that waited for its group could reach
759
+ the retry deadline, and the deadline reset the session.
760
+ - **Changed: metadata values rest encrypted on the IndexedDB and key-value
761
+ stores.** Each value that `setMetadata` and `compareAndSetMetadata` write
762
+ now goes through the store's record cipher, AES-256-GCM. These values
763
+ include group master keys, the hosted device authentication key, and
764
+ outbox intents. The first open after the upgrade encrypts each clear value
765
+ that the store holds. A stop during that step is safe, and the next open
766
+ continues it. A store that is full keeps its clear values and still opens.
767
+ Metadata key names stay in clear, and some of them hold identifiers. The
768
+ SQLite stores need no change, because the file cipher covers them. An
769
+ earlier SDK version cannot read the encrypted values, so do not open the
770
+ store with one after the upgrade.
771
+ - **Fixed: a membership change no longer makes the next distribution
772
+ identified.** A member removal clears the group's endorsements. Before,
773
+ the next send resolved the sealed sender of each distribution pre-message
774
+ from the cache with no refresh. A pre-message to a member with no access
775
+ key then went identified in `preferred` mode, or failed the send in
776
+ `required` mode. A group send now refreshes the endorsements for all
777
+ recipients before it seals the pre-messages, at preparation and again at
778
+ dispatch. A pre-message goes identified only to a member that the refresh
779
+ does not endorse.
780
+ - **Fixed: an expired sender key no longer blocks group sends.** When the
781
+ own sender key of a group is older than `maxSenderKeyAge`, a group send
782
+ rotates the key before it prepares the distribution pre-messages. The
783
+ rotation deletes the handoff rows of the group. The send then gives the
784
+ new key to each device that needs it, and encrypts with the new key. A
785
+ distribution that fails, for example after a Relay refusal or an offline
786
+ send, does not make a later send to the group fail with
787
+ `SENDER_KEY_EXPIRED`.
788
+ - **Fixed: a retryable Relay refusal no longer ends a retry request.**
789
+ The retry request scheduler now reads the Relay's `retryable` flag before
790
+ the code and the HTTP status. A refusal with `retryable` true, for example
791
+ `AUTHORITY_DENIED` with HTTP 401 while a Relay binding is missing, is a
792
+ transport outage, or a rate refusal for `QUOTA_EXCEEDED`, `MAILBOX_FULL`,
793
+ and HTTP 429. The request waits and is posted again with the same bytes
794
+ and ID. Before, the request ended with `revoked-authority`. A refusal with
795
+ `retryable` false keeps its terminal class. A `TOKEN_INVALID` after the
796
+ one token refresh is `revoked-authority`.
797
+ - **Fixed: a failed `onDelivered` hook no longer loses the delivery.** The
798
+ client now marks a delivery source announced only after the hook returns.
799
+ Before, the client stored the mark first, so a hook that threw, a
800
+ `stop()` during the hook, or a crash lost the event. The hook now runs at
801
+ least once for each source. An error from the hook fails the Relay
802
+ receipt or the encrypted delivery receipt, so the relay delivers it again
803
+ and the hook runs again. Make the hook idempotent for one
804
+ `clientMessageId`, `recipientDeviceId`, and `source`.
805
+ - **Fixed: a failed `onRetryTerminal` hook no longer marks the end
806
+ emitted.** The SDK marks a retry end emitted only after the hook returns.
807
+ A hook that throws keeps the scheduler running. The next scheduler pass,
808
+ the next start, or the redelivery of the request runs the hook again.
809
+ The hook now runs at least once for each request.
810
+ - **Added: a session reset when a retry request ends as
811
+ `expired-content`.** Before the SDK calls `onRetryTerminal`, the
812
+ requester waits for each decrypt from the device that sent the failed
813
+ envelope that is in progress. It then archives its session with that
814
+ device, and its next send to the user reads the device list again. The
815
+ archive deletes the sender-key handoff rows of that device in every group.
816
+ The requester then deletes the rows of each device of that account in
817
+ every group, for a group message and for a pairwise message, as one
818
+ Signal client does at an automatic session reset. The reset does not
819
+ rotate a sender key. The next send to each group gives the current key to
820
+ each device of the account. The requester then sends one
821
+ null message to the device, at most one in an hour for each device. The
822
+ next ordinary message starts the new session when no null message goes.
823
+ The retry request record stores each step, so a replay after a restart
824
+ or a stop does not archive a newer session. The other terminal classes,
825
+ and a post that fails and is posted again, reset nothing.
826
+ `onSessionArchived` runs for the archive. The event gets the optional
827
+ field `recovery` of the new type `RetryTerminalRecoveryEvent`, which is
828
+ exported from the main entry and from `/client`. It has the device, the
829
+ sender key outcome, and the null message outcome `sent`, `limited`, or
830
+ `failed`. The sender key outcome is `applied` when the failed envelope is
831
+ a group message and the requester has a sender key for that group.
832
+ Otherwise it is `skipped`. The rows of the account are deleted with each
833
+ outcome.
834
+ - **Changed: a retry request is sealed when the client can seal it.** The
835
+ client seals a retry request when it holds the access key of the target,
836
+ and the Relay does not see the requester. The seal holds the payload of
837
+ the identified request as `PLAINTEXT_CONTENT` (8), and the sealed post
838
+ keeps the retry ID, the client message ID and the timestamp, so the Relay
839
+ deduplicates it as before. A group send endorsement never seals a retry
840
+ request. A retry request follows the `deliveryMode` of `sealedSender`, as
841
+ a delivery receipt does. In `'preferred'` mode the request goes identified
842
+ when the client has no access key or the Relay refuses it. In
843
+ `'required'` mode the request never goes identified: it stays pending, and
844
+ the scheduler posts it again until its deadline. In `'disabled'` mode it
845
+ is always identified. Before, each retry request was identified in every
846
+ mode, and an identified retry request does not have the privacy of a
847
+ sealed one. The `sendRetryRequest` callback of `processIncomingEnvelope`
848
+ gets an identified request, so `'required'` mode never calls it.
849
+ - **Changed: the client accepts a sealed retry request.** A sealed envelope
850
+ with the content type `PLAINTEXT_CONTENT` goes to the retry request
851
+ handler, never to a ratchet decrypt. `processIncomingEnvelope` rejects a
852
+ sealed retry request with `INVALID_CIPHERTEXT`, as it rejects an
853
+ identified one. A `11.0.x` client rejects this content type, so it drops
854
+ a sealed retry request from a newer client, and that request ends as
855
+ `expired-content` for the requester. A sealed retry request gets a
856
+ resend only from a sender device that runs this release or a later one.
857
+ - **Changed: the `deliveryMode` documentation names what each mode
858
+ covers.** The mode covers each message, resend, delivery receipt and
859
+ retry request to a device of another account. A typing indicator, and a
860
+ sync message to another device of the same account, are always
861
+ identified. `onIdentifiedFallback` reports only a message or a resend.
862
+ - **Changed: a group send seals its sender-key distributions.** In
863
+ `required` and `preferred` sealed-sender mode, each distribution
864
+ pre-message goes through the sealed route to its one recipient. The
865
+ recipient's access key comes first, and the group endorsement serves a
866
+ member without one. When the relay rejects the access key, the SDK
867
+ restricts the cached access mode of the recipient and posts the
868
+ distribution again with the group endorsement. A `required` send checks
869
+ this authorization before it encrypts a distribution and before any
870
+ post. When it cannot seal a distribution, it throws
871
+ `SEALED_SENDER_REQUIRED` and posts nothing. A `preferred` send posts a
872
+ distribution identified only after the relay rejects each sealed
873
+ authorization, and then calls `onIdentifiedFallback`.
874
+ A saved send whose distributions have no sealed transport seals them
875
+ from the stored ciphertext at replay, with no new ratchet effect.
876
+ - **Fixed: a refused distribution is repaired once.** When a device refuses
877
+ a distribution conclusively, for example after a reinstall with the same
878
+ device ID, the SDK refreshes the session of that device once and encrypts
879
+ the distribution again. It replaces the stored pre-message before the
880
+ post, so a replay never posts the refused ciphertext again. The repair
881
+ post has a new transport ID, `<id>:repair:<n>`. A replay after a restart
882
+ rebuilds a refused distribution from the current sender key with the same
883
+ `senderKeyId`. The repaired device then decrypts the later group messages
884
+ of the sender, but not the message of that send. When the sender key of
885
+ the send is no longer current, the replay refreshes the session, drops
886
+ the distribution, and continues. The next send gives the device the
887
+ current key.
888
+ - **Fixed: a group send drops the distribution of a removed device.** When
889
+ the relay refuses a distribution with `NOT_FOUND`, the SDK reads the
890
+ recipient's device list. If the list no longer shows the device, the
891
+ send drops that distribution and continues, as a direct send drops a
892
+ removed device. The send then makes no device post to that device. This
893
+ applies to the repair of a refused device message and to a device that the
894
+ re-read of a skipped account adds. A refused device that the list still
895
+ shows fails the send.
896
+ - **Fixed: all six post kinds name the registration of their device.** A
897
+ direct message, a sync copy, a sender-key distribution, a group device
898
+ message, a receipt, and a retry request send the registration ID of the
899
+ recipient session. This applies on the identified route, on the
900
+ access-key route, and on the group-token route. A post to a device with
901
+ no session names none. A sealed post names the registration of each device in its body,
902
+ and each hosted destination names the registration that the body gives
903
+ its device. A device with registration 0 names none. The Relay refuses a
904
+ device that was reinstalled with the same device ID. The refused post
905
+ then gets the one session repair, and the reinstalled device decrypts
906
+ the later messages. A group device post that the Relay refuses as a stale
907
+ device gets the same repair. The send gives the device the key of the
908
+ send and posts the device message again with the new registration. When
909
+ the repair of a refused distribution refreshes the session of a device,
910
+ that device leaves the shared group message of the send. The send posts
911
+ the device message to it on its own with the new registration, so the
912
+ device decrypts the message of that send. A device whose session changed
913
+ for another reason, such as a receipt that refreshed it, also leaves the
914
+ shared group message. When that device has no handoff row, it gets the key
915
+ of the send before its device post. On the attempt that prepared the send,
916
+ the device decrypts the message. On a replay, it gets the current key. It
917
+ recovers the message through its retry request only when the send was
918
+ Resendable and the send log kept it. For another send, the retry request
919
+ gets the current distribution alone, and the device does not get that
920
+ message. The group-token receipt names
921
+ each refused destination with its code. A destination that the Relay
922
+ refused as `STALE_DEVICE` leaves the shared group message. The send
923
+ repairs that device and posts the device message to it on its own. When the Relay refuses a receipt or a retry
924
+ request as a stale device, the SDK fetches a fresh bundle, starts a new
925
+ session once, and posts the receipt or the request again under the new
926
+ session. The session start archives the stale session in the same record
927
+ write, and the `onSessionArchived` hook runs after the start succeeds.
928
+ So a reinstalled device gets the retry request and resends the message.
929
+ A retry request ends with the terminal class `missing-sender` only when
930
+ the Relay has no bundle of the device or refuses the request again. When
931
+ the refresh fails for another reason, the receipt or the request is
932
+ posted again later. A failure before the session record write, such as a
933
+ failed bundle fetch, keeps the stale session, and the next stale refusal
934
+ refreshes again. A failure after that write, such as a failed SESAME
935
+ registration, leaves the new session, and the next post uses it. The sealed post sends
936
+ no sender identity. `sendMultiRecipientUnidentified` takes nine arguments.
937
+ - **Changed: a one-device sealed post can use the group endorsement on the
938
+ direct route.** A sender-key distribution, a resend, or a group message
939
+ to one device whose only sealed authorization is the group endorsement
940
+ now posts to `/anonymous/delivery/send`. The Relay accepts the
941
+ endorsement there only when it is for the destination account alone.
942
+ The shared group message stays on `/anonymous/groups/send`, also for one
943
+ device. When the direct route answers the endorsement with 401
944
+ `ANONYMOUS_AUTH_REJECTED`, the SDK posts the same message once on the
945
+ group route for that device and writes one `info` log line with the
946
+ behavior `GROUP_ROUTE_FALLBACK`. A 401 `GROUP_CREDENTIAL_REJECTED` gets no
947
+ route fallback. A `required` send never falls back to identified
948
+ delivery.
949
+ - **Fixed: a resend of a group send is sealed with the group endorsement.**
950
+ A resend to a member with no access key could not be sealed, because the
951
+ resend did not look up the group of the original send. It now uses the
952
+ group endorsement of that group for the one device. A `required`
953
+ resend with no sealed authorization fails with `SEALED_SENDER_REQUIRED`
954
+ and makes no identified post.
955
+ - **Fixed: a resend with only the sender key keeps the failed group message
956
+ open.** When the sender logged no content for the device, it answers a
957
+ group retry request with the current sender-key distribution alone. That
958
+ resend gives the key but no content, so it no longer marks the failed
959
+ group message processed. A redelivery of that message now decrypts with
960
+ the key and gives its text. This applies, for example, when
961
+ `receiveIncomingEnvelopes` reports the message in `failedMessageIds` and
962
+ the application does not acknowledge it. A resend that carries content
963
+ still marks the failed envelope processed. The client writes a `debug`
964
+ log line with the behavior `RETRY_SENDER_KEY_RESEND`.
965
+ - **Added: `SendResult.refusedDestinationCount`.** A group send through
966
+ the hosted group-token route reports the number of destinations that the
967
+ Relay refused when it accepted the shared post. A later fan-out refusal
968
+ is not counted. Other sends do not set the field.
969
+ - **Added: send log and storage protection types.** `SendLogStore`
970
+ describes the storage of resendable group content: a payload for each
971
+ group send and a row for each recipient device, kept until that device
972
+ confirms the message or the entry expires. `LocalStoreProtection` names
973
+ how a local store encrypts its data and where its key is kept. A
974
+ `SignalProtocolLocalSecretVault` can declare `custody`. A vault that does
975
+ not declare it counts as `same-origin`.
976
+ - **Added: recovery constants.** `RESENDABLE_CONTENT_RETENTION_MS` is 14
977
+ days, `RETRY_PLACEHOLDER_DEADLINE_MS` is one hour, and
978
+ `SEND_LOG_RESEND_JOB_TTL_MS` is one day. `MESSAGE_RECORD_TTL_MS` is now
979
+ deprecated. It keeps the same 14-day value as
980
+ `RESENDABLE_CONTENT_RETENTION_MS`.
981
+ - **Breaking: every local store must declare its protection.**
982
+ `SignalProtocolLocalStore` now requires a `protection` member, so a store
983
+ that the application writes must add it. The SQLite stores report
984
+ `file-cipher` with the custody of their vault. They read the cipher from
985
+ the setting that the database records, so a store with
986
+ `encryptionAtRest: false` reports `none` and no key.
987
+ `KeyValueSignalProtocolStore` reports `record-cipher` with the custody of
988
+ its vault. `IndexedDbSignalProtocolStore` reports `record-cipher` with
989
+ `same-origin` custody. `InMemorySignalProtocolStore` reports `none`. The
990
+ Expo SecureStore, react-native-keychain, and Electron safeStorage vaults
991
+ declare `os-keychain` custody, and the IndexedDB vault declares
992
+ `same-origin`.
993
+ - **Added: the SQLite stores keep a send log.** The Node, Expo, React
994
+ Native, and web SQLite stores implement `SendLogStore`. Schema version 3
995
+ adds three tables for the payloads, the recipient rows, and the resend
996
+ jobs. The store opens a version 2 file and adds the tables with no change
997
+ to the existing data. The store clock sets `createdAt`, so retention does
998
+ not read the client timestamp. `clearAllKeys` also clears the send log.
999
+ - **Breaking: every local store keeps a send log.**
1000
+ `SignalProtocolLocalStore` now extends `SendLogStore`, so a store that
1001
+ the application writes must add the send log methods.
1002
+ `KeyValueSignalProtocolStore`, `IndexedDbSignalProtocolStore`, and
1003
+ `InMemorySignalProtocolStore` now implement them with the same behavior
1004
+ as the SQLite stores. The key-value and IndexedDB stores encrypt the
1005
+ group, the content hint, and the content of each payload. The recipient
1006
+ rows and the resend jobs hold no content and stay in the clear. The
1007
+ IndexedDB schema version 8 adds three object stores and keeps the data of
1008
+ a version 7 database. `clearAllKeys` and the key-value reset
1009
+ also clear the send log.
1010
+ - **Breaking: resendable content needs a protected store.** A sender
1011
+ keeps the plaintext of a resendable message to answer a retry request.
1012
+ `protocol.contentRecovery` now decides whether the local store may hold
1013
+ it. The default mode, `require-protected`, keeps it only when the store
1014
+ is encrypted and its key is in an operating system keychain or a
1015
+ declared application vault. The mode `allow-co-located-key` also keeps
1016
+ it when the key shares the storage of the data, as with
1017
+ `IndexedDbSignalProtocolStore` and the IndexedDB vault. Those stores
1018
+ encrypt each record, but a reader of the origin storage can also read
1019
+ the key. The mode `off` keeps no content. A store with no encryption
1020
+ never keeps it. When the policy refuses the store, the client keeps no
1021
+ pairwise message record, and a retry request for a direct message resets
1022
+ the session with no content. The client also deletes the message records
1023
+ and the send log entries that the store already holds.
1024
+ `contentRecoveryStatus` shows the decision and its reason, and the client
1025
+ logs it once at creation. To keep content recovery on a web store, use a
1026
+ keychain or application vault, or set `allow-co-located-key` after a
1027
+ product review. `retentionMs` sets the retention, at most 30 days.
1028
+ - **Breaking: the client validates the store protection.** Creation fails
1029
+ when the local store declares no `protection`, an unknown value, or a
1030
+ cipher without a key. A declaration adds no encryption. It must state
1031
+ what the store does.
1032
+ - **Corrected: storage protection and content hint documentation.** The
1033
+ security model lists the protection that each built-in store declares,
1034
+ and says that a deletion does not erase content. Received content is
1035
+ outside `protocol.contentRecovery`: every store keeps it until the
1036
+ application handles the envelope, and a later Relay receive deletes what
1037
+ is older than 30 days. `MessageRecord` holds no retry count. The `contentHint` docs give the retry request and
1038
+ `onDeliveryError` behavior of each hint.
1039
+ - **Added: `contentRecoveryStatus.groupMembershipSource`.** The sender
1040
+ asks a group membership source before it gives group content to a device
1041
+ again. A managed group is checked against its verified group state, from
1042
+ `groups` with `resolveAciBytesByUserIds`. The hook
1043
+ `protocol.contentRecovery.isCurrentMember` answers for an ad hoc group
1044
+ and gets the prefixed group ID. The status field is `managed`, `hook`, or
1045
+ `none`, with the type `GroupMembershipSource`. A client with no source
1046
+ is still created and keeps content. It logs one warning at creation, a
1047
+ direct message resend works, and the client refuses each group resend.
1048
+ - **Changed: a group message is resendable by default.** When
1049
+ `protocol.contentRecovery` keeps content, a group send of a `DataMessage`
1050
+ has the content hint `Resendable` unless the application sets another
1051
+ hint. The client writes the content and the recipient devices to the
1052
+ send log before it stores the outgoing intent, so a failed write stops
1053
+ the send before any post. The client writes the entry once. A replay of
1054
+ an unfinished send writes no row again, so a row that an E2EE delivery
1055
+ receipt deleted stays deleted. Each recipient gets the hint in the identified
1056
+ envelope, the sealed message for one device, and the shared sealed
1057
+ message for the group. When the policy keeps no content, or the send is
1058
+ a string or bytes with a `Resendable` hint, the send goes out as
1059
+ `Default` and the client logs this once.
1060
+ - **Changed: an E2EE delivery receipt ends the content of its device.**
1061
+ When a device confirms a message with an E2EE delivery receipt, the
1062
+ client deletes the send log row of that device. The last row takes the
1063
+ content with it. A Relay delivery receipt, a read receipt, and a viewed
1064
+ receipt delete no row, because a device also acknowledges a copy that it
1065
+ could not decrypt.
1066
+ - **Added: `forgetSentContent` and `getPendingRecipients`.**
1067
+ `client.getPendingRecipients(clientMessageId)` lists the devices that
1068
+ have not confirmed a group send with an E2EE delivery receipt.
1069
+ `client.forgetSentContent(clientMessageId)` deletes the logged content of
1070
+ one group send at once. It does not delete the pairwise message records.
1071
+ - **Changed: content retention follows `retentionMs`.** The client deletes
1072
+ send log entries and pairwise message records past
1073
+ `protocol.contentRecovery.retentionMs` at creation, at `stop()`, and
1074
+ before the first resendable group send of each day. It also deletes
1075
+ expired send log entries before each lookup. A retry request for a
1076
+ pairwise message older than the retention gets no content. Before, the
1077
+ client used the fixed 14-day value for the message records.
1078
+ - **Changed: the store clock sets the age of a pairwise message record.**
1079
+ Each local store sets `createdAt` of a `MessageRecord` from its clock at
1080
+ the first write, and keeps that value when a resend replaces the record.
1081
+ It does not store the `createdAt` that the caller gives. Retention, the
1082
+ sweep, and the sender refusal of an old retry request measure from this
1083
+ value, so the message timestamp does not change retention. A retry
1084
+ request for a message with no stored content takes its age from the
1085
+ failed timestamp. Records written before this change keep their stored
1086
+ `createdAt`. A custom `MessageRecordStore` must set `createdAt` the same
1087
+ way.
1088
+ - **Breaking: `KeyStorageOps` needs `clearSendLog`.** A device lifecycle
1089
+ reset now clears the send log with the other local crypto state. A
1090
+ custom `KeyStorageOps` must add `clearSendLog(): Promise<number>`. The
1091
+ built-in stores already implement it.
1092
+ - **Added: a retry request names the failed client message ID.**
1093
+ `RetryRequest` has an optional `failedClientMessageId`. When the relay of
1094
+ the requester delivers the client message ID of the failed envelope, the
1095
+ retry request carries it, so a sender can find the message when the
1096
+ relay assigns its own envelope ID. The payload stays at version 1, and a
1097
+ decoder that does not know the key ignores it. Each later attempt of the
1098
+ request carries the ID of the failed envelope, not the ID of a failed
1099
+ resend.
1100
+ - **Changed: a retry request for a sender-key message has no ratchet key.**
1101
+ The SDK no longer reads a ratchet key from the ciphertext of a failed
1102
+ sender-key message. A retry request without `ratchetKey` names a
1103
+ sender-key failure.
1104
+ - **Fixed: a pairwise retry request carries the ratchet key of the
1105
+ sender.** The SDK reads the ratchet key from the stored wire form of the
1106
+ failed message. A stale-session request now resets the session, and a
1107
+ request for a current session resends only. Before, the SDK read the
1108
+ wire form as a framed message, so no request carried a key. A sealed or
1109
+ malformed message still gives no key.
1110
+ - **Fixed: a session reset for a retry request sends its null message.**
1111
+ When the content of a failed pairwise message is gone, and the request
1112
+ names the ratchet key of the current session, the sender archives that
1113
+ session. The sender then starts a new session from a fresh prekey bundle
1114
+ of the requesting device and sends the null message on it. Before, the
1115
+ null message found no session, so the sender did not acknowledge the
1116
+ request. A request with another ratchet key, for another device, or from
1117
+ another sender does not change the session.
1118
+ - **Fixed: a new session from a prekey bundle keeps the earlier sessions.**
1119
+ A session that the client starts from a prekey bundle archives the
1120
+ current session and keeps the archived sessions. Before, it replaced the
1121
+ session record, so a message that the peer encrypted on an earlier
1122
+ session did not decrypt. After a session reset for a retry request, a
1123
+ message that the requester sent on the archived session now decrypts.
1124
+ - **Changed: a sender answers a group retry request from the send log.**
1125
+ The sender looks up the send log rows of the device that asked: by the
1126
+ failed client message ID, then by the failed envelope ID, then by the
1127
+ failed timestamp. Each logged entry that it finds goes again to that
1128
+ device only, with its timestamp and content hint, and only when the
1129
+ current membership source admits the requester to the group of the
1130
+ entry. A row counts its resends, and the count survives a restart. A row
1131
+ with 5 resends gets no more. A requester that is not a current member,
1132
+ and a group with no membership source, get no content and no
1133
+ distribution. The answer to the failed envelope then ends with the new
1134
+ `RetryTerminalClass` value `membership-refused`. The sender stores the
1135
+ end, calls `onRetryTerminal` once, and answers no later request for that
1136
+ envelope from that device. The refusal is not a delivery error, and the
1137
+ sender acknowledges the request envelope. A group with no membership
1138
+ source also writes one `warn` log line for the group with the behavior
1139
+ `RETRY_GROUP_RESEND_REFUSED`. This deviates from the recovery design,
1140
+ which logged the refusal only. When no row names the
1141
+ message, a sender-key failure gets the current sender-key distribution
1142
+ of the group alone, so the device decrypts the later group messages of
1143
+ the sender. A retry request without a ratchet key never resets the
1144
+ pairwise session. A retry request that names another device of the
1145
+ sender gets no answer, and the client writes a `warn` log line with the
1146
+ behavior `RETRY_REQUEST_OTHER_DEVICE`.
1147
+ - **Changed: a resend of logged group content carries the current sender
1148
+ key.** Each logged entry goes again with the current sender-key
1149
+ distribution of its group beside the content, in one pairwise envelope.
1150
+ The sender reads the distribution when it makes the resend, so the
1151
+ device also decrypts the later group messages of the sender. With no
1152
+ sender key for the group, the content goes alone. The `info` log line of
1153
+ the resend says whether it carried a distribution.
1154
+ - **Breaking: a content adapter must put content beside a distribution.**
1155
+ `SignalProtocolContentAdapter.serializeContentBesideSenderKeyDistribution(content, groupId, distribution)`
1156
+ is a new required method. It returns one content with the logged content
1157
+ and the distribution. The default adapter adds the distribution to the
1158
+ JSON object of the content, in the form of
1159
+ `serializeSenderKeyDistributionText`. It throws when the content is not
1160
+ a JSON object.
1161
+ - **Added: a resend of logged content survives a restart.** Before the
1162
+ membership check, the sender writes a pending resend job for each logged
1163
+ entry that a retry request attempt names. The job of the entry that
1164
+ answers the attempt names the failed envelope in the new field
1165
+ `SendLogResendJob.failedEnvelopeId`. The SQLite send log keeps it in the
1166
+ new column `failed_envelope_id` of `send_log_resend_job`. A job counts
1167
+ each post attempt before the post and ends as `posted` after it. The job
1168
+ of an entry that the membership or the resend limit refuses ends as
1169
+ `abandoned`. The client runs the pending jobs at `create()`, at each
1170
+ relay transition to connected, and after a failed job. The wait after a
1171
+ failure is a full-jitter wait from 1 s that doubles up to 30 s, and a
1172
+ failed job writes a `warn` log line with the behavior
1173
+ `RESEND_JOB_RETRY`. A job checks the membership again when it runs, and
1174
+ never resets a session: it makes one only when there is none. A job
1175
+ ends as `abandoned`, with one `info` log line, when it is older than
1176
+ `SEND_LOG_RESEND_JOB_TTL_MS`, when its logged entry is gone, when the
1177
+ answer to its failed envelope ended, when the membership refuses the
1178
+ requester, at the resend limit, or when no session can be made. A
1179
+ request without a request attempt writes no job. This deviates from the
1180
+ recovery design, which named a `send-log:resend-job` reliability record.
1181
+ The job lives in the send log store, with its entry.
1182
+ - **Changed: a message record keeps no sender-key distribution.** The
1183
+ message records of the pairwise sends keep no chain key. A send of a
1184
+ distribution alone keeps no record. A record of a distribution beside
1185
+ other content keeps only that content, so it stays resendable. A
1186
+ sent-sync transcript to an own device follows the same rule. At
1187
+ `create()`, the client removes each distribution from the records that
1188
+ an earlier version wrote, once, and then writes the marker
1189
+ `migration:skdm-records-removed`. It keeps the content and the
1190
+ `createdAt` of a mixed record and deletes a record of a distribution
1191
+ alone. When this sweep fails, `create()` fails, and the next start
1192
+ sweeps again. The retry handler applies the same rule to each record
1193
+ that it reads. A group timestamp whose record it deletes gets the
1194
+ current sender-key distribution of the group, as a missing record does.
1195
+ - **Changed: a start with content recovery off clears content once.** When
1196
+ content recovery is off, `create()` clears the message records and the
1197
+ send log once, and then writes the marker `resendable-content:cleared`.
1198
+ A later start with content recovery off clears nothing, until a start
1199
+ with content recovery on keeps content again. The clear deletes no
1200
+ sender-key state, so the next group send needs no new distribution.
1201
+ When the clear fails, `create()` fails, and the next start clears again.
1202
+ - **Breaking: a content adapter must remove a distribution from a
1203
+ record.** `SignalProtocolContentAdapter.withoutSenderKeyDistribution(plaintext)`
1204
+ is a new required method. It returns the plaintext unchanged when it
1205
+ carries no distribution, the other content when a distribution travels
1206
+ beside it, and `null` for a distribution alone. It applies the same
1207
+ rule to the content inside a sent-sync transcript of the adapter's
1208
+ format. The default adapter implements it.
1209
+ - **Breaking: a custom message record store must rewrite its records.**
1210
+ `MessageRecordStore.rewriteMessageRecords(rewrite)` is a new required
1211
+ method. It calls `rewrite` for each record, replaces the plaintext of a
1212
+ record when the result differs and keeps its `createdAt`, deletes the
1213
+ record when the result is `null`, and returns the number of changed
1214
+ records. The memory, key-value, web, and SQLite stores implement it.
1215
+ - **Fixed: content beside a sender-key distribution reaches the
1216
+ application.** Before, the client installed a distribution and then
1217
+ dropped the rest of its content. A data message in the same envelope
1218
+ never reached `onMessageDecrypted`, and no delivery receipt went out for
1219
+ it. Now the client installs the distribution, then routes the other
1220
+ content as a receipt, a typing indicator, or a data message. This
1221
+ applies on the relay subscription and on `receiveIncomingEnvelopes()`.
1222
+ A distribution that comes alone still gives nothing to the application.
1223
+ - **Breaking: a content adapter must decide a distribution-only content.**
1224
+ `InspectedSignalProtocolContent.senderKeyDistributionOnly` is a new
1225
+ required `boolean`. A custom content adapter must set it on every
1226
+ inspect result. It is `true` when the content carries a sender-key
1227
+ distribution and nothing else. The default adapter sets it.
1228
+ - **Changed: content beside a sender-key distribution is group content.**
1229
+ Before the client installs such a distribution, it checks that the
1230
+ sender may send messages to the group of the distribution. When the
1231
+ group refuses the sender, the client installs no key and gives no
1232
+ content. `onMessageDecrypted` gets the content with `isGroup` set to
1233
+ `true` and the group ID as `conversationId`. A retry resend can carry
1234
+ the content of a failed group message beside the current sender key.
1235
+ The application then gets that content under the `messageId` of the
1236
+ failed message, on the relay subscription and on
1237
+ `receiveIncomingEnvelopes()`. The resend marks the failed message
1238
+ processed, so a later redelivery of that message is dropped. When the
1239
+ failed message decrypts first, the later resend is dropped.
1240
+ - **Fixed: `processIncomingEnvelope()` asks for a failed group message
1241
+ again.** A group message that fails with a retryable error, for example
1242
+ after a lost sender-key distribution, now gets a retry request to its
1243
+ sender, and the client acknowledges it, as on the relay subscription.
1244
+ Before, the method threw with no request, so the message was lost. A
1245
+ group message with the Implicit content hint gets no request and is
1246
+ acknowledged. On every receive path, the stored request names the
1247
+ message as a group message, so a resend that brings only the sender key
1248
+ does not mark the message processed.
1249
+ - **Added: the `onDeliveryError` and `onDeliveryRecovered` hooks.** When a
1250
+ received message fails to decrypt and the client asks the sender for it
1251
+ again, `onDeliveryError` tells the application that the content did not
1252
+ come. The content hint of the message sets the time. A message with the
1253
+ Default hint, or with no hint, gets the error at once. A Resendable
1254
+ message gets it one hour after the first failure,
1255
+ `RETRY_PLACEHOLDER_DEADLINE_MS`, when its content has not come. An
1256
+ Implicit message never gets it. A request that a rate limit refuses, or
1257
+ a request that ends, gets the error at once. It deletes nothing, and the
1258
+ retry request continues after it. When the content comes after the
1259
+ error, `onDeliveryRecovered` runs with the receive time of the first
1260
+ failure. Each hook runs at least once for each failed message, also
1261
+ across a restart. The client marks the error shown, or the recovery,
1262
+ only after the hook returns. A hook that throws, a client stop, or a
1263
+ crash before that mark runs the hook again at the next retry request
1264
+ pass, start, or redelivery. A hook that throws in a retry request pass
1265
+ does not delay the next attempt or the end of the request. A receive
1266
+ does not acknowledge a failed message whose error or recovery hook threw
1267
+ before the content, but an error from the recovery hook after the
1268
+ content does not fail the receive that gave it. Make each hook
1269
+ idempotent for one `failedEnvelopeId`. The events are
1270
+ `DeliveryErrorEvent` and `DeliveryRecoveredEvent`, with the cause type
1271
+ `DeliveryErrorCause`. They are exported from the main entry and from
1272
+ `/client`. For a failed group message, both events carry `groupId`, in
1273
+ the form of `DecryptedEnvelope.conversationId`, when the client holds
1274
+ the sender key that the message names. The error of a message with a
1275
+ missing sender key has no `groupId`. Its recovery has one when the
1276
+ decrypt that gave
1277
+ the content installed or used the sender key of the group. The client checks the time at each redelivery of the failed message and at each retry
1278
+ request write. With a relay, it also checks at `create()` and, while the
1279
+ client runs, at the time when the error is due. A pairwise message has
1280
+ no content hint by default, so its error comes at once.
1281
+ - **Changed: a receive failure that no resend can repair asks for
1282
+ nothing.** Three failures are in this class: the group state refuses the
1283
+ sender, the identity of the sender is not trusted (`UNTRUSTED_IDENTITY`),
1284
+ and the envelope is malformed (`INVALID_CIPHERTEXT`). On the relay
1285
+ subscription, on `receiveIncomingEnvelopes()`, and on
1286
+ `processIncomingEnvelope()`, the client posts no retry request, stores
1287
+ no request record, and acknowledges the envelope. `onDecryptionError`
1288
+ runs once for the envelope, and a redelivery of it is dropped. The relay
1289
+ subscription writes an `error` log line that names the refusal. A
1290
+ ciphertext that does not decode or parse now fails with
1291
+ `INVALID_CIPHERTEXT`. Before, it got a retry request. Before, the relay subscription also asked again for a
1292
+ refused or untrusted envelope, and `processIncomingEnvelope()` did not
1293
+ acknowledge it.
1294
+ - **Changed: a retry request ends 14 days after the first failure.** The
1295
+ deadline of a request is the time of attempt 1 plus 14 days, the default
1296
+ retention of resendable content, `RESENDABLE_CONTENT_RETENTION_MS`.
1297
+ Each later attempt keeps it, and the timestamp of the
1298
+ failed message does not change it. Before, the deadline was 24 hours
1299
+ after attempt 1 and no later than 30 days after the failed message. A
1300
+ request that a rate limit refuses waits for the end of the rate window
1301
+ and keeps its deadline, also across a restart. At the deadline the
1302
+ request ends as `expired-content`, also when its stored attempt is
1303
+ answered. A request whose content came does not end. A stored request
1304
+ keeps its stored deadline. At the deadline, a sender key that has not
1305
+ rotated since the failure is older than the default `maxSenderKeyAge` of
1306
+ 14 days. After an `expired-content` end of a group message, the next
1307
+ group send then rotates that key, as any send does, and distributes the
1308
+ new key to each member.
1309
+ - **Added: the `attempts-exhausted` retry terminal class.** When the
1310
+ resend that answers the fifth attempt of a request,
1311
+ `MAX_RETRY_RESPONSES_PER_MESSAGE`, also fails, the request ends as
1312
+ `attempts-exhausted` and posts no sixth attempt. `onRetryTerminal` runs
1313
+ with the class, and `onDeliveryError` runs with the cause
1314
+ `request-ended`. Only an `expired-content` end resets the session, so
1315
+ this end resets nothing. A switch over `RetryTerminalClass` must handle
1316
+ the new value.
1317
+
3
1318
  ## 11.0.0
4
1319
 
5
1320
  - **Added: the connection reason `authority-refused`.** The mailbox