@open-e2ee/signal-protocol-sdk 13.4.0 → 13.5.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 (163) hide show
  1. package/CHANGELOG.md +417 -0
  2. package/README.md +1 -1
  3. package/SECURITY.md +2 -2
  4. package/dist/client/binary-send.d.ts +28 -0
  5. package/dist/client/binary-send.d.ts.map +1 -0
  6. package/dist/client/binary-send.js +26 -0
  7. package/dist/client/binary-send.js.map +1 -0
  8. package/dist/client/client.d.ts +46 -6
  9. package/dist/client/client.d.ts.map +1 -1
  10. package/dist/client/client.js +181 -66
  11. package/dist/client/client.js.map +1 -1
  12. package/dist/client/content-adapter.d.ts +18 -0
  13. package/dist/client/content-adapter.d.ts.map +1 -1
  14. package/dist/client/content-adapter.js.map +1 -1
  15. package/dist/client/device-set-reconciliation.d.ts +23 -8
  16. package/dist/client/device-set-reconciliation.d.ts.map +1 -1
  17. package/dist/client/device-set-reconciliation.js +25 -11
  18. package/dist/client/device-set-reconciliation.js.map +1 -1
  19. package/dist/client/event-hooks.d.ts +88 -8
  20. package/dist/client/event-hooks.d.ts.map +1 -1
  21. package/dist/client/event-hooks.js +1 -0
  22. package/dist/client/event-hooks.js.map +1 -1
  23. package/dist/client/group-outbox.d.ts +45 -10
  24. package/dist/client/group-outbox.d.ts.map +1 -1
  25. package/dist/client/group-outbox.js +246 -154
  26. package/dist/client/group-outbox.js.map +1 -1
  27. package/dist/client/group-receive-authorization.d.ts +10 -1
  28. package/dist/client/group-receive-authorization.d.ts.map +1 -1
  29. package/dist/client/group-receive-authorization.js.map +1 -1
  30. package/dist/client/hosted-anonymous-delivery.d.ts +18 -1
  31. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  32. package/dist/client/hosted-anonymous-delivery.js +84 -12
  33. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  34. package/dist/client/hosted-connection.js +1 -1
  35. package/dist/client/hosted-connection.js.map +1 -1
  36. package/dist/client/hosted-group-authority.d.ts +6 -2
  37. package/dist/client/hosted-group-authority.d.ts.map +1 -1
  38. package/dist/client/hosted-group-authority.js +11 -7
  39. package/dist/client/hosted-group-authority.js.map +1 -1
  40. package/dist/client/hosted-groups.d.ts +5 -1
  41. package/dist/client/hosted-groups.d.ts.map +1 -1
  42. package/dist/client/hosted-groups.js +8 -4
  43. package/dist/client/hosted-groups.js.map +1 -1
  44. package/dist/client/hosted-http-error.d.ts +5 -1
  45. package/dist/client/hosted-http-error.d.ts.map +1 -1
  46. package/dist/client/hosted-http-error.js +5 -1
  47. package/dist/client/hosted-http-error.js.map +1 -1
  48. package/dist/client/hosted-mailbox-subscription.d.ts +2 -0
  49. package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
  50. package/dist/client/hosted-mailbox-subscription.js +5 -5
  51. package/dist/client/hosted-mailbox-subscription.js.map +1 -1
  52. package/dist/client/hosted-transport.d.ts +11 -1
  53. package/dist/client/hosted-transport.d.ts.map +1 -1
  54. package/dist/client/hosted-transport.js +75 -30
  55. package/dist/client/hosted-transport.js.map +1 -1
  56. package/dist/client/hosted.d.ts.map +1 -1
  57. package/dist/client/hosted.js +1 -1
  58. package/dist/client/hosted.js.map +1 -1
  59. package/dist/client/index.d.ts +1 -1
  60. package/dist/client/index.d.ts.map +1 -1
  61. package/dist/client/index.js.map +1 -1
  62. package/dist/client/receive-queue.d.ts +5 -2
  63. package/dist/client/receive-queue.d.ts.map +1 -1
  64. package/dist/client/receive-queue.js +55 -18
  65. package/dist/client/receive-queue.js.map +1 -1
  66. package/dist/client/relay-acceptance.d.ts +49 -6
  67. package/dist/client/relay-acceptance.d.ts.map +1 -1
  68. package/dist/client/relay-acceptance.js +49 -3
  69. package/dist/client/relay-acceptance.js.map +1 -1
  70. package/dist/client/relay-protocol.d.ts +37 -7
  71. package/dist/client/relay-protocol.d.ts.map +1 -1
  72. package/dist/client/relay-protocol.js +53 -10
  73. package/dist/client/relay-protocol.js.map +1 -1
  74. package/dist/client/retry-family.d.ts +3 -3
  75. package/dist/client/retry-family.js +1 -1
  76. package/dist/client/retry-family.js.map +1 -1
  77. package/dist/client/retry-request-envelope.d.ts +18 -8
  78. package/dist/client/retry-request-envelope.d.ts.map +1 -1
  79. package/dist/client/retry-request-envelope.js +57 -29
  80. package/dist/client/retry-request-envelope.js.map +1 -1
  81. package/dist/client/retry-request-lifecycle.d.ts +24 -11
  82. package/dist/client/retry-request-lifecycle.d.ts.map +1 -1
  83. package/dist/client/retry-request-lifecycle.js +46 -20
  84. package/dist/client/retry-request-lifecycle.js.map +1 -1
  85. package/dist/client/retry-terminal-recovery.d.ts +11 -8
  86. package/dist/client/retry-terminal-recovery.d.ts.map +1 -1
  87. package/dist/client/retry-terminal-recovery.js +18 -12
  88. package/dist/client/retry-terminal-recovery.js.map +1 -1
  89. package/dist/client/retry.d.ts +8 -7
  90. package/dist/client/retry.d.ts.map +1 -1
  91. package/dist/client/retry.js +30 -22
  92. package/dist/client/retry.js.map +1 -1
  93. package/dist/client/send-deadline.d.ts +308 -0
  94. package/dist/client/send-deadline.d.ts.map +1 -0
  95. package/dist/client/send-deadline.js +914 -0
  96. package/dist/client/send-deadline.js.map +1 -0
  97. package/dist/client/send-intent-driver.d.ts +116 -0
  98. package/dist/client/send-intent-driver.d.ts.map +1 -0
  99. package/dist/client/send-intent-driver.js +373 -0
  100. package/dist/client/send-intent-driver.js.map +1 -0
  101. package/dist/client/signal-service-cipher.d.ts +257 -27
  102. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  103. package/dist/client/signal-service-cipher.js +1274 -283
  104. package/dist/client/signal-service-cipher.js.map +1 -1
  105. package/dist/client/types.d.ts +48 -5
  106. package/dist/client/types.d.ts.map +1 -1
  107. package/dist/client/types.js.map +1 -1
  108. package/dist/index.d.ts +1 -1
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js.map +1 -1
  111. package/dist/local/store/conformance/cases/metadata.d.ts +3 -2
  112. package/dist/local/store/conformance/cases/metadata.d.ts.map +1 -1
  113. package/dist/local/store/conformance/cases/metadata.js +153 -2
  114. package/dist/local/store/conformance/cases/metadata.js.map +1 -1
  115. package/dist/local/store/key-value/adapter.d.ts +2 -1
  116. package/dist/local/store/key-value/adapter.d.ts.map +1 -1
  117. package/dist/local/store/key-value/adapter.js +9 -0
  118. package/dist/local/store/key-value/adapter.js.map +1 -1
  119. package/dist/local/store/memory/adapter.d.ts +2 -1
  120. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  121. package/dist/local/store/memory/adapter.js +4 -0
  122. package/dist/local/store/memory/adapter.js.map +1 -1
  123. package/dist/local/store/metadata-keys.d.ts +13 -0
  124. package/dist/local/store/metadata-keys.d.ts.map +1 -0
  125. package/dist/local/store/metadata-keys.js +20 -0
  126. package/dist/local/store/metadata-keys.js.map +1 -0
  127. package/dist/local/store/receive-work.d.ts.map +1 -1
  128. package/dist/local/store/receive-work.js +12 -1
  129. package/dist/local/store/receive-work.js.map +1 -1
  130. package/dist/local/store/reliability.d.ts +482 -33
  131. package/dist/local/store/reliability.d.ts.map +1 -1
  132. package/dist/local/store/reliability.js +690 -48
  133. package/dist/local/store/reliability.js.map +1 -1
  134. package/dist/local/store/sqlite/key-storage/index.d.ts +2 -1
  135. package/dist/local/store/sqlite/key-storage/index.d.ts.map +1 -1
  136. package/dist/local/store/sqlite/key-storage/index.js +3 -0
  137. package/dist/local/store/sqlite/key-storage/index.js.map +1 -1
  138. package/dist/local/store/sqlite/key-storage/metadata.d.ts +9 -0
  139. package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -1
  140. package/dist/local/store/sqlite/key-storage/metadata.js +12 -0
  141. package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -1
  142. package/dist/local/store/sqlite/store.d.ts +2 -1
  143. package/dist/local/store/sqlite/store.d.ts.map +1 -1
  144. package/dist/local/store/sqlite/store.js +3 -0
  145. package/dist/local/store/sqlite/store.js.map +1 -1
  146. package/dist/local/store/web/adapter.d.ts +8 -1
  147. package/dist/local/store/web/adapter.d.ts.map +1 -1
  148. package/dist/local/store/web/adapter.js +18 -0
  149. package/dist/local/store/web/adapter.js.map +1 -1
  150. package/dist/remote/relay/request-admission.d.ts +49 -0
  151. package/dist/remote/relay/request-admission.d.ts.map +1 -0
  152. package/dist/remote/relay/request-admission.js +74 -0
  153. package/dist/remote/relay/request-admission.js.map +1 -0
  154. package/dist/types/api.d.ts +77 -0
  155. package/dist/types/api.d.ts.map +1 -1
  156. package/dist/types/errors.d.ts +144 -1
  157. package/dist/types/errors.d.ts.map +1 -1
  158. package/dist/types/errors.js +146 -1
  159. package/dist/types/errors.js.map +1 -1
  160. package/docs/ASSURANCE.md +5 -5
  161. package/docs/DEVIATIONS.md +34 -4
  162. package/docs/ERROR_HANDLING.md +134 -7
  163. package/package.json +1 -1
@@ -16,7 +16,9 @@
16
16
  * ├── PQXDHRequiredError which post-quantum key the peer is missing
17
17
  * ├── StorageQuotaExceededError the store that ran out of room
18
18
  * ├── SecureRandomUnavailableError the runtime has no secure random source
19
- * └── InvalidSendTimestampError the refused send timestamp and the accepted window
19
+ * ├── InvalidSendTimestampError the refused send timestamp and the accepted window
20
+ * ├── SendAcceptanceUnknownError the devices of an ended send whose acceptance is not known
21
+ * └── SendNeverAcceptedByRelayError the devices of an ended send that the Relay never accepted and that have no refusal code
20
22
  * ```
21
23
  *
22
24
  * A code or a subclass belongs here only if production code can produce it. An
@@ -117,6 +119,19 @@ export var EncryptionErrorCode;
117
119
  * before it stores or posts anything for the send.
118
120
  */
119
121
  EncryptionErrorCode["INVALID_SEND_TIMESTAMP"] = "INVALID_SEND_TIMESTAMP";
122
+ /**
123
+ * The posting deadline of a direct or group send ended, and the Relay
124
+ * acceptance of one or more devices is not known. The message might have arrived. The SDK
125
+ * throws `SendAcceptanceUnknownError` and posts nothing more for the send.
126
+ */
127
+ EncryptionErrorCode["SEND_ACCEPTANCE_UNKNOWN"] = "SEND_ACCEPTANCE_UNKNOWN";
128
+ /**
129
+ * The posting deadline of a send ended, the call raised no refusal (a
130
+ * thrown refusal or a refusal in the receipt of a shared body), and no
131
+ * refused device has a stored refusal code. The SDK throws
132
+ * `SendNeverAcceptedByRelayError` and posts nothing more for the send.
133
+ */
134
+ EncryptionErrorCode["SEND_NEVER_ACCEPTED"] = "SEND_NEVER_ACCEPTED";
120
135
  /**
121
136
  * Duplicate message detected (replay attack).
122
137
  *
@@ -630,6 +645,136 @@ export class InvalidSendTimestampError extends EncryptionError {
630
645
  export function isInvalidSendTimestampError(error) {
631
646
  return error instanceof InvalidSendTimestampError;
632
647
  }
648
+ /**
649
+ * Error thrown when the posting deadline of a direct or group send ends and
650
+ * the Relay acceptance of one or more devices is not known.
651
+ *
652
+ * The posting deadline, `deadlineAt`, is the earlier of 24 hours after the
653
+ * SDK first stored the send and 24 hours after its timestamp. At or after it,
654
+ * the SDK starts no request for the send. The message might have arrived on
655
+ * each device in `unknownDevices`, so `mayHaveArrived` is true. The devices in
656
+ * `acceptedDevices` have the message. The devices in `refusedDevices` do not.
657
+ * `retryable` is false, because the SDK posts nothing more for the send.
658
+ *
659
+ * The outbox keeps the end of the send. A call of `send()` with the same
660
+ * `clientMessageId`, content and timestamp throws this error again and posts
661
+ * nothing. Such an error has no `cause`, because the outbox keeps no error.
662
+ * Otherwise `cause` is the last error of the send.
663
+ *
664
+ * A replay or a resend after this error can add one charged unit within 24
665
+ * hours, when the Relay no longer holds the first acceptance. The SDK does not
666
+ * promise that a retry is free of charge.
667
+ *
668
+ * `isOutgoingMessageError` is true for this error.
669
+ *
670
+ * @example
671
+ * ```typescript
672
+ * try {
673
+ * await signal.send(recipientId, { body }, { clientMessageId });
674
+ * } catch (error) {
675
+ * if (isSendAcceptanceUnknownError(error)) {
676
+ * showMightHaveArrived(error.clientMessageId);
677
+ * }
678
+ * }
679
+ * ```
680
+ */
681
+ export class SendAcceptanceUnknownError extends EncryptionError {
682
+ name = 'SendAcceptanceUnknownError';
683
+ /** The logical-send identifier of the send. */
684
+ clientMessageId;
685
+ /** The posting deadline of the send, in milliseconds since the epoch. */
686
+ deadlineAt;
687
+ /** The devices whose Relay acceptance the SDK holds. */
688
+ acceptedDevices;
689
+ /** The devices whose Relay acceptance is not known. */
690
+ unknownDevices;
691
+ /** The devices that the Relay never accepted the send for. */
692
+ refusedDevices;
693
+ /** Always true: the message might have arrived on each unknown device. */
694
+ mayHaveArrived = true;
695
+ /** Always false: the SDK posts nothing more for the send. */
696
+ retryable = false;
697
+ constructor(details) {
698
+ super(`The posting deadline of send ${details.clientMessageId} ended, and the Relay acceptance of ${String(details.unknownDevices.length)} devices is not known`, EncryptionErrorCode.SEND_ACCEPTANCE_UNKNOWN, { operation: 'send', clientMessageId: details.clientMessageId, deadlineAt: details.deadlineAt });
699
+ this.clientMessageId = details.clientMessageId;
700
+ this.deadlineAt = details.deadlineAt;
701
+ this.acceptedDevices = details.acceptedDevices;
702
+ this.unknownDevices = details.unknownDevices;
703
+ this.refusedDevices = details.refusedDevices;
704
+ if (details.cause !== undefined)
705
+ this.cause = details.cause;
706
+ }
707
+ }
708
+ /**
709
+ * Type guard to check if an error is a SendAcceptanceUnknownError.
710
+ *
711
+ * @param error - Error to check
712
+ * @returns true if error is SendAcceptanceUnknownError
713
+ */
714
+ export function isSendAcceptanceUnknownError(error) {
715
+ return error instanceof SendAcceptanceUnknownError;
716
+ }
717
+ /**
718
+ * Error thrown when the posting deadline of a send ends, the call raised no
719
+ * refusal (a thrown refusal or a refusal in the receipt of a shared body), and
720
+ * no refused device has a stored refusal code.
721
+ *
722
+ * The Relay never stored the send for the devices in `refusedDevices`, so
723
+ * they do not have the message. The devices in `acceptedDevices` have it.
724
+ * `retryable` is false, because the SDK posts nothing more for the send. A
725
+ * send whose timestamp is 24 hours old gets this error at once.
726
+ *
727
+ * The outbox keeps the end of the send. A call of `send()` with the same
728
+ * `clientMessageId`, content and timestamp throws this error again and posts
729
+ * nothing. When the call that ends the send raised a refusal, the SDK throws
730
+ * the first such refusal with the same fields in place of this error. A
731
+ * thrown refusal keeps its class, and a refusal in a receipt is an `Error`
732
+ * with its code. Otherwise, when a refused device has a stored refusal code,
733
+ * the SDK throws an `Error` with the code of the first such device in the
734
+ * order of the destinations.
735
+ *
736
+ * `isOutgoingMessageError` is true for this error.
737
+ *
738
+ * @example
739
+ * ```typescript
740
+ * try {
741
+ * await signal.send(recipientId, { body }, { clientMessageId });
742
+ * } catch (error) {
743
+ * if (isSendNeverAcceptedByRelayError(error)) {
744
+ * showNotDelivered(error.refusedDevices);
745
+ * }
746
+ * }
747
+ * ```
748
+ */
749
+ export class SendNeverAcceptedByRelayError extends EncryptionError {
750
+ name = 'SendNeverAcceptedByRelayError';
751
+ /** The logical-send identifier of the send. */
752
+ clientMessageId;
753
+ /** The posting deadline of the send, in milliseconds since the epoch. */
754
+ deadlineAt;
755
+ /** The devices whose Relay acceptance the SDK holds. */
756
+ acceptedDevices;
757
+ /** The devices that the Relay never accepted the send for. */
758
+ refusedDevices;
759
+ /** Always false: the SDK posts nothing more for the send. */
760
+ retryable = false;
761
+ constructor(details) {
762
+ super(`The posting deadline of send ${details.clientMessageId} ended before the Relay accepted it for ${String(details.refusedDevices.length)} devices`, EncryptionErrorCode.SEND_NEVER_ACCEPTED, { operation: 'send', clientMessageId: details.clientMessageId, deadlineAt: details.deadlineAt });
763
+ this.clientMessageId = details.clientMessageId;
764
+ this.deadlineAt = details.deadlineAt;
765
+ this.acceptedDevices = details.acceptedDevices;
766
+ this.refusedDevices = details.refusedDevices;
767
+ }
768
+ }
769
+ /**
770
+ * Type guard to check if an error is a SendNeverAcceptedByRelayError.
771
+ *
772
+ * @param error - Error to check
773
+ * @returns true if error is SendNeverAcceptedByRelayError
774
+ */
775
+ export function isSendNeverAcceptedByRelayError(error) {
776
+ return error instanceof SendNeverAcceptedByRelayError;
777
+ }
633
778
  /**
634
779
  * Type guard to check if an error is a SecureRandomUnavailableError.
635
780
  *
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../types/errors.ts"],"names":[],"mapp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ects. [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-28:
19
+ Most recent full run on 2026-10-31:
20
20
 
21
21
  | | |
22
22
  |---|---|
23
- | Test modules | 587 |
24
- | Test cases | 11,932 |
25
- | Passed | 11,928 |
23
+ | Test modules | 598 |
24
+ | Test cases | 12,383 |
25
+ | Passed | 12,379 |
26
26
  | Skipped | 4 |
27
27
  | Failed | 0 |
28
- | Wall time | 1074 s |
28
+ | Wall time | 761 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
 
@@ -100,6 +100,7 @@ model and what is out of scope.
100
100
  | **Registration IDs** | `libsignal` `sealed_sender.rs` | **Faithful.** Generated in `[1, 16383]`, strictly inside the 14 bits the wire format reserves | — | — |
101
101
  | **Linked-device registration IDs** | Signal's device linking | **Faithful** for a new link: the linked device gets its own fresh registration ID. **Deviation:** a device that a 12.0.x release linked keeps the ID of its active device, and a link that a 12.0.x release began keeps its stored ID (§5.7) | A changed ID on a live device fails its next prekey sync. A fresh ID on a link already begun can reserve a second device | Two devices of one account can share a registration ID. The sender-key handoff ledger keys each row by the device, so they stay apart |
102
102
  | **Linked-device group keys** | Signal's device linking | **Deviation.** The link copies each group master key from the active device's group store in the calling process. A group record that a release before 12.0.0 wrote, and that the active device has not read since, is not copied (§5.8) | The SDK has no storage service, and no master key crosses the Relay | The process that links the device must hold the active device's store. Such an unread group initializes from its first group message |
103
+ | **Posting deadline and send progress** | Signal's Android client `IndividualSendJob`; Signal's Desktop client `conversationJobQueue` | **Faithful** on a window of 1 day and on progress at the deadline: an accepted device stays accepted. **Deviation** in detail. The deadline also ends 24 hours after the send timestamp, has no message-expiry term, and never moves on a restart. A lost Relay answer is acceptance-unknown, not failed. An automatic retry posts the stored bytes and epoch. With a store that lists its metadata keys, the SDK replays open sends at start and on reconnect, as the Signal job runners do, and reports each end once through `onSendOutcome`. On a custom store without the listing method, the application replays (§5.9) | The Relay admits an epoch at most 24 hours behind its clock, keeps a fingerprint of each operation, and charges each accepted operation. Custom stores stay supported, so the listing method is optional | A direct send posts nothing at or after its deadline. When the acceptance of a device is not known, the send throws `SendAcceptanceUnknownError`, and a replay or a resend after it can add one charged unit. When the plaintext of an open send is gone, `onSendOutcome` reports `content-required` |
103
104
 
104
105
  ---
105
106
 
@@ -905,7 +906,7 @@ it never runs.
905
906
 
906
907
  ### 5.6 Device-set reconciliation differs in detail
907
908
 
908
- Reviewed: 2026-10-25.
909
+ Reviewed: 2026-10-29.
909
910
 
910
911
  The reconciliation of §5.5 follows Signal's server and Signal's Desktop
911
912
  client in its rule: the server compares, the client repairs and posts again,
@@ -918,14 +919,14 @@ Signal's Android client. The following details differ.
918
919
  | 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
920
  | 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
921
  | 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. 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
+ | D4 | The operation time is fixed. `OPERATION_EXPIRED` ends the reconciliation as acceptance-unknown. A new send refuses an application timestamp outside the delivery window with `InvalidSendTimestampError`. A manual resend carries its own stored operation time (row P8) | 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, and a recipient-phase end stores the outcome `acceptance-unknown`. A new send with a timestamp outside the window throws `InvalidSendTimestampError`, and stores and posts nothing |
922
923
  | 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
924
  | 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
925
  | 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 |
925
926
  | D8 | A group post settles a not-found account as a refusal of each of its destinations, and the Relay accepts the rest | `NOT_FOUND` is a fan-out result code. A refusal of the whole post would use a restart | This is equivalent to the group-send-token path of Signal's server, which sends to the accounts it resolves and returns the others. Only the form differs: a refusal code for each destination | A removed account settles as refused and the send adds nothing. A lost response resumes as a duplicate with no not-found account |
926
927
  | D9 | The receipt of a declared post carries a `deviceSetChecked` mark | The identified Relay route passes unknown keys, and a deployment lane can lag the SDK | Signal ships its client and server together | A receipt without the mark raises `DEVICE_SET_UNCHECKED` through `onRelayProtocolError` |
927
- | D10 | The SDK seals a group body again only before the Relay accepts it, and only after a definite refusal | The Relay keeps a fingerprint of each operation and answers `RETRY_CONFLICT` to a second body under the same ID | Signal stores nothing on the server for a send attempt | A refused body is replaced in one write. A crash before the post of the replaced body posts it on resume |
928
- | D11 | A group restart keeps the group ciphertext, seals the shared body again, and replaces it in one write. It does not encrypt the content again | One group pass posts the same ciphertext in the shared body and in the device posts. A new ciphertext would change a device post that the Relay already accepted, and its replay would get `RETRY_CONFLICT` | Signal's Desktop client encrypts again for each attempt | The group ciphertext is byte-equal before and after the replacement, the accepted device post replays to its stored receipt, and the new body names the repaired destinations |
928
+ | D10 | The SDK seals a group body again only before the Relay accepts it, and only after a definite refusal | The Relay keys each delivery operation by message ID, class, destination device, generation and epoch, and keeps a fingerprint of it. It answers `RETRY_CONFLICT` to a changed body under the same operation. It also refuses a new operation whose message ID a row or journal entry of that mailbox holds. The message ID alone is not the operation key | Signal stores nothing on the server for a send attempt | A refused body is replaced in one write. A crash before the post of the replaced body posts it on resume. A `RETRY_CONFLICT` answer to a group shared post counts as acceptance and raises no `onRelayProtocolError` report |
929
+ | D11 | A group restart keeps the group ciphertext, seals the shared body again, and replaces it in one write. It does not encrypt the content again | One group pass posts the same ciphertext in the shared body and in the device posts. A new ciphertext would change a device post that the Relay already accepted. The Relay keys that post by its operation, so its replay would get `RETRY_CONFLICT`. The message-ID check of each mailbox also refuses a new operation under the same message ID | Signal's Desktop client encrypts again for each attempt | The group ciphertext is byte-equal before and after the replacement, the accepted device post replays to its stored receipt, and the new body names the repaired destinations. A repaired pre-message that gets `RETRY_CONFLICT` records no sender-key handoff |
929
930
  | D12 | A declared post with no `recipientRegistrationId` skips the registration check | The field is optional on every Relay route | Signal's server compares the registration of each device of a post | A Relay test posts an unnamed registration |
930
931
  | D13 | A declaration that names the sender device gets 400 | The Relay refuses a malformed declaration before it compares | Signal's server answers 409 and names the sender device as an extra device | Relay tests on the direct and the group routes. The SDK does not declare the sender device |
931
932
  | D14 | The identified group route compares the declared device set, with the codes and the order of the direct route | The route serves Relay API customers | Signal has no identified group route | Relay tests. No SDK code calls the route |
@@ -960,6 +961,35 @@ its groups from the storage service.
960
961
  | G1 | The link copies group master keys in the calling process | No master key crosses the Relay, and the adapter gets no private key | The SDK has no storage service | Each listed group arrives on the linked device with the master key of the active device and initializes with no application step. A link stopped at any write of the copy and restarted, also in a new browser tab, ends with the group set of the active device. A Relay refusal removes each copied group |
961
962
  | G2 | A group record that a release before 12.0.0 wrote, and that the active device has not read since, is not copied | The group store lists only migrated records. The link has no other source of the group IDs | Signal restores each group from the storage service | Such a group initializes on the linked device from its first group message. Read each group once on the active device before the link to copy it |
962
963
 
964
+ ### 5.9 The posting deadline and send progress
965
+
966
+ Reviewed: 2026-10-30.
967
+
968
+ Signal's Android client gives a send job a lifespan of one day from its
969
+ creation, and Signal's Desktop client stops a send job one day after its
970
+ timestamp. A direct or group send of the SDK has a posting deadline in the same window.
971
+ At or after the deadline, the SDK starts no Relay request for the send. A
972
+ request that started before the deadline still counts when its answer arrives
973
+ later, and a device that the Relay accepted stays accepted, as in Signal. A
974
+ replay posts only the devices that the Relay did not accept, as Signal skips
975
+ the recipients that completed. The SDK replays open sends at start and on
976
+ reconnect, and the deadline ends the replay, as the Signal job runners do. On
977
+ a custom store without the optional listing method, the application replays.
978
+ A retry request has its own posting deadline, in row P9. The following details differ.
979
+
980
+ | ID | Deviation | Constraint | Why Signal's form does not fit | Guarantee test |
981
+ |---|---|---|---|---|
982
+ | P1 | The deadline is the earlier of 24 hours after the SDK first stores the send and 24 hours after its `clientTimestamp` | The epoch of each post is the send timestamp, and the Relay admits an epoch at most 24 hours behind its clock. A founder ruling sets this term | Signal has no caller timestamp and no admission window | A send backdated by 23 hours posts inside the remaining hour and posts nothing after it. A send backdated by 24 hours posts nothing and throws `SendNeverAcceptedByRelayError` |
983
+ | P2 | The deadline has no message-expiry term | The SDK has no message expiry. `SendOptions.expiresIn` is a future feature. The founder ruling "DA1 F1 posting window terms: the 24-hour terms only, no expiry term until a message expiry feature exists (2026-10-28, founder)" sets this term. When that feature ships, its timer starts after acceptance and controls local deletion only, and it never ends a pending post | Signal starts its expiry timer after the send | The stored deadline is 24 hours after the clock read that first stores the send, with no other term. At `deadlineAt` plus 1 ms, a replay of a declared or an undeclared send posts nothing and throws `SendAcceptanceUnknownError` |
984
+ | P3 | A replay, a restart or a repair never moves the deadline | The deadline bounds the age of the kept epoch, and the Relay refuses an older epoch. A founder ruling says that retries and restarts never reset it | Signal's Android client starts a new job for a pending send | The deadline after a replay, a restart and a repair equals the first stored value. The deadline read after a restart equals the stored value |
985
+ | P4 | A device whose Relay answer is lost, or whose answer follows an uncertain request, ends acceptance-unknown, not failed | The Relay can accept a post whose answer the SDK does not get, and a later post under the same ID can add one charged unit | Signal's Desktop client shows such a send as failed | An unanswered post and then an `OPERATION_EXPIRED` refusal end with `SendAcceptanceUnknownError`. A replay with no stored evidence for a device does not count that device as refused |
986
+ | P5 | An automatic retry posts the stored bytes and the stored epoch, also for a retry resend | The Relay keeps a fingerprint of each operation and answers `RETRY_CONFLICT` to other bytes under one ID. A fresh epoch makes a new charged operation | Signal encrypts the content again for each attempt | A replay after a restart posts the same bytes under the same ID and the first epoch, and a repair keeps that epoch. A stored retry resend that gets `OPERATION_EXPIRED` keeps its stored epoch and bytes, posts nothing more under its ID and encrypts nothing again |
987
+ | P6 | The SDK stores the progress of each destination device, for recipients and sync copies. Before each request, it marks the device as posted and counts the request. At the end, a device counts as refused only when its stored answer is a refusal or a pending answer and its `uncertain` flag is unset. A request with no answer, an uncertain answer, or a send that SDK 13.3 stored sets the flag for good. A replay skips a refused device, and counts it toward an end at once, only when no recovery in the call can change the refusal or its repair already ran | The Relay can store a post whose answer the SDK does not get, and a later post under the same ID can add one charged unit. The Relay gives a refusal or a pending answer before it stores the post | Signal has no charged operation, so it does not keep a durable mark of each request | A replay after a restart posts only the devices with no stored acceptance. A replay ends at once, and posts nothing, when each open device has a stored refusal that the SDK cannot recover, and throws an `Error` with the stored code of the first refused device that has one, in the order of the destinations. A stored `STALE_DEVICE` refusal with no spent repair gets a new post. A crash after a request, or a send that SDK 13.3 stored, ends with `SendAcceptanceUnknownError` when the replay gets `OPERATION_EXPIRED` |
988
+ | P7 | A repair of a stale device keeps the operation and its epoch. A `RETRY_CONFLICT` answer to the repaired post makes the device unknown, not accepted. The repair writes its mark to the stored progress, and the same call reads that mark | The repaired post has new bytes under the kept ID. The Relay answers `RETRY_CONFLICT` when it holds other bytes for that ID, so the SDK cannot tell which bytes it holds | Signal encrypts the content again for each attempt | A `RETRY_CONFLICT` answer to a repaired post throws a retryable `RETRY_CONFLICT` error, and the device is stored unknown with the `uncertain` flag. The answer never counts as an earlier acceptance, in the same call or on a replay |
989
+ | P8 | A manual resend with `resendMessage` after a send end is a new operation. It has a fresh stored operation time, the message ID `<clientMessageId>:manual:N` and its own posting deadline 24 hours after its creation. Its content keeps the original timestamp, and the receive queue of a recipient drops a copy with the same sender device, the same original timestamp and the same content digest. The drop needs the timestamp that the content adapter reads from the message, so raw string or byte content takes no drop key and a recipient that holds it receives the copy again. A resend of a group send posts the content of its send log entry, so each copy carries the group context of the original send, not the current one. The recipient records the message with the completion of its receive record. When a delivery receipt is due, it records the message right after the receipt-due write and again with the completion of the receipt. The record expires after 60 days. The caller-origin receive path gives every decrypted message to the caller, and a caller that keeps its own records removes a copy itself. Only a send younger than 30 days takes a new manual resend. The Relay can charge the resend as a new message, and the message might already have arrived | The Relay admits an operation time at most 24 hours behind its clock and charges each accepted operation. The founder ruling "DA1 F4 manual resend identity: a fresh operation epoch with the original timestamp in the content (2026-10-28, founder)" sets this identity. The SDK encrypts the content again for each device, as the retry-request resend does | Signal's clients resend the stored message with its original timestamp in a new job, and the receivers drop a copy by sender and timestamp alone. The SDK adds the SHA-256 digest of the content to the key, so an application that sends two messages in one millisecond keeps both. This rule holds in SDK 13.x and ends in the next major SDK version, which keys a received message by its sender and timestamp only. Signal's server keeps no operation time and charges no send | A resend posts under a fresh operation time and the manual message ID, with the original timestamp in the content. The Relay admits it after the original ended at its deadline. The entry stores its operation time, and a stored send without manual entries reads as an empty list. A recipient that holds the original drops the resend copy, and a recipient that never got the original receives it once. Two different messages of one sender device with one timestamp both deliver. When no receipt is owed, a stop before the completion of the receive record runs `onMessageDecrypted` again. When a receipt is owed, only a stop before the receipt-due write runs it again. A new resend at or after 30 days from the send throws and posts nothing |
990
+ | P9 | A retry request has a posting deadline 24 hours after the first failure of its message, and no post starts at or after it. A request whose post is due then ends as `posting-deadline`. After its posting deadline, a request whose post the Relay accepted posts nothing more and waits for its content until its 14-day deadline. `OPERATION_EXPIRED` before the posting deadline ends the request as `posting-deadline` with acceptance unknown. Each `posting-deadline` end resets the session, emits one `onRetryTerminal` event and posts no replacement attempt | The Relay admits an epoch at most 24 hours behind its clock. Its `OPERATION_EXPIRED` also answers an accepted operation that left its retained period, so it does not prove that the Relay holds nothing. The founder ruling "DA1 F3 OPERATION_EXPIRED before the posting deadline: end as acceptance-unknown now, resend on proof after DA1-Q3 (2026-10-28, founder)" sets this end. The version 2 code `DELIVERY_ALREADY_ACCEPTED` proves that the Relay holds the attempt, so a retry request reads it as `RETRY_CONFLICT` and posts no replacement | Signal's server refuses a send only for a wrong device set, before it stores anything, so a Signal client repairs and sends again at once. Signal's Android client gives its retry receipt job a lifespan of one day | A stored attempt that gets `OPERATION_EXPIRED` before the posting deadline posts no attempt 2, ends as `posting-deadline`, resets the session and emits one `onRetryTerminal` event. A fresh attempt and a stale-session repeat end the same way. No retry request posts at or after its first failure plus 24 hours, also after a restart. A request whose post the Relay accepted posts nothing after its posting deadline and ends as `expired-content` at its deadline. The next major SDK version renames this class to `request-expired`. A retry request that SDK 13.3 stored derives the posting deadline from its first failure, at most its deadline. A stored `posting-deadline` record reads back, and an unknown terminal class or a posting deadline that is not a number still reads as corrupt |
991
+ | P10 | With a store that implements `listMetadataKeys`, as every built-in store does, the SDK replays each open send at start and when the Relay connection returns, ends each send at its posting deadline, and reports each end once through `onSendOutcome`. An internal send of the SDK, such as a sender key distribution, never reaches `onSendOutcome`. The SDK keeps no content of a sender key distribution at rest, so it does not replay one: with the listing method, it ends an open distribution at its deadline and reports nothing, and a retry request of the receiver recovers a lost distribution, as in Signal. An open sender key distribution that an earlier SDK version stored carries no marker, so the SDK reports `content-required` for it once for each client run before its deadline, and reports its end through `onSendOutcome` once, at its deadline. When the stored plaintext of an open send is gone or does not match the send, the SDK reports `content-required` once for each client run, and the send stays open until its deadline. On a custom store without the optional listing method, the SDK does not replay open sends by itself, and the application replays with the same `clientMessageId` | The founder ruling "Managed-group receive follows Signal's complete workflow (DA13-L correction)" keeps custom stores supported through a documented contract and conformance tests, so the store contract does not require the listing method. The SDK keeps the plaintext of a send only when the store and the content recovery policy keep resendable content | Signal's clients keep each pending send as a job, with its content, in their own database, and run the job queue at start and when the network returns. The SDK runs on a store that the application provides, and that store can keep no content | An open send replays at start under its stored epoch and bytes, and again when the Relay connection returns. A send past its deadline at start ends with the class that its stored progress gives, posts nothing, and reports once, also across a restart before the report. A send whose plaintext is gone or does not match its digest reports `content-required` once for each client run. A store without the method starts no driver, logs one line, and still reports the end of an application send, and the conformance suite skips its listing cases on that store |
992
+
963
993
  ---
964
994
 
965
995
  ## 6. Sealed sender
@@ -84,6 +84,8 @@ holds each member to a production construction site.
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
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. |
87
+ | `SEND_ACCEPTANCE_UNKNOWN` | The posting deadline of a direct or group send ended, and the Relay acceptance of a device is not known. The SDK throws `SendAcceptanceUnknownError` from `@open-e2ee/signal-protocol-sdk/types`. The message might have arrived. | Tell the user that the message might already have arrived. Do not replay the send. |
88
+ | `SEND_NEVER_ACCEPTED` | The posting deadline of a direct or group send ended, the call raised no refusal (a thrown refusal or a refusal in the receipt of a shared body), and no refused device has a stored refusal code. The SDK throws `SendNeverAcceptedByRelayError` from `@open-e2ee/signal-protocol-sdk/types`. | Tell the user which devices did not get the message. |
87
89
  | `MESSAGE_DUPLICATE` | The session processed this message before. | Discard the duplicate. |
88
90
  | `TOO_MANY_SKIPPED_MESSAGES` | The message exceeded the skipped-key bound. | Reset the affected session. |
89
91
  | `REPLAY_DETECTED` | Envelope and encrypted-content timestamps differ. | Reject the message as a replay. |
@@ -154,12 +156,31 @@ holds each member to a production construction site.
154
156
  ## Relay Protocol Errors
155
157
 
156
158
  The Relay serves a set of Relay protocol versions. This SDK speaks
157
- protocol version 1. Two errors come from that set. Neither is an `EncryptionError`.
159
+ protocol version 2. It does not fall back to version 1. Two errors come from
160
+ that set. Neither is an `EncryptionError`.
158
161
 
159
162
  | Error | Cause | Application response |
160
163
  |---|---|---|
161
- | `HostedRelayUpgradeRequiredError` | The Relay no longer serves version 1. `code` is `UPGRADE_REQUIRED`, `status` is the HTTP status (426), and `retryable` is false. | Ship a newer SDK. The same request fails again, so do not retry it. |
162
- | `PROTOCOL_UNSUPPORTED` | The Relay does not serve version 1. The request fails with status 400, the `code` `PROTOCOL_UNSUPPORTED`, and `retryable` true. | Retry later. The Relay never rolls back below a version that a published SDK sends, so this is a transient fault, not a planned state. |
164
+ | `HostedRelayUpgradeRequiredError` | The Relay no longer serves the version that the client sent. The message names that version. `code` is `UPGRADE_REQUIRED`, `status` is the HTTP status (426), and `retryable` is false. | Ship a newer SDK. The same request fails again, so do not retry it. |
165
+ | `PROTOCOL_UNSUPPORTED` | The Relay does not serve version 2. The request fails with status 400, the `code` `PROTOCOL_UNSUPPORTED`, and `retryable` true. A send keeps the device open until its posting deadline. | Retry later. The Relay never rolls back below a version that a published SDK sends, so this is a transient fault, not a planned state. |
166
+
167
+ Version 2 adds one Relay code, `DELIVERY_ALREADY_ACCEPTED`. The Relay gives it
168
+ with HTTP status 409, `retryable` false and the `details` reason
169
+ `message-id-held`, when it already holds an accepted post under the message
170
+ ID of the post. The Relay stored nothing for this post.
171
+ A Relay gives `RETRY_CONFLICT` for the same case to a version 1 request. The
172
+ SDK reads the two answers in the same way:
173
+
174
+ - A direct post, a sealed direct post, a pre-message and a group shared body
175
+ count the answer as an earlier acceptance, under the rules of
176
+ `RETRY_CONFLICT`. A device whose session the SDK replaced stays unknown.
177
+ The answer has no receipt.
178
+ - A retry request that gets `DELIVERY_ALREADY_ACCEPTED` from a version 2
179
+ Relay reads it as the acceptance of its stored attempt, as it reads
180
+ `RETRY_CONFLICT`. No replacement attempt posts.
181
+
182
+ A send error can carry the code `DELIVERY_ALREADY_ACCEPTED` when the SDK
183
+ cannot count the answer as an acceptance. Handle it as `RETRY_CONFLICT`.
163
184
 
164
185
  The SDK does not retry an HTTP request that `UPGRADE_REQUIRED` refuses. Each
165
186
  Relay route that answers with a JSON body throws
@@ -297,14 +318,118 @@ restart post with `OPERATION_EXPIRED`, the send throws
297
318
  | `acceptedDevices` | The devices that the Relay accepted. They stay accepted |
298
319
  | `unresolvedDevices` | The devices that did not get the message |
299
320
  | `clientMessageId` | The ID of the send |
321
+ | `outcome` | `failed` or `acceptance-unknown`. With `acceptance-unknown`, the message might have arrived. Treat it like `SendAcceptanceUnknownError` |
322
+
323
+ After a recipient-phase end, the outbox keeps the send as terminal with its
324
+ `outcome`, and the SDK does not post it again. A replay with the same
325
+ `clientMessageId` throws the stored-end class of its outcome,
326
+ `SendAcceptanceUnknownError` or the failed-end error below, and posts
327
+ nothing. `expired` gives `acceptance-unknown`, because the Relay can have
328
+ accepted an earlier post. A sync-phase end has no `outcome`. The send keeps
329
+ its result with `syncPending`, and a later `send()` with the same
330
+ `clientMessageId` posts the sync phase again.
331
+
332
+ A direct or group send has a posting deadline, `deadlineAt`. It is the earlier of 24
333
+ hours after the SDK first stores the send and 24 hours after its timestamp. A
334
+ replay or a restart never moves it. At or after `deadlineAt`, the SDK starts
335
+ no Relay request for the send. A request that started before it still counts
336
+ when its answer arrives later. Before `deadlineAt`, a send error that leaves a
337
+ device open has `retryable: true`, and `relayRetryable` keeps the hint of the
338
+ Relay. With a store that implements `listMetadataKeys`, as every built-in
339
+ store does, the SDK replays the send at start and on reconnect until
340
+ `deadlineAt`. It reports the end once through `onSendOutcome`. An internal
341
+ send of the SDK, such as a sender key distribution, never reaches
342
+ `onSendOutcome`. The SDK keeps no content of a sender key distribution at
343
+ rest, so it does not replay one. With the listing method, it ends an open
344
+ distribution at its deadline and reports nothing, and a retry request of the
345
+ receiver recovers a lost distribution, as in Signal. An open sender key
346
+ distribution that an earlier SDK version stored carries no marker, so the SDK
347
+ reports `content-required` for it once for each client run before its
348
+ deadline, and reports its end through `onSendOutcome` once, at its deadline.
349
+ With a custom store that does not implement `listMetadataKeys`, replay with
350
+ the same `clientMessageId` before `deadlineAt`. A call of `send()` with the same `clientMessageId` before
351
+ `deadlineAt` is always safe. A replay posts only devices that the Relay did
352
+ not accept. The send also ends before
353
+ `deadlineAt` when each open device got `OPERATION_EXPIRED` as the last answer
354
+ in the call or has a stored refusal that the SDK cannot recover. That early
355
+ end has `retryable: false` and follows the rule below. A Relay answer
356
+ `UPGRADE_REQUIRED` or `DEVICE_REVOKED` ends the send at once by the same
357
+ rule: with no device of unknown acceptance, the answer is the error of the
358
+ failed end. When another device of the call has an unknown acceptance, the
359
+ send ends as acceptance-unknown instead, because that device can hold the
360
+ post. When the deadline
361
+ ends, the send throws `SendAcceptanceUnknownError` or the failed-end error of
362
+ the rule below. The two deadline classes come from
363
+ `@open-e2ee/signal-protocol-sdk/types`:
300
364
 
301
- The outbox keeps the send as terminal and does not post it again. A call of
302
- `send()` with the same `clientMessageId` starts a new run at 0 restarts.
365
+ | Error | Cause | Application response |
366
+ |---|---|---|
367
+ | `SendAcceptanceUnknownError` | The Relay acceptance of a device is not known. An answer was lost, or it followed an uncertain request | Tell the user that the message might already have arrived. Do not replay the send |
368
+ | `SendNeverAcceptedByRelayError` | The Relay accepted no request for an open device, the call raised no refusal, and no refused device has a stored refusal code. No request started before the deadline, or each answer was a refusal for now, such as `QUOTA_EXCEEDED` | Tell the user which devices did not get the message |
369
+
370
+ When no device has an unknown acceptance, the send ends failed, and one rule
371
+ gives its error:
372
+
373
+ 1. When the call that ends the send raised a refusal, the first such refusal
374
+ is the error. A raised refusal is a thrown refusal or a refusal in the
375
+ receipt of a shared body. A thrown refusal keeps its class. A refusal in a
376
+ receipt is an `Error` with the `code` of that refusal.
377
+ 2. Otherwise, the error is an `Error` with the stored `code` of the first
378
+ refused device that has one, in the order of the destinations.
379
+ 3. Otherwise, the error is `SendNeverAcceptedByRelayError` with code
380
+ `SEND_NEVER_ACCEPTED`.
381
+
382
+ A replay of the ended send raises no refusal, so its error comes from case 2
383
+ or case 3. Each of these errors has `deadlineAt`, `acceptedDevices`,
384
+ `refusedDevices` and `retryable: false`. A replay of the ended send posts
385
+ nothing.
386
+
387
+ A replay or a resend after `SendAcceptanceUnknownError` can add one charged
388
+ unit within 24 hours, when the Relay no longer holds its record of the first
389
+ acceptance. The SDK does not promise that such a retry has no cost.
390
+
391
+ To post an ended send again, call `resendMessage(clientMessageId)`. The
392
+ resend keeps the `clientMessageId`, the timestamp and the content of the
393
+ send. It encrypts the content again for each recipient device that the
394
+ Relay did not accept, and posts each copy under the message ID
395
+ `<clientMessageId>:manual:N`, N from 1. A resend of a group send posts the
396
+ content of its send log entry, so each copy carries the group context of the
397
+ original send, not the current one. It is a new Relay operation, so the
398
+ Relay can charge a resend as a new message. It has its own posting deadline,
399
+ 24 hours after the call, and its end has the same classes as the end of a
400
+ send. `onSendOutcome` reports the end of a resend once, with `manualResend`
401
+ set to N. Only a send younger than 30 days takes a new resend. At or after
402
+ 30 days from the send, `resendMessage` throws `Only a send younger than 30
403
+ days takes a manual resend` and posts nothing. An open resend of an older
404
+ send still posts until its own deadline.
405
+
406
+ The receive queue of a recipient device drops a copy whose sender device,
407
+ timestamp and content match a message that it already processed, for 60
408
+ days. Two different messages of one sender device with the same timestamp
409
+ both deliver. This rule holds in SDK 13.x and ends in the next major SDK
410
+ version, which drops a later message of the same sender with the same
411
+ timestamp. The drop needs the timestamp that the content adapter reads
412
+ from the message. Content with no timestamp, such as raw string or byte
413
+ content, takes no drop key, and a recipient that holds it receives the copy
414
+ again. The recipient records the message with the completion of its
415
+ receive record. When a delivery receipt is due, it records the message right
416
+ after the receipt-due write and again with the completion of the receipt.
417
+ When no receipt is owed, a stop before the completion of the receive record
418
+ runs `onMessageDecrypted` again. When a receipt is owed, only a stop before
419
+ the receipt-due write runs it again. The caller-origin receive path gives
420
+ every decrypted message to the caller, and a caller that keeps its own
421
+ records removes a copy itself. A recipient device on an SDK
422
+ version without that check can show the message twice.
303
423
 
304
424
  The sync phase does not fail the send. The recipient result is stored first.
305
425
  When the sync phase does not complete, or the own device list cannot be read,
306
426
  the result carries `syncPending: true`. Call `send()` again with the same
307
- `clientMessageId` to post the pending copies.
427
+ `clientMessageId` before `deadlineAt` to post the pending copies. At or after
428
+ `deadlineAt`, a replay posts nothing. It returns the stored result with
429
+ `syncPending`, with one exception. When the send has no sync messages, the
430
+ replay reads the own device list again. If that read finds no other own
431
+ device, the replay completes the send and returns the result without
432
+ `syncPending`.
308
433
 
309
434
  The Relay marks each accepted declared post with `deviceSetChecked`. When an
310
435
  accepted post has no mark, the Relay did not compare its device set. The send
@@ -314,7 +439,9 @@ is delivered and its result does not change. The client reports a
314
439
  hook. Its `route` names the post route. A sync copy to another own device is
315
440
  an `identified-direct` post. A sync payload of a method such as
316
441
  `syncReadToLinkedDevices` reports the error once, with no `clientMessageId`.
317
- Report it to the Relay operator.
442
+ Report it to the Relay operator. A device that the SDK counts as accepted from
443
+ a `RETRY_CONFLICT` or `DELIVERY_ALREADY_ACCEPTED` answer has no receipt, so
444
+ the SDK reports no `DEVICE_SET_UNCHECKED` error for it.
318
445
 
319
446
  A relay that does not compare device sets gets no declaration. The Convex
320
447
  relay is one. With it, the SDK reads the device lists as before, and none of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-e2ee/signal-protocol-sdk",
3
- "version": "13.4.0",
3
+ "version": "13.5.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",