@open-e2ee/signal-protocol-sdk 13.2.0 → 13.4.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 (114) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/README.md +1 -1
  3. package/SECURITY.md +2 -2
  4. package/dist/client/client.d.ts +1 -0
  5. package/dist/client/client.d.ts.map +1 -1
  6. package/dist/client/client.js +144 -74
  7. package/dist/client/client.js.map +1 -1
  8. package/dist/client/group-outbox.d.ts +2 -1
  9. package/dist/client/group-outbox.d.ts.map +1 -1
  10. package/dist/client/group-outbox.js +4 -1
  11. package/dist/client/group-outbox.js.map +1 -1
  12. package/dist/client/hosted-mailbox-subscription.d.ts +4 -2
  13. package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
  14. package/dist/client/hosted-mailbox-subscription.js +4 -2
  15. package/dist/client/hosted-mailbox-subscription.js.map +1 -1
  16. package/dist/client/hosted-resume-error.d.ts +19 -0
  17. package/dist/client/hosted-resume-error.d.ts.map +1 -0
  18. package/dist/client/hosted-resume-error.js +44 -0
  19. package/dist/client/hosted-resume-error.js.map +1 -0
  20. package/dist/client/hosted-resume.d.ts +24 -0
  21. package/dist/client/hosted-resume.d.ts.map +1 -0
  22. package/dist/client/hosted-resume.js +82 -0
  23. package/dist/client/hosted-resume.js.map +1 -0
  24. package/dist/client/hosted-transport.d.ts.map +1 -1
  25. package/dist/client/hosted-transport.js +27 -3
  26. package/dist/client/hosted-transport.js.map +1 -1
  27. package/dist/client/hosted.d.ts.map +1 -1
  28. package/dist/client/hosted.js +28 -5
  29. package/dist/client/hosted.js.map +1 -1
  30. package/dist/client/index.d.ts +2 -0
  31. package/dist/client/index.d.ts.map +1 -1
  32. package/dist/client/index.js +2 -0
  33. package/dist/client/index.js.map +1 -1
  34. package/dist/client/receive-work-seed.d.ts +6 -2
  35. package/dist/client/receive-work-seed.d.ts.map +1 -1
  36. package/dist/client/receive-work-seed.js +4 -0
  37. package/dist/client/receive-work-seed.js.map +1 -1
  38. package/dist/client/relay-subscription.js +1 -1
  39. package/dist/client/relay-subscription.js.map +1 -1
  40. package/dist/client/retry-family.d.ts +69 -13
  41. package/dist/client/retry-family.d.ts.map +1 -1
  42. package/dist/client/retry-family.js +104 -11
  43. package/dist/client/retry-family.js.map +1 -1
  44. package/dist/client/send-timestamp.d.ts +67 -0
  45. package/dist/client/send-timestamp.d.ts.map +1 -0
  46. package/dist/client/send-timestamp.js +82 -0
  47. package/dist/client/send-timestamp.js.map +1 -0
  48. package/dist/client/signal-service-cipher.d.ts +5 -0
  49. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  50. package/dist/client/signal-service-cipher.js +31 -5
  51. package/dist/client/signal-service-cipher.js.map +1 -1
  52. package/dist/client/startup-cleanup.d.ts +2 -0
  53. package/dist/client/startup-cleanup.d.ts.map +1 -0
  54. package/dist/client/startup-cleanup.js +14 -0
  55. package/dist/client/startup-cleanup.js.map +1 -0
  56. package/dist/client/types.d.ts +9 -0
  57. package/dist/client/types.d.ts.map +1 -1
  58. package/dist/client/types.js.map +1 -1
  59. package/dist/index.d.ts +2 -0
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +1 -0
  62. package/dist/index.js.map +1 -1
  63. package/dist/internal/manager/manager.d.ts +1 -0
  64. package/dist/internal/manager/manager.d.ts.map +1 -1
  65. package/dist/internal/manager/manager.js +17 -2
  66. package/dist/internal/manager/manager.js.map +1 -1
  67. package/dist/internal/manager/retained-identity.d.ts +2 -0
  68. package/dist/internal/manager/retained-identity.d.ts.map +1 -0
  69. package/dist/internal/manager/retained-identity.js +57 -0
  70. package/dist/internal/manager/retained-identity.js.map +1 -0
  71. package/dist/local/store/reliability.d.ts +6 -3
  72. package/dist/local/store/reliability.d.ts.map +1 -1
  73. package/dist/local/store/reliability.js +6 -3
  74. package/dist/local/store/reliability.js.map +1 -1
  75. package/dist/local/store/sqlite/convert-plaintext.d.ts +1 -7
  76. package/dist/local/store/sqlite/convert-plaintext.d.ts.map +1 -1
  77. package/dist/local/store/sqlite/convert-plaintext.js +1 -9
  78. package/dist/local/store/sqlite/convert-plaintext.js.map +1 -1
  79. package/dist/local/store/sqlite/file-name.d.ts +5 -0
  80. package/dist/local/store/sqlite/file-name.d.ts.map +1 -0
  81. package/dist/local/store/sqlite/file-name.js +7 -0
  82. package/dist/local/store/sqlite/file-name.js.map +1 -0
  83. package/dist/local/store/sqlite/open-store.d.ts.map +1 -1
  84. package/dist/local/store/sqlite/open-store.js +2 -1
  85. package/dist/local/store/sqlite/open-store.js.map +1 -1
  86. package/dist/local/store/sqlite/web/file-name.d.ts +22 -0
  87. package/dist/local/store/sqlite/web/file-name.d.ts.map +1 -0
  88. package/dist/local/store/sqlite/web/file-name.js +72 -0
  89. package/dist/local/store/sqlite/web/file-name.js.map +1 -0
  90. package/dist/local/store/sqlite/web/worker.js +5 -12
  91. package/dist/local/store/sqlite/web/worker.js.map +1 -1
  92. package/dist/local/store/web-sqlite/adapter.d.ts +5 -4
  93. package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -1
  94. package/dist/local/store/web-sqlite/adapter.js +7 -4
  95. package/dist/local/store/web-sqlite/adapter.js.map +1 -1
  96. package/dist/local/vault/indexed-db.d.ts +7 -3
  97. package/dist/local/vault/indexed-db.d.ts.map +1 -1
  98. package/dist/local/vault/indexed-db.js +25 -21
  99. package/dist/local/vault/indexed-db.js.map +1 -1
  100. package/dist/types/api.d.ts +25 -0
  101. package/dist/types/api.d.ts.map +1 -1
  102. package/dist/types/errors.d.ts +69 -1
  103. package/dist/types/errors.d.ts.map +1 -1
  104. package/dist/types/errors.js +77 -1
  105. package/dist/types/errors.js.map +1 -1
  106. package/docs/ASSURANCE.md +6 -6
  107. package/docs/DEVIATIONS.md +3 -3
  108. package/docs/ERROR_HANDLING.md +1 -0
  109. package/docs/GETTING_STARTED.md +10 -0
  110. package/docs/PACKAGE_SURFACE.md +21 -0
  111. package/docs/RECIPES.md +3 -2
  112. package/local/store/README.md +16 -9
  113. package/local/store/web-sqlite/README.md +22 -6
  114. package/package.json +1 -1
@@ -15,7 +15,8 @@
15
15
  * ├── SealedSenderAuthError the rejected sealed-sender credential
16
16
  * ├── PQXDHRequiredError which post-quantum key the peer is missing
17
17
  * ├── StorageQuotaExceededError the store that ran out of room
18
- * └── SecureRandomUnavailableError the runtime has no secure random source
18
+ * ├── SecureRandomUnavailableError the runtime has no secure random source
19
+ * └── InvalidSendTimestampError the refused send timestamp and the accepted window
19
20
  * ```
20
21
  *
21
22
  * A code or a subclass belongs here only if production code can produce it. An
@@ -106,6 +107,16 @@ export var EncryptionErrorCode;
106
107
  EncryptionErrorCode["DECRYPTION_FAILED"] = "DECRYPTION_FAILED";
107
108
  /** Message encryption failed */
108
109
  EncryptionErrorCode["ENCRYPTION_FAILED"] = "ENCRYPTION_FAILED";
110
+ /**
111
+ * A new send carries an application-supplied `timestamp` that the SDK
112
+ * refuses, or a sync to linked devices carries an application-supplied time
113
+ * that the SDK refuses.
114
+ *
115
+ * The SDK accepts a safe positive integer at most 5 minutes ahead of its
116
+ * clock and at most 24 hours behind it. It throws `InvalidSendTimestampError`
117
+ * before it stores or posts anything for the send.
118
+ */
119
+ EncryptionErrorCode["INVALID_SEND_TIMESTAMP"] = "INVALID_SEND_TIMESTAMP";
109
120
  /**
110
121
  * Duplicate message detected (replay attack).
111
122
  *
@@ -554,6 +565,71 @@ export class SecureRandomUnavailableError extends EncryptionError {
554
565
  });
555
566
  }
556
567
  }
568
+ /**
569
+ * Error thrown when a new send carries an application-supplied `timestamp`
570
+ * that the SDK refuses.
571
+ *
572
+ * The timestamp of a send is its operation epoch, and each retry of the send
573
+ * keeps it. The SDK accepts a safe positive integer at most 5 minutes ahead
574
+ * of its clock and at most 24 hours behind it. From the Relay release that
575
+ * follows v2026.10.25, the Relay admits a mailbox delivery epoch and a new
576
+ * group fan-out operation in the same window. Earlier Relay releases admit a
577
+ * new operation only within 5 minutes of its epoch. On an earlier Relay
578
+ * release, a time 5 minutes to 24 hours old passes the SDK check but gets
579
+ * `OPERATION_EXPIRED`. The SDK check uses the same bounds, so the SDK refuses
580
+ * an application-supplied time before it stores the send or posts anything.
581
+ * A sync to linked devices whose epoch is an application-supplied time, such
582
+ * as `deletedAt`, gets the same check before it posts.
583
+ *
584
+ * The SDK stored nothing for the refused send. The application can send the
585
+ * content again with a timestamp in the window, or with no timestamp, and the
586
+ * SDK then uses its clock. A send that repeats a stored `clientMessageId`
587
+ * with its stored timestamp keeps that timestamp, and the SDK does not check
588
+ * it again. With another timestamp, the check applies.
589
+ *
590
+ * @example
591
+ * ```typescript
592
+ * try {
593
+ * await signal.send(recipientId, { body, timestamp });
594
+ * } catch (error) {
595
+ * if (isInvalidSendTimestampError(error)) {
596
+ * await signal.send(recipientId, { body });
597
+ * }
598
+ * }
599
+ * ```
600
+ */
601
+ export class InvalidSendTimestampError extends EncryptionError {
602
+ name = 'InvalidSendTimestampError';
603
+ /** The refused timestamp. */
604
+ timestamp;
605
+ /** Why the SDK refused the timestamp. */
606
+ reason;
607
+ /** The earliest timestamp that the check accepted, in milliseconds since the epoch. */
608
+ earliest;
609
+ /** The latest timestamp that the check accepted, in milliseconds since the epoch. */
610
+ latest;
611
+ constructor(timestamp, reason, window) {
612
+ const problem = reason === 'not_safe_positive_integer'
613
+ ? 'is not a safe positive integer'
614
+ : reason === 'too_far_ahead'
615
+ ? 'is more than 5 minutes ahead of the SDK clock'
616
+ : 'is more than 24 hours behind the SDK clock';
617
+ super(`The send timestamp ${String(timestamp)} ${problem}. A new send accepts ${window.earliest} through ${window.latest}`, EncryptionErrorCode.INVALID_SEND_TIMESTAMP, { operation: 'send', timestamp, reason, earliest: window.earliest, latest: window.latest });
618
+ this.timestamp = timestamp;
619
+ this.reason = reason;
620
+ this.earliest = window.earliest;
621
+ this.latest = window.latest;
622
+ }
623
+ }
624
+ /**
625
+ * Type guard to check if an error is an InvalidSendTimestampError.
626
+ *
627
+ * @param error - Error to check
628
+ * @returns true if error is InvalidSendTimestampError
629
+ */
630
+ export function isInvalidSendTimestampError(error) {
631
+ return error instanceof InvalidSendTimestampError;
632
+ }
557
633
  /**
558
634
  * Type guard to check if an error is a SecureRandomUnavailableError.
559
635
  *
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../types/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA8BH;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAG/B,IAAI;IACJ,OAAO;IAHhB,YACE,OAAe,EACR,IAAyB,EACzB,OAAgC;QAEvC,KAAK,CAAC,OAAO,CAAC,CAAC;oBAHR,IAAI;uBACJ,OAAO;QAGd,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAE9B,6CAA6C;QAC7C,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED,yDAAyD;IACzD,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;IAC/B,CAAC;IAED,kDAAkD;IAClD,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC;IACjC,CAAC;IAED,yDAAyD;IACzD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC;IACrC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,mBAyTX;AAzTD,WAAY,mBAAmB;IAC7B,6BAA6B;IAE7B,8CAA8C;IAC9C,8DAAuC,CAAA;IAEvC,sCAAsC;IACtC,8DAAuC,CAAA;IAEvC;;;;;OAKG;IACH,4EAAqD,CAAA;IAErD;;;;OAIG;IACH,8EAAuD,CAAA;IAEvD;;;;;OAKG;IACH,oFAA6D,CAAA;IAE7D,6BAA6B;IAE7B,iDAAiD;IACjD,gEA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ACxD,OAAO,KAAK,YAAY,yBAAyB,CAAC;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,KAAc;IAC3D,OAAO,KAAK,YAAY,4BAA4B,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAc;IACxD,OAAO,KAAK,YAAY,yBAAyB,CAAC;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,OAAO,KAAK,YAAY,kBAAkB,CAAC;AAC7C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACrD,OAAO,KAAK,YAAY,sBAAsB,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,KAAK,YAAY,eAAe,CAAC;AAC1C,CAAC"}
package/docs/ASSURANCE.md CHANGED
@@ -16,16 +16,16 @@ Private testing also exists in other open-source projects. [SQLite publishes som
16
16
 
17
17
  Engineering CI runs the default automated checks on pull requests that are ready for review and on changes to the main branch. Release preparation requires a passing run.
18
18
 
19
- Most recent full run on 2026-10-24:
19
+ Most recent full run on 2026-10-28:
20
20
 
21
21
  | | |
22
22
  |---|---|
23
- | Test modules | 579 |
24
- | Test cases | 11,787 |
25
- | Passed | 11,783 |
23
+ | Test modules | 587 |
24
+ | Test cases | 11,932 |
25
+ | Passed | 11,928 |
26
26
  | Skipped | 4 |
27
27
  | Failed | 0 |
28
- | Wall time | 603 s |
28
+ | Wall time | 1074 s |
29
29
 
30
30
  The total counts test cases. One test case can contain several assertions. Separate commands run the longer performance and endurance checks.
31
31
 
@@ -124,7 +124,7 @@ The simulator does not enforce Data Protection. These results do not show the pr
124
124
  | Without `'wasm-unsafe-eval'`, the open fails with `SQLITE_ENGINE_UNAVAILABLE` and writes no key. | Browser storage job: Chromium and Firefox on Linux. WebKit store job: WebKit and Safari on macOS | A page under a policy without `'wasm-unsafe-eval'`. |
125
125
  | When the origin quota is full, a write and an atomic commit reject with `STORAGE_QUOTA_EXCEEDED` and leave no partial state. The store stays open, and after the clamp is removed, the same commit succeeds. A first open under a full quota rejects with `STORAGE_QUOTA_EXCEEDED`, writes no key and no database file, and succeeds after the clamp is removed. A store with two pool files opens, reads, and writes under a quota that has no room for a new pool. | Browser storage job: Chromium on Linux | A DevTools protocol call clamps the origin quota, and the store fills its real file in OPFS. Firefox and WebKit have no such call, so they do not run this check. |
126
126
  | When a write of the engine fails with `QuotaExceededError`, the call fails with the SQLite full-disk error, which the store reports as `STORAGE_QUOTA_EXCEEDED`. The earlier rows stay, and after space frees, the same connection writes again and the file passes an integrity check. | Browser storage job: Chromium and Firefox on Linux. WebKit store job: WebKit and Safari on macOS | A fault in the worker makes each OPFS write that grows a file throw `QuotaExceededError`. It does not fill a real origin quota. |
127
- | Over a long run, the store holds latency, memory, and file size flat. A closed store leaves no worker and no lock of the store. Two tabs that write in turn each read the last write of the other. | Browser storage job: Chromium on Linux | 150 open, write, read, and close cycles, one session of 2,000 churn operations over 250 sessions, and 100 writes that two tabs make in turn. The check compares the medians of the early and late thirds of the run. It reads the page heap, and the heap and Wasm memory of the store's worker, through the DevTools protocol. Firefox and WebKit have no such protocol in the test runner, and no CI job runs this check in them. |
127
+ | Over a long run, the store holds latency, memory, and file size flat. A closed store leaves no worker, no lock of the store, and no IndexedDB connection. Two tabs that write in turn each read the last write of the other. | Browser storage job: Chromium on Linux | 150 open, write, read, and close cycles, one session of 2,000 churn operations over 250 sessions, and 100 writes that two tabs make in turn. The check counts the workers, locks, IndexedDB connections, and OPFS entries that the cycles leave. It times each cycle and each two-tab read next to a control that does the same platform work with no store state, and compares the early and late thirds of that ratio. It compares the medians of the early and late thirds of the churn, and fits a slope to the page heap of the cycles. It reads the page heap, the IndexedDB connections, and the heap and Wasm memory of the store's worker, through the DevTools protocol. Firefox and WebKit have no such protocol in the test runner, and no CI job runs this check in them. |
128
128
  | A worker without OPFS synchronous access handles fails with `OPFS_UNAVAILABLE` before it loads the engine. | Browser storage job: Chromium, Firefox, and WebKit on Linux | WebKit on Linux (WebKitGTK) has no OPFS synchronous access handles, so there WebKit runs only these checks and the checks that need no OPFS. |
129
129
 
130
130
  The WebKit store job runs Playwright's WebKit on macOS, where WebKit has OPFS synchronous access handles. Playwright's WebKit is not Safari, so the same job then runs the same checks in the Safari of the macOS runner through `safaridriver`, and records the Safari version. A WebDriver runner runs the Playwright checks unchanged. It counts the workers of a page from inside the page, and it reports the uncaught errors of a page only after the page loads. Each browser context is a Safari WebDriver session, so the check for an ephemeral context that refuses OPFS access handles skips when that session has them. It runs only on a change to the web SQLite store, the SQLite core, the storage contract, the key vault, the job, or a dependency. On a pull request, it runs only when a maintainer requests it. In the browser storage job for Chromium and Firefox and in the WebKit store job, a check that skips for want of OPFS fails.
@@ -83,7 +83,7 @@ model and what is out of scope.
83
83
  | **SPQR / ML-KEM Braid** | ML-KEM Braid rev. 1 | **Deviation.** Same protocol, same KDF labels, same Reed–Solomon parameters, byte-identical message framing — except `hek = SHA3-256(ek_seed ‖ ek_vector)`, the operand order the specification states, which is the reverse of `libsignal`'s implementation | The normative text was followed over the executable reference | Wire-visible. Headers, ciphertexts, and shared secrets diverge; a braid session cannot complete a single epoch against `libsignal`'s implementation. Also means the KEM is not FIPS 203 in braid mode |
84
84
  | **Triple Ratchet** | `libsignal` `triple_ratchet.rs` | **Faithful.** The PQ secret enters as the HKDF salt at message-key expansion, same label, same order | — | The braiding construction follows the ML-KEM Braid specification |
85
85
  | **Sesame** | Sesame rev. 2 | **Faithful** on deleted devices: a removed device is marked and kept for MAXLATENCY, and its archived sessions still decrypt. **Deviation** on session expiry (§4.2 applies only to unacknowledged sessions) and on device-list currency on the Convex relay only (the sender reads the relay's list at most once per 60 s). The Signal Protocol Relay and the memory relay reject a stale declared device set, as §3.3 requires. **Deviation** on stale-record cleanup timing (§5.1: the cleanup runs after the resume, not after a fetch of the whole mailbox, and the Relay's 30-day TTL cap bounds it). **Extensions:** device transfer, encrypted device names, identity-change gating, a 5-device cap | Product requirements the specification does not address | On the Convex relay, a device linked or removed less than 60 s ago can miss a send or still receive one. A client clock that moves forward against the Relay clock between a removal and the cleanup can lose a message accepted just before the removal. Device transfer copies the identity private key and no ratchet state, so each device starts its own sessions |
86
- | **Device-set reconciliation** | Signal's server `MessageController`; Signal's Desktop client `sendToGroup` | **Deviation** in detail. The answer order, one post for each device of a direct send, a bound on direct sends, no empty sync post, a refusal for each not-found group destination, an acknowledgment marker, and a group body sealed again with the same ciphertext (§5.6) | The Relay takes one destination for each direct body, keeps one record for each account, admits an operation for 5 minutes, and stores each send attempt | A phase that does not match in 10 restarts fails the send with `DeviceSetReconciliationError`. A relay that does not acknowledge the comparison raises `DEVICE_SET_UNCHECKED` |
86
+ | **Device-set reconciliation** | Signal's server `MessageController`; Signal's Desktop client `sendToGroup` | **Deviation** in detail. The answer order, one post for each device of a direct send, a bound on direct sends, no empty sync post, a refusal for each not-found group destination, an acknowledgment marker, and a group body sealed again with the same ciphertext (§5.6) | The Relay takes one destination for each direct body, keeps one record for each account, admits a delivery epoch at most 5 minutes ahead of its clock and at most 24 hours behind it from the release that follows v2026.10.25, and stores each send attempt | A phase that does not match in 10 restarts fails the send with `DeviceSetReconciliationError`. A relay that does not acknowledge the comparison raises `DEVICE_SET_UNCHECKED` |
87
87
  | **Sealed sender** | `libsignal` `sealed_sender.rs` | **Faithful** on the multi-recipient transport labels, KEM, AES-256-GCM-SIV, binary format, and `0x3FFF` registration-ID mask. **Extension:** sender and server certificates require signed Relay scope and issuer validity under operator-owned Ed25519 roots | Binds anonymous delivery to one Relay deployment and supports explicit issuer rotation and revocation | The transport follows `libsignal`; certificates are not interchangeable with Signal Messenger or another deployment |
88
88
  | **Delivery token** | `libsignal` `profile_key.rs` | **Faithful.** `deriveAccessKey` follows `libsignal`'s `ProfileKey::derive_access_key`, and reproduces `libsignal`'s published known-answer values | — | Not an SDK invention, despite what the module name suggests |
89
89
  | **Sender keys** | `libsignal` `sender_keys.rs` | **Deviation.** Protobuf fields, chain seeds, and HKDF-Extract/Expand match. The SDK uses frame version `0x44`, Ed25519 signatures, and UTF-8 distribution identifiers. | The identity profile selects Ed25519. The frame version marks the correction of the former missing Extract. | Message-key derivation matches the reference. Former SDK state and messages require a reset. Frames still differ from Signal Messenger. |
@@ -905,7 +905,7 @@ it never runs.
905
905
 
906
906
  ### 5.6 Device-set reconciliation differs in detail
907
907
 
908
- Reviewed: 2026-10-18.
908
+ Reviewed: 2026-10-25.
909
909
 
910
910
  The reconciliation of §5.5 follows Signal's server and Signal's Desktop
911
911
  client in its rule: the server compares, the client repairs and posts again,
@@ -918,7 +918,7 @@ Signal's Android client. The following details differ.
918
918
  | D1 | A stale registration is reported after missing and extra devices on every route, also for a direct post to one account | One answer order for every route | Signal's server reports stale devices first on its route for one account | Relay tests assert the order on each route |
919
919
  | D2 | A direct send is one post for each device, and each post carries the full declaration of the account | The direct Relay route takes one destination for each body. A replay works for each device | One Signal request carries every device of the account. Here a race can accept some posts and refuse others | A restart posts the stored bytes to each accepted device, and each device gets the message once. A partly accepted pass posts every device again, and an accepted device replays |
920
920
  | D3 | A group comparison reads the record of each account, up to 1,000, when the Relay accepts the post | The Relay keeps one record for each account | Signal's server reads accounts from one store in one process | Relay tests, and a cost measurement |
921
- | D4 | The operation time is fixed. `OPERATION_EXPIRED` ends the reconciliation | The Relay admits an operation for 5 minutes | Signal has no admission window | A restart post that gets `OPERATION_EXPIRED` ends the phase as expired |
921
+ | D4 | The operation time is fixed. `OPERATION_EXPIRED` ends the reconciliation. A new send refuses an application timestamp outside the delivery window with `InvalidSendTimestampError` | From the Relay release that follows v2026.10.25, the Relay admits a mailbox delivery epoch and a new group fan-out operation at most 5 minutes ahead of its clock and at most 24 hours behind it. Earlier Relay releases admit a new operation only within 5 minutes of its epoch. On an earlier Relay release, a time 5 minutes to 24 hours old passes the SDK check but gets `OPERATION_EXPIRED`. The SDK check uses the same bounds, so the SDK refuses an application-supplied time before any post | Signal has no admission window | A restart post that gets `OPERATION_EXPIRED` ends the phase as expired. A new send with a timestamp outside the window throws `InvalidSendTimestampError`, and stores and posts nothing |
922
922
  | D5 | No fallback to one post for each recipient after the bound | The same bound covers every path | Signal's Desktop client falls back because its one-to-one path has no bound. Under the bound, a fallback only moves the churn | The 11th refusal of a phase ends the send with `DeviceSetReconciliationError` |
923
923
  | D6 | A direct send also stops at 10 restarts | One bound for every send | Signal's Desktop client has no bound on missing or extra devices for a one-to-one send | The restart bound test of the direct send |
924
924
  | D7 | No empty sync post. A `needsSync` mark on the recipient receipt and one read of the own list replace it | A Relay post needs at least one destination | Signal's server accepts an empty sync list, and Signal's Android client addresses its own device | A new own device repairs the sync phase and the recipient post is not sent again. The own list is read only on `needsSync` with no own record, and a failed read leaves the sync phase pending |
@@ -83,6 +83,7 @@ holds each member to a production construction site.
83
83
  | `INVALID_CIPHERTEXT` | The ciphertext format is invalid. | Reject the message. |
84
84
  | `DECRYPTION_FAILED` | Available session state could not decrypt the message. | Let the retry flow recover, or inspect the session state. |
85
85
  | `ENCRYPTION_FAILED` | The SDK could not encrypt the message. | Inspect the session state and `originalError`. |
86
+ | `INVALID_SEND_TIMESTAMP` | A new send carries a `timestamp`, or a sync to linked devices carries an application time, that is not a safe positive integer, or that is more than 5 minutes ahead of or more than 24 hours behind the SDK clock. The SDK throws `InvalidSendTimestampError` from `@open-e2ee/signal-protocol-sdk/types` and stores or posts nothing for the send. | Send again with a timestamp in the window, or with no timestamp. |
86
87
  | `MESSAGE_DUPLICATE` | The session processed this message before. | Discard the duplicate. |
87
88
  | `TOO_MANY_SKIPPED_MESSAGES` | The message exceeded the skipped-key bound. | Reset the affected session. |
88
89
  | `REPLAY_DETECTED` | Envelope and encrypted-content timestamps differ. | Reject the message as a replay. |
@@ -150,6 +150,16 @@ await signal.send("bob", {
150
150
  });
151
151
  ```
152
152
 
153
+ A new send accepts a `timestamp` at most 5 minutes ahead of the SDK clock and
154
+ at most 24 hours behind it. For any other value, `send()` throws
155
+ `InvalidSendTimestampError` and stores or posts nothing. Omit `timestamp`, and
156
+ the SDK uses its clock. From the Relay release that follows v2026.10.25, the
157
+ Relay admits a mailbox delivery epoch and a new group fan-out operation in the
158
+ same window. Earlier Relay releases admit a new operation only within 5
159
+ minutes of its epoch. On an earlier Relay release, a time 5 minutes to 24 hours
160
+ old passes the SDK check but gets `OPERATION_EXPIRED`. The SDK check uses the
161
+ same bounds, so the SDK refuses an application-supplied time before any post.
162
+
153
163
  A hosted client sends a sealed 1:1 message only when you pass
154
164
  `hosted.profileKeys`, and only to a contact whose profile key `contacts` holds.
155
165
  Each other 1:1 message is identified, so the Relay sees its sender. Until the
@@ -12,6 +12,7 @@ It also defines the vocabulary the rest of the documentation assumes.
12
12
  ## Core model
13
13
 
14
14
  - `createHostedSignalProtocolClient()` connects to the OpenE2EE Signal Protocol Relay.
15
+ - `resumeHostedSignalProtocolClient()` requires existing permanent Signal identity keys, device-authentication authority and a hosted session. It never requests a provider assertion or registers a replacement.
15
16
  - `createSignalProtocolClient()` composes an application-owned client transport.
16
17
  - `DefaultSignalProtocolClient` is the class the factory returns. `SignalProtocolClient` is its interface.
17
18
  - Every client requires `storage`, which owns local encryption state for one
@@ -256,3 +257,23 @@ implement the same `MediaAttachmentTransfer` seam.
256
257
  - [Public types](../types/README.md)
257
258
  - [Zero-knowledge credentials and groups](../zk/README.md)
258
259
  - [Documentation and comment standards](./DOCUMENTATION_STANDARDS.md)
260
+
261
+ ## Resume an existing hosted device
262
+
263
+ Use `resumeHostedSignalProtocolClient({ adapters: { storage }, hosted: { relayUrl } })`
264
+ when the application must preserve the device already held by its open store.
265
+ The SDK refuses missing, unreadable or changed required identity state. It never
266
+ falls back to registration, recovery or device linking. The default
267
+ `createHostedSignalProtocolClient()` behavior stays the same.
268
+
269
+ A successful resume renews and persists the authenticated device token. Normal
270
+ prekey maintenance and client startup, including automatic subscription when
271
+ the application configures receive hooks, still run. This API does not promise an unchanged
272
+ store or prove that the store contains every historical message/key.
273
+
274
+ The application owns the store and must not use it concurrently. A
275
+ `HostedRelayResumeError` with `cleanupPending` retains a client that has not
276
+ completed `stop()`. Keep that error and call `retryCleanup()` only when cleanup is
277
+ selected. This retries the held stop, never resume or registration, and never
278
+ closes the application store. Preserve unresolved application operation state.
279
+ Do not display raw error causes or key material in a public error report.
package/docs/RECIPES.md CHANGED
@@ -56,8 +56,9 @@ other provider paths and their evidence levels. Those paths issue custom-token
56
56
  assertions. They are not native provider adapters in this package.
57
57
 
58
58
  Application logout and assertion refusal do not revoke existing device proofs.
59
- The customer suspension/resume recipe awaits the supported backend and CLI
60
- surface. Anonymous capabilities retain their separate limits.
59
+ To stop identified access on existing devices, follow the
60
+ [suspension procedure](https://docs.open-e2ee.dev/relay/backend-identity#suspend-an-identified-account).
61
+ Anonymous capabilities retain their separate limits.
61
62
 
62
63
  ## Production composition with Expo on the Signal Protocol Relay
63
64
 
@@ -169,14 +169,21 @@ environment an adapter must honor its promises in, not the subject of a test.
169
169
  in turn, so that the file moves to the other tab at each write. Each
170
170
  write is read back, and `PRAGMA integrity_check` returns `ok` after
171
171
  each phase and after each open. A closed store leaves no worker in the
172
- tab and no lock of the store in the origin. The gate fails if the
173
- late-run median of latency, of the page heap, or of the worker heap
174
- grows beyond a small tolerance over the early-run median, if the Wasm
175
- memory of the worker grows after the first third of the churn, or if
176
- the database file grows by more than 10% and 64 KiB over the churn.
177
- Runs in Chromium on each change to the main branch and on each pull
178
- request that is ready for review. `npm run soak:web-sqlite` also runs
179
- it in Firefox and WebKit on demand, without the memory checks.
172
+ tab and no lock of the store in the origin. After the cycles, the tab
173
+ holds no IndexedDB connection, the OPFS root holds no new entry, and
174
+ the database file has not grown since the first third. Each cycle and
175
+ each two-tab read is timed next to a control that does the same
176
+ platform work with no store state. The gate fails if the late-run
177
+ median of that ratio grows by more than half over the early-run
178
+ median, or if the page heap grows by more than 1.5 KiB a cycle. It
179
+ also fails if the late-run median of the churn latency, of the page
180
+ heap, or of the worker heap grows beyond a small tolerance over the
181
+ early-run median, if the Wasm memory of the worker grows after the
182
+ first third of the churn, or if the database file grows by more than
183
+ 10% and 64 KiB over the churn. Runs in Chromium on each change to the
184
+ main branch and on each pull request that is ready for review.
185
+ `npm run soak:web-sqlite` also runs it in Firefox and WebKit on
186
+ demand, without the memory and IndexedDB connection checks.
180
187
 
181
188
  `KeyValueSignalProtocolStore` (graduated, and the gates keep running):
182
189
 
@@ -402,7 +409,7 @@ with `assertBackendConformance`.
402
409
 
403
410
  ## Design Notes
404
411
 
405
- Reviewed: 2026-10-20.
412
+ Reviewed: 2026-10-24.
406
413
 
407
414
  Receive records use the same encryption and transaction boundary as protocol state.
408
415
 
@@ -39,10 +39,10 @@ open (`INVALID_STATE`).
39
39
 
40
40
  Options:
41
41
 
42
- - `name`: the database name in OPFS. A letter or digit, then up to 63
43
- letters, digits, `.`, `_`, and `-`, and no `.oe2e-convert` ending. It also
44
- names the vault slot of the key. A conversion with `convertPlaintext` needs
45
- a name of at most 51 characters. Default: `open-e2ee-signal-protocol.db`.
42
+ - `name`: the database name in OPFS, at most 224 UTF-8 bytes. It starts with
43
+ an ASCII letter or digit and contains only ASCII letters, digits, `.`, `_`,
44
+ and `-`. The `.oe2e-convert` ending is reserved. The name also identifies
45
+ the vault slot of the key. Default: `open-e2ee-signal-protocol.db`.
46
46
  - `vault`: the `SignalProtocolLocalSecretVault` that holds the database key.
47
47
  Default: the SDK's IndexedDB vault in the same origin.
48
48
  - `encryptionAtRest`: pass `false` to store the database without encryption.
@@ -55,6 +55,21 @@ Options:
55
55
  - `logger`: receives the warning of each open without encryption.
56
56
  - `workerUrl` and `wasmUrl`: see [Content Security Policy](#content-security-policy).
57
57
 
58
+ The name budget reserves 18 bytes for `.open-e2ee-sqlite-` and 13 bytes for
59
+ the conversion ending. Thus the longest generated directory component is
60
+ 255 bytes. This is a conservative portability contract.
61
+ [Filesystem documentation](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation)
62
+ reports 255 as a common component limit.
63
+ OPFS does not specify a universal 255-byte limit.
64
+
65
+ The budget also fits the engine's 512-byte path header, including the root
66
+ slash, SQLite's auxiliary ending, and the terminator reserve.
67
+ [SQLite permits an auxiliary ending of at most 12 ASCII bytes](https://sqlite.org/c3ref/vfs.html).
68
+ The store checks the name before any lock, vault, worker, or OPFS access.
69
+ It rejects oversized inputs before encoding and uses a fixed-size encoding
70
+ buffer for the remaining inputs. Existing accepted names keep their file,
71
+ directory, lock, and vault identities.
72
+
58
73
  Each store runs its own worker. Close the store with `close()`: it closes the
59
74
  database and stops the worker. A failed open also stops its worker. Keep
60
75
  application tables in a separate
@@ -134,8 +149,9 @@ database that does not exist leaves no directory.
134
149
 
135
150
  The conversion needs the store of the name in no other tab or worker of the
136
151
  origin. While another context has it open, the conversion fails at once with
137
- `INVALID_STATE` and changes nothing. A name longer than 51 characters also
138
- fails with `INVALID_STATE` before any write.
152
+ `INVALID_STATE` and changes nothing. Every accepted database name fits its
153
+ conversion temporary name. A name over 224 UTF-8 bytes fails with
154
+ `INVALID_STATE` before any storage access.
139
155
 
140
156
  The conversion refuses, with `INVALID_STATE`, a database that holds an
141
157
  application table, a BLOB value, or an integer outside the safe JavaScript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-e2ee/signal-protocol-sdk",
3
- "version": "13.2.0",
3
+ "version": "13.4.0",
4
4
  "description": "Pure TypeScript Signal Protocol SDK for encrypted chat in Expo, React Native, browsers, and Node. Post-quantum by default.",
5
5
  "keywords": [
6
6
  "open-e2ee",