@open-e2ee/signal-protocol-sdk 11.0.0 → 12.0.1
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.
- package/ADAPTERS.md +4 -4
- package/ARCHITECTURE.md +6 -8
- package/CHANGELOG.md +1348 -0
- package/README.md +1 -1
- package/SECURITY.md +2 -2
- package/TROUBLESHOOTING.md +8 -8
- package/client/README.md +70 -37
- package/device/README.md +39 -85
- package/dist/client/client.d.ts +334 -63
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +1175 -186
- package/dist/client/client.js.map +1 -1
- package/dist/client/config.d.ts +57 -42
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/config.js +1 -1
- package/dist/client/config.js.map +1 -1
- package/dist/client/constants.d.ts +42 -8
- package/dist/client/constants.d.ts.map +1 -1
- package/dist/client/constants.js +48 -3
- package/dist/client/constants.js.map +1 -1
- package/dist/client/content-adapter.d.ts +80 -0
- package/dist/client/content-adapter.d.ts.map +1 -1
- package/dist/client/content-adapter.js +225 -12
- package/dist/client/content-adapter.js.map +1 -1
- package/dist/client/delivery-error.d.ts +150 -0
- package/dist/client/delivery-error.d.ts.map +1 -0
- package/dist/client/delivery-error.js +226 -0
- package/dist/client/delivery-error.js.map +1 -0
- package/dist/client/delivery-status.d.ts +32 -6
- package/dist/client/delivery-status.d.ts.map +1 -1
- package/dist/client/delivery-status.js +61 -13
- package/dist/client/delivery-status.js.map +1 -1
- package/dist/client/device-set-reconciliation.d.ts +196 -0
- package/dist/client/device-set-reconciliation.d.ts.map +1 -0
- package/dist/client/device-set-reconciliation.js +282 -0
- package/dist/client/device-set-reconciliation.js.map +1 -0
- package/dist/client/distribution-records.d.ts +29 -0
- package/dist/client/distribution-records.d.ts.map +1 -0
- package/dist/client/distribution-records.js +33 -0
- package/dist/client/distribution-records.js.map +1 -0
- package/dist/client/event-hooks.d.ts +280 -14
- package/dist/client/event-hooks.d.ts.map +1 -1
- package/dist/client/event-hooks.js +8 -0
- package/dist/client/event-hooks.js.map +1 -1
- package/dist/client/group-device-set.d.ts +47 -0
- package/dist/client/group-device-set.d.ts.map +1 -0
- package/dist/client/group-device-set.js +65 -0
- package/dist/client/group-device-set.js.map +1 -0
- package/dist/client/group-fetcher.d.ts +116 -0
- package/dist/client/group-fetcher.d.ts.map +1 -0
- package/dist/client/group-fetcher.js +598 -0
- package/dist/client/group-fetcher.js.map +1 -0
- package/dist/client/group-outbox.d.ts +172 -10
- package/dist/client/group-outbox.d.ts.map +1 -1
- package/dist/client/group-outbox.js +915 -74
- package/dist/client/group-outbox.js.map +1 -1
- package/dist/client/group-receive-authorization.d.ts +127 -4
- package/dist/client/group-receive-authorization.d.ts.map +1 -1
- package/dist/client/group-receive-authorization.js +270 -20
- package/dist/client/group-receive-authorization.js.map +1 -1
- package/dist/client/group-sealed-sender.d.ts +3 -0
- package/dist/client/group-sealed-sender.d.ts.map +1 -1
- package/dist/client/group-sealed-sender.js +1 -0
- package/dist/client/group-sealed-sender.js.map +1 -1
- package/dist/client/group-sender-key-operations.d.ts +14 -3
- package/dist/client/group-sender-key-operations.d.ts.map +1 -1
- package/dist/client/group-sender-key-operations.js +26 -5
- package/dist/client/group-sender-key-operations.js.map +1 -1
- package/dist/client/groups.d.ts +5 -5
- package/dist/client/groups.d.ts.map +1 -1
- package/dist/client/groups.js +5 -4
- package/dist/client/groups.js.map +1 -1
- package/dist/client/hosted-anonymous-delivery.d.ts +61 -9
- package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
- package/dist/client/hosted-anonymous-delivery.js +242 -48
- package/dist/client/hosted-anonymous-delivery.js.map +1 -1
- package/dist/client/hosted-assertion-id.d.ts +7 -0
- package/dist/client/hosted-assertion-id.d.ts.map +1 -0
- package/dist/client/hosted-assertion-id.js +51 -0
- package/dist/client/hosted-assertion-id.js.map +1 -0
- package/dist/client/hosted-mailbox-subscription.d.ts +34 -2
- package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
- package/dist/client/hosted-mailbox-subscription.js +87 -17
- package/dist/client/hosted-mailbox-subscription.js.map +1 -1
- package/dist/client/hosted-push.d.ts +22 -4
- package/dist/client/hosted-push.d.ts.map +1 -1
- package/dist/client/hosted-push.js +75 -22
- package/dist/client/hosted-push.js.map +1 -1
- package/dist/client/hosted-transport.d.ts +22 -28
- package/dist/client/hosted-transport.d.ts.map +1 -1
- package/dist/client/hosted-transport.js +115 -55
- package/dist/client/hosted-transport.js.map +1 -1
- package/dist/client/hosted.d.ts +10 -4
- package/dist/client/hosted.d.ts.map +1 -1
- package/dist/client/hosted.js +10 -4
- package/dist/client/hosted.js.map +1 -1
- package/dist/client/index.d.ts +5 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/messages.d.ts +25 -3
- package/dist/client/messages.d.ts.map +1 -1
- package/dist/client/messages.js +111 -20
- package/dist/client/messages.js.map +1 -1
- package/dist/client/receive-admission.d.ts +58 -0
- package/dist/client/receive-admission.d.ts.map +1 -0
- package/dist/client/receive-admission.js +78 -0
- package/dist/client/receive-admission.js.map +1 -0
- package/dist/client/receive-expiry.d.ts +31 -0
- package/dist/client/receive-expiry.d.ts.map +1 -0
- package/dist/client/receive-expiry.js +35 -0
- package/dist/client/receive-expiry.js.map +1 -0
- package/dist/client/receive-hook-bound.d.ts +50 -0
- package/dist/client/receive-hook-bound.d.ts.map +1 -0
- package/dist/client/receive-hook-bound.js +115 -0
- package/dist/client/receive-hook-bound.js.map +1 -0
- package/dist/client/receive-queue.d.ts +299 -0
- package/dist/client/receive-queue.d.ts.map +1 -0
- package/dist/client/receive-queue.js +1420 -0
- package/dist/client/receive-queue.js.map +1 -0
- package/dist/client/receive-work-seed.d.ts +54 -0
- package/dist/client/receive-work-seed.d.ts.map +1 -0
- package/dist/client/receive-work-seed.js +116 -0
- package/dist/client/receive-work-seed.js.map +1 -0
- package/dist/client/recovery-driver.d.ts +25 -0
- package/dist/client/recovery-driver.d.ts.map +1 -0
- package/dist/client/recovery-driver.js +121 -0
- package/dist/client/recovery-driver.js.map +1 -0
- package/dist/client/relay-acceptance.d.ts +20 -7
- package/dist/client/relay-acceptance.d.ts.map +1 -1
- package/dist/client/relay-acceptance.js +30 -12
- package/dist/client/relay-acceptance.js.map +1 -1
- package/dist/client/relay-device-refusal.d.ts +18 -0
- package/dist/client/relay-device-refusal.d.ts.map +1 -1
- package/dist/client/relay-device-refusal.js +31 -0
- package/dist/client/relay-device-refusal.js.map +1 -1
- package/dist/client/relay-sealed-route.d.ts +36 -0
- package/dist/client/relay-sealed-route.d.ts.map +1 -0
- package/dist/client/relay-sealed-route.js +45 -0
- package/dist/client/relay-sealed-route.js.map +1 -0
- package/dist/client/relay-subscription.d.ts +56 -13
- package/dist/client/relay-subscription.d.ts.map +1 -1
- package/dist/client/relay-subscription.js +193 -123
- package/dist/client/relay-subscription.js.map +1 -1
- package/dist/client/resendable-content.d.ts +98 -0
- package/dist/client/resendable-content.d.ts.map +1 -0
- package/dist/client/resendable-content.js +136 -0
- package/dist/client/resendable-content.js.map +1 -0
- package/dist/client/retry-family.d.ts +57 -10
- package/dist/client/retry-family.d.ts.map +1 -1
- package/dist/client/retry-family.js +54 -12
- package/dist/client/retry-family.js.map +1 -1
- package/dist/client/retry-request-envelope.d.ts +107 -8
- package/dist/client/retry-request-envelope.d.ts.map +1 -1
- package/dist/client/retry-request-envelope.js +172 -23
- package/dist/client/retry-request-envelope.js.map +1 -1
- package/dist/client/retry-request-lifecycle.d.ts +70 -14
- package/dist/client/retry-request-lifecycle.d.ts.map +1 -1
- package/dist/client/retry-request-lifecycle.js +162 -32
- package/dist/client/retry-request-lifecycle.js.map +1 -1
- package/dist/client/retry-terminal-recovery.d.ts +100 -0
- package/dist/client/retry-terminal-recovery.d.ts.map +1 -0
- package/dist/client/retry-terminal-recovery.js +164 -0
- package/dist/client/retry-terminal-recovery.js.map +1 -0
- package/dist/client/retry-utils.d.ts +27 -0
- package/dist/client/retry-utils.d.ts.map +1 -1
- package/dist/client/retry-utils.js +46 -0
- package/dist/client/retry-utils.js.map +1 -1
- package/dist/client/retry.d.ts +100 -12
- package/dist/client/retry.d.ts.map +1 -1
- package/dist/client/retry.js +619 -116
- package/dist/client/retry.js.map +1 -1
- package/dist/client/sealed-sender.d.ts +23 -6
- package/dist/client/sealed-sender.d.ts.map +1 -1
- package/dist/client/sealed-sender.js +30 -6
- package/dist/client/sealed-sender.js.map +1 -1
- package/dist/client/sessions.d.ts +2 -2
- package/dist/client/sessions.js +2 -2
- package/dist/client/signal-service-cipher.d.ts +726 -19
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +2260 -342
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/state.d.ts +5 -0
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/state.js +11 -1
- package/dist/client/state.js.map +1 -1
- package/dist/client/storage-protection.d.ts +64 -0
- package/dist/client/storage-protection.d.ts.map +1 -0
- package/dist/client/storage-protection.js +150 -0
- package/dist/client/storage-protection.js.map +1 -0
- package/dist/client/types.d.ts +149 -15
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js +1 -1
- package/dist/client/types.js.map +1 -1
- package/dist/device/constants.d.ts +0 -5
- package/dist/device/constants.d.ts.map +1 -1
- package/dist/device/constants.js +0 -5
- package/dist/device/constants.js.map +1 -1
- package/dist/device/expo/index.d.ts +4 -17
- package/dist/device/expo/index.d.ts.map +1 -1
- package/dist/device/expo/index.js +4 -23
- package/dist/device/expo/index.js.map +1 -1
- package/dist/device/index.d.ts +0 -2
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/index.js +0 -7
- package/dist/device/index.js.map +1 -1
- package/dist/device/lifecycle/manager.d.ts +5 -4
- package/dist/device/lifecycle/manager.d.ts.map +1 -1
- package/dist/device/lifecycle/manager.js +16 -16
- package/dist/device/lifecycle/manager.js.map +1 -1
- package/dist/device/lifecycle/types.d.ts +2 -2
- package/dist/device/lifecycle/types.d.ts.map +1 -1
- package/dist/device/react-native/index.d.ts +4 -15
- package/dist/device/react-native/index.d.ts.map +1 -1
- package/dist/device/react-native/index.js +4 -21
- package/dist/device/react-native/index.js.map +1 -1
- package/dist/device/types.d.ts +1 -1
- package/dist/groups/index.d.ts +1 -1
- package/dist/groups/index.d.ts.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.d.ts +0 -1
- package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.js +0 -1
- package/dist/internal/crypto/ec/x25519-validation.js.map +1 -1
- package/dist/internal/crypto/validation.d.ts +2 -2
- package/dist/internal/groups/index.d.ts +1 -0
- package/dist/internal/groups/index.d.ts.map +1 -1
- package/dist/internal/groups/index.js +1 -0
- package/dist/internal/groups/index.js.map +1 -1
- package/dist/internal/groups/manager.d.ts +37 -16
- package/dist/internal/groups/manager.d.ts.map +1 -1
- package/dist/internal/groups/manager.js +46 -1
- package/dist/internal/groups/manager.js.map +1 -1
- package/dist/internal/groups/receive-record.d.ts +78 -0
- package/dist/internal/groups/receive-record.d.ts.map +1 -0
- package/dist/internal/groups/receive-record.js +43 -0
- package/dist/internal/groups/receive-record.js.map +1 -0
- package/dist/internal/groups/sdk-store.d.ts +27 -3
- package/dist/internal/groups/sdk-store.d.ts.map +1 -1
- package/dist/internal/groups/sdk-store.js +151 -19
- package/dist/internal/groups/sdk-store.js.map +1 -1
- package/dist/internal/groups/wire.d.ts +12 -1
- package/dist/internal/groups/wire.d.ts.map +1 -1
- package/dist/internal/groups/wire.js +36 -0
- package/dist/internal/groups/wire.js.map +1 -1
- package/dist/internal/manager/index.d.ts +1 -1
- package/dist/internal/manager/manager.d.ts +26 -20
- package/dist/internal/manager/manager.d.ts.map +1 -1
- package/dist/internal/manager/manager.js +64 -41
- package/dist/internal/manager/manager.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.d.ts +4 -18
- package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.js +23 -74
- package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/index.d.ts +1 -1
- package/dist/internal/protocol/double-ratchet/index.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/index.js +1 -1
- package/dist/internal/protocol/double-ratchet/index.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts +5 -7
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.js +4 -6
- package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.js +2 -1
- package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.d.ts +6 -8
- package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.js +8 -9
- package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
- package/dist/internal/protocol/sender-keys/handoff-ledger.d.ts +110 -0
- package/dist/internal/protocol/sender-keys/handoff-ledger.d.ts.map +1 -0
- package/dist/internal/protocol/sender-keys/handoff-ledger.js +124 -0
- package/dist/internal/protocol/sender-keys/handoff-ledger.js.map +1 -0
- package/dist/internal/protocol/sender-keys/manager.d.ts +71 -62
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.js +228 -175
- package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
- package/dist/internal/protocol/spqr/index.d.ts +2 -2
- package/dist/internal/protocol/spqr/index.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/index.js +2 -2
- package/dist/internal/protocol/spqr/index.js.map +1 -1
- package/dist/internal/protocol/spqr/serialize.d.ts +9 -1
- package/dist/internal/protocol/spqr/serialize.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/serialize.js +56 -16
- package/dist/internal/protocol/spqr/serialize.js.map +1 -1
- package/dist/internal/protocol/spqr/spqr.d.ts +1 -14
- package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/spqr.js +54 -42
- package/dist/internal/protocol/spqr/spqr.js.map +1 -1
- package/dist/internal/protocol/spqr/validate.d.ts +26 -6
- package/dist/internal/protocol/spqr/validate.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/validate.js +49 -21
- package/dist/internal/protocol/spqr/validate.js.map +1 -1
- package/dist/internal/sesame/index.d.ts +1 -1
- package/dist/internal/sesame/index.d.ts.map +1 -1
- package/dist/internal/sesame/index.js.map +1 -1
- package/dist/internal/sesame/manager.d.ts +66 -13
- package/dist/internal/sesame/manager.d.ts.map +1 -1
- package/dist/internal/sesame/manager.js +221 -87
- package/dist/internal/sesame/manager.js.map +1 -1
- package/dist/internal/sesame/types.d.ts +95 -17
- package/dist/internal/sesame/types.d.ts.map +1 -1
- package/dist/internal/sesame/types.js +17 -0
- package/dist/internal/sesame/types.js.map +1 -1
- package/dist/internal/session/builder.d.ts +5 -5
- package/dist/internal/session/builder.d.ts.map +1 -1
- package/dist/internal/session/builder.js +12 -17
- package/dist/internal/session/builder.js.map +1 -1
- package/dist/internal/session/cipher.d.ts +15 -13
- package/dist/internal/session/cipher.d.ts.map +1 -1
- package/dist/internal/session/cipher.js +41 -23
- package/dist/internal/session/cipher.js.map +1 -1
- package/dist/internal/session/factory.d.ts +5 -5
- package/dist/internal/session/factory.d.ts.map +1 -1
- package/dist/internal/session/factory.js +4 -4
- package/dist/internal/session/factory.js.map +1 -1
- package/dist/internal/session/handshake.d.ts +14 -16
- package/dist/internal/session/handshake.d.ts.map +1 -1
- package/dist/internal/session/handshake.js +18 -75
- package/dist/internal/session/handshake.js.map +1 -1
- package/dist/internal/session/index.d.ts +1 -1
- package/dist/internal/session/index.js +1 -1
- package/dist/internal/session/record-locks.d.ts +17 -6
- package/dist/internal/session/record-locks.d.ts.map +1 -1
- package/dist/internal/session/record-locks.js +43 -7
- package/dist/internal/session/record-locks.js.map +1 -1
- package/dist/internal/session/session-resolver.d.ts +1 -1
- package/dist/internal/session/session-resolver.js +1 -1
- package/dist/internal/session/state.d.ts +2 -2
- package/dist/internal/session/state.js +1 -1
- package/dist/internal/session/types.d.ts +5 -13
- package/dist/internal/session/types.d.ts.map +1 -1
- package/dist/internal/session/types.js +1 -1
- package/dist/keys/generation.d.ts +2 -2
- package/dist/keys/generation.js +2 -2
- package/dist/keys/types.d.ts +5 -5
- package/dist/keys/types.d.ts.map +1 -1
- package/dist/keys/types.js +1 -1
- package/dist/layers.d.ts +1 -1
- package/dist/layers.js +2 -2
- package/dist/layers.js.map +1 -1
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +12 -8
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/key-value/adapter.d.ts +76 -10
- package/dist/local/store/key-value/adapter.d.ts.map +1 -1
- package/dist/local/store/key-value/adapter.js +367 -61
- package/dist/local/store/key-value/adapter.js.map +1 -1
- package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -1
- package/dist/local/store/key-value/backend-conformance.js +74 -0
- package/dist/local/store/key-value/backend-conformance.js.map +1 -1
- package/dist/local/store/key-value/batch.d.ts +2 -0
- package/dist/local/store/key-value/batch.d.ts.map +1 -1
- package/dist/local/store/key-value/batch.js +26 -0
- package/dist/local/store/key-value/batch.js.map +1 -1
- package/dist/local/store/key-value/receive-work.d.ts +55 -0
- package/dist/local/store/key-value/receive-work.d.ts.map +1 -0
- package/dist/local/store/key-value/receive-work.js +162 -0
- package/dist/local/store/key-value/receive-work.js.map +1 -0
- package/dist/local/store/key-value/send-log.d.ts +61 -0
- package/dist/local/store/key-value/send-log.d.ts.map +1 -0
- package/dist/local/store/key-value/send-log.js +430 -0
- package/dist/local/store/key-value/send-log.js.map +1 -0
- package/dist/local/store/key-value/sender-key-handoff.d.ts +68 -0
- package/dist/local/store/key-value/sender-key-handoff.d.ts.map +1 -0
- package/dist/local/store/key-value/sender-key-handoff.js +189 -0
- package/dist/local/store/key-value/sender-key-handoff.js.map +1 -0
- package/dist/local/store/key-value/storage.d.ts +15 -0
- package/dist/local/store/key-value/storage.d.ts.map +1 -1
- package/dist/local/store/keyed-index.d.ts +23 -0
- package/dist/local/store/keyed-index.d.ts.map +1 -0
- package/dist/local/store/keyed-index.js +41 -0
- package/dist/local/store/keyed-index.js.map +1 -0
- package/dist/local/store/memory/adapter.d.ts +44 -12
- package/dist/local/store/memory/adapter.d.ts.map +1 -1
- package/dist/local/store/memory/adapter.js +197 -46
- package/dist/local/store/memory/adapter.js.map +1 -1
- package/dist/local/store/memory/send-log.d.ts +42 -0
- package/dist/local/store/memory/send-log.d.ts.map +1 -0
- package/dist/local/store/memory/send-log.js +190 -0
- package/dist/local/store/memory/send-log.js.map +1 -0
- package/dist/local/store/node/adapter.d.ts.map +1 -1
- package/dist/local/store/node/adapter.js +8 -6
- package/dist/local/store/node/adapter.js.map +1 -1
- package/dist/local/store/react-native/adapter.d.ts.map +1 -1
- package/dist/local/store/react-native/adapter.js +12 -8
- package/dist/local/store/react-native/adapter.js.map +1 -1
- package/dist/local/store/receive-work.d.ts +87 -0
- package/dist/local/store/receive-work.d.ts.map +1 -0
- package/dist/local/store/receive-work.js +204 -0
- package/dist/local/store/receive-work.js.map +1 -0
- package/dist/local/store/received-content.d.ts +3 -3
- package/dist/local/store/received-content.d.ts.map +1 -1
- package/dist/local/store/received-content.js +2 -11
- package/dist/local/store/received-content.js.map +1 -1
- package/dist/local/store/reliability.d.ts +317 -18
- package/dist/local/store/reliability.d.ts.map +1 -1
- package/dist/local/store/reliability.js +371 -46
- package/dist/local/store/reliability.js.map +1 -1
- package/dist/local/store/send-log-order.d.ts +15 -0
- package/dist/local/store/send-log-order.d.ts.map +1 -0
- package/dist/local/store/send-log-order.js +24 -0
- package/dist/local/store/send-log-order.js.map +1 -0
- package/dist/local/store/sender-key-handoff-index.d.ts +38 -0
- package/dist/local/store/sender-key-handoff-index.d.ts.map +1 -0
- package/dist/local/store/sender-key-handoff-index.js +101 -0
- package/dist/local/store/sender-key-handoff-index.js.map +1 -0
- package/dist/local/store/sender-key-handoff-table.d.ts +29 -0
- package/dist/local/store/sender-key-handoff-table.d.ts.map +1 -0
- package/dist/local/store/sender-key-handoff-table.js +97 -0
- package/dist/local/store/sender-key-handoff-table.js.map +1 -0
- package/dist/local/store/sqlite/driver.d.ts +9 -0
- package/dist/local/store/sqlite/driver.d.ts.map +1 -1
- package/dist/local/store/sqlite/encryption.d.ts +8 -1
- package/dist/local/store/sqlite/encryption.d.ts.map +1 -1
- package/dist/local/store/sqlite/encryption.js +9 -0
- package/dist/local/store/sqlite/encryption.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/index.d.ts +25 -4
- package/dist/local/store/sqlite/key-storage/index.d.ts.map +1 -1
- package/dist/local/store/sqlite/key-storage/index.js +68 -7
- package/dist/local/store/sqlite/key-storage/index.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/message-records.d.ts +16 -4
- package/dist/local/store/sqlite/key-storage/message-records.d.ts.map +1 -1
- package/dist/local/store/sqlite/key-storage/message-records.js +49 -6
- package/dist/local/store/sqlite/key-storage/message-records.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/metadata.d.ts +8 -7
- package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -1
- package/dist/local/store/sqlite/key-storage/metadata.js +17 -15
- package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/receive-work.d.ts +27 -0
- package/dist/local/store/sqlite/key-storage/receive-work.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/receive-work.js +98 -0
- package/dist/local/store/sqlite/key-storage/receive-work.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/send-log.d.ts +27 -0
- package/dist/local/store/sqlite/key-storage/send-log.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/send-log.js +178 -0
- package/dist/local/store/sqlite/key-storage/send-log.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.d.ts +27 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.js +75 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/session-trust.d.ts +2 -2
- package/dist/local/store/sqlite/key-storage/session-trust.js +5 -5
- package/dist/local/store/sqlite/key-storage/session-trust.js.map +1 -1
- package/dist/local/store/sqlite/migrations.d.ts.map +1 -1
- package/dist/local/store/sqlite/migrations.js +101 -0
- package/dist/local/store/sqlite/migrations.js.map +1 -1
- package/dist/local/store/sqlite/models/index.d.ts +2 -1
- package/dist/local/store/sqlite/models/index.d.ts.map +1 -1
- package/dist/local/store/sqlite/models/index.js +5 -1
- package/dist/local/store/sqlite/models/index.js.map +1 -1
- package/dist/local/store/sqlite/models/message-record.d.ts +15 -0
- package/dist/local/store/sqlite/models/message-record.d.ts.map +1 -1
- package/dist/local/store/sqlite/models/message-record.js +24 -0
- package/dist/local/store/sqlite/models/message-record.js.map +1 -1
- package/dist/local/store/sqlite/models/send-log.d.ts +51 -0
- package/dist/local/store/sqlite/models/send-log.d.ts.map +1 -0
- package/dist/local/store/sqlite/models/send-log.js +206 -0
- package/dist/local/store/sqlite/models/send-log.js.map +1 -0
- package/dist/local/store/sqlite/open-store.d.ts +9 -1
- package/dist/local/store/sqlite/open-store.d.ts.map +1 -1
- package/dist/local/store/sqlite/open-store.js +20 -1
- package/dist/local/store/sqlite/open-store.js.map +1 -1
- package/dist/local/store/sqlite/schema.d.ts +34 -1
- package/dist/local/store/sqlite/schema.d.ts.map +1 -1
- package/dist/local/store/sqlite/schema.js +14 -0
- package/dist/local/store/sqlite/schema.js.map +1 -1
- package/dist/local/store/sqlite/store.d.ts +61 -11
- package/dist/local/store/sqlite/store.d.ts.map +1 -1
- package/dist/local/store/sqlite/store.js +191 -27
- package/dist/local/store/sqlite/store.js.map +1 -1
- package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.mjs +2 -1
- package/dist/local/store/sqlite/web/worker.d.ts +8 -0
- package/dist/local/store/sqlite/web/worker.d.ts.map +1 -1
- package/dist/local/store/sqlite/web/worker.js +64 -2
- package/dist/local/store/sqlite/web/worker.js.map +1 -1
- package/dist/local/store/web/adapter.d.ts +76 -8
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +579 -127
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/local/store/web/receive-work.d.ts +57 -0
- package/dist/local/store/web/receive-work.d.ts.map +1 -0
- package/dist/local/store/web/receive-work.js +99 -0
- package/dist/local/store/web/receive-work.js.map +1 -0
- package/dist/local/store/web/send-log.d.ts +92 -0
- package/dist/local/store/web/send-log.d.ts.map +1 -0
- package/dist/local/store/web/send-log.js +267 -0
- package/dist/local/store/web/send-log.js.map +1 -0
- package/dist/local/store/web/sender-key-handoff.d.ts +81 -0
- package/dist/local/store/web/sender-key-handoff.d.ts.map +1 -0
- package/dist/local/store/web/sender-key-handoff.js +156 -0
- package/dist/local/store/web/sender-key-handoff.js.map +1 -0
- package/dist/local/store/web-sqlite/adapter.d.ts +2 -0
- package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -1
- package/dist/local/store/web-sqlite/adapter.js +12 -6
- package/dist/local/store/web-sqlite/adapter.js.map +1 -1
- package/dist/local/vault/custody.d.ts +8 -0
- package/dist/local/vault/custody.d.ts.map +1 -0
- package/dist/local/vault/custody.js +9 -0
- package/dist/local/vault/custody.js.map +1 -0
- package/dist/local/vault/electron-safe-storage.d.ts +3 -1
- package/dist/local/vault/electron-safe-storage.d.ts.map +1 -1
- package/dist/local/vault/electron-safe-storage.js +2 -0
- package/dist/local/vault/electron-safe-storage.js.map +1 -1
- package/dist/local/vault/expo-secure-store.d.ts +3 -1
- package/dist/local/vault/expo-secure-store.d.ts.map +1 -1
- package/dist/local/vault/expo-secure-store.js +2 -0
- package/dist/local/vault/expo-secure-store.js.map +1 -1
- package/dist/local/vault/indexed-db.d.ts +3 -1
- package/dist/local/vault/indexed-db.d.ts.map +1 -1
- package/dist/local/vault/indexed-db.js +2 -0
- package/dist/local/vault/indexed-db.js.map +1 -1
- package/dist/local/vault/react-native-keychain.d.ts +3 -1
- package/dist/local/vault/react-native-keychain.d.ts.map +1 -1
- package/dist/local/vault/react-native-keychain.js +2 -0
- package/dist/local/vault/react-native-keychain.js.map +1 -1
- package/dist/remote/relay/device-set.d.ts +94 -0
- package/dist/remote/relay/device-set.d.ts.map +1 -0
- package/dist/remote/relay/device-set.js +156 -0
- package/dist/remote/relay/device-set.js.map +1 -0
- package/dist/remote/relay/types.d.ts +92 -107
- package/dist/remote/relay/types.d.ts.map +1 -1
- package/dist/safety/core.d.ts +15 -6
- package/dist/safety/core.d.ts.map +1 -1
- package/dist/safety/core.js +41 -27
- package/dist/safety/core.js.map +1 -1
- package/dist/safety/index.d.ts +2 -1
- package/dist/safety/index.d.ts.map +1 -1
- package/dist/safety/index.js +12 -18
- package/dist/safety/index.js.map +1 -1
- package/dist/types/api.d.ts +707 -62
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/errors.d.ts +14 -33
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +14 -24
- package/dist/types/errors.js.map +1 -1
- package/dist/types/messages.d.ts +2 -2
- package/dist/types/messages.js +1 -1
- package/dist/types/protocol-config.d.ts +175 -42
- package/dist/types/protocol-config.d.ts.map +1 -1
- package/dist/types/protocol-config.js +19 -38
- package/dist/types/protocol-config.js.map +1 -1
- package/dist/types/protocol-constants.d.ts +6 -6
- package/dist/types/protocol-constants.js +6 -6
- package/dist/types/session.d.ts +7 -7
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/session.js +39 -21
- package/dist/types/session.js.map +1 -1
- package/dist/username/link.d.ts +2 -2
- package/dist/username/link.js +2 -2
- package/dist/utils/origin-lock.d.ts +45 -0
- package/dist/utils/origin-lock.d.ts.map +1 -0
- package/dist/utils/origin-lock.js +80 -0
- package/dist/utils/origin-lock.js.map +1 -0
- package/docs/ASSURANCE.md +6 -6
- package/docs/CLIENT_COMPOSITION.md +2 -2
- package/docs/DEVIATIONS.md +677 -182
- package/docs/E2EE.md +1 -1
- package/docs/ERROR_HANDLING.md +165 -2
- package/docs/GETTING_STARTED.md +7 -4
- package/docs/INTERFACES.md +1 -1
- package/docs/PACKAGE_SURFACE.md +6 -5
- package/docs/PROTOCOL_POLICY.md +102 -22
- package/docs/RECIPES.md +3 -15
- package/docs/SECURITY.md +90 -5
- package/keys/README.md +3 -3
- package/local/store/README.md +78 -14
- package/local/store/key-value/README.md +14 -3
- package/local/store/node/README.md +8 -3
- package/local/store/web/README.md +9 -0
- package/local/store/web-sqlite/README.md +14 -2
- package/local/vault/README.md +21 -0
- package/package.json +1 -6
- package/remote/README.md +0 -1
- package/remote/relay/README.md +2 -2
- package/dist/device/provisioning.d.ts +0 -242
- package/dist/device/provisioning.d.ts.map +0 -1
- package/dist/device/provisioning.js +0 -421
- package/dist/device/provisioning.js.map +0 -1
- package/dist/internal/protocol/x3dh/index.d.ts +0 -15
- package/dist/internal/protocol/x3dh/index.d.ts.map +0 -1
- package/dist/internal/protocol/x3dh/index.js +0 -13
- package/dist/internal/protocol/x3dh/index.js.map +0 -1
- package/dist/internal/protocol/x3dh/x3dh.d.ts +0 -131
- package/dist/internal/protocol/x3dh/x3dh.d.ts.map +0 -1
- package/dist/internal/protocol/x3dh/x3dh.js +0 -261
- package/dist/internal/protocol/x3dh/x3dh.js.map +0 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resendable content and its retention.
|
|
3
|
+
*
|
|
4
|
+
* A sender keeps the plaintext of a resendable message to answer a retry
|
|
5
|
+
* request: each group send in the send log, and each pairwise message in a
|
|
6
|
+
* MessageRecord. The retention runs from the store clock when the store
|
|
7
|
+
* first wrote the content, and a retry never extends it. This module
|
|
8
|
+
* enforces the retention at each send log lookup and at each sweep. A sweep
|
|
9
|
+
* runs at client creation, at stop, and before the first resendable group
|
|
10
|
+
* send of each day.
|
|
11
|
+
*
|
|
12
|
+
* When content recovery is off, the client keeps no resendable content, and
|
|
13
|
+
* the start of each client clears the content that an earlier policy kept.
|
|
14
|
+
* A metadata marker records the clear, so a start with nothing kept since
|
|
15
|
+
* the last clear reads one value and scans nothing.
|
|
16
|
+
*
|
|
17
|
+
* An E2EE delivery receipt from a device deletes its row (see
|
|
18
|
+
* `DeliveryStatusTracker`). A Relay delivery receipt deletes nothing, because
|
|
19
|
+
* a device also acknowledges a copy that it could not decrypt.
|
|
20
|
+
*
|
|
21
|
+
* Deletion in an encrypted store is logical. The retention bounds the time
|
|
22
|
+
* that the client keeps the content. It does not promise erasure from the
|
|
23
|
+
* storage medium.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
const DAY_MS = 24 * 60 * 60 * 1_000;
|
|
28
|
+
/**
|
|
29
|
+
* The metadata key that records a clear of all resendable content. Its
|
|
30
|
+
* presence means the store kept no resendable content since that clear.
|
|
31
|
+
*/
|
|
32
|
+
export const RESENDABLE_CONTENT_CLEARED_MARKER = 'resendable-content:cleared';
|
|
33
|
+
export class ResendableContent {
|
|
34
|
+
store;
|
|
35
|
+
retentionMs;
|
|
36
|
+
now;
|
|
37
|
+
/** The day of the last sweep, in whole days since the epoch. */
|
|
38
|
+
sweptDay;
|
|
39
|
+
constructor(store,
|
|
40
|
+
/** The retention of the content, from `protocol.contentRecovery`. */
|
|
41
|
+
retentionMs, now = Date.now) {
|
|
42
|
+
this.store = store;
|
|
43
|
+
this.retentionMs = retentionMs;
|
|
44
|
+
this.now = now;
|
|
45
|
+
}
|
|
46
|
+
/** True when content that the store wrote at `createdAt` is past the retention. */
|
|
47
|
+
isExpired(createdAt) {
|
|
48
|
+
return this.now() - createdAt > this.retentionMs;
|
|
49
|
+
}
|
|
50
|
+
/** Delete each send log entry and each message record past the retention. */
|
|
51
|
+
async sweep() {
|
|
52
|
+
this.sweptDay = Math.floor(this.now() / DAY_MS);
|
|
53
|
+
const sendLogEntries = await this.store.deleteExpiredSendLog(this.retentionMs);
|
|
54
|
+
const messageRecords = await this.store.deleteExpiredMessageRecords(this.retentionMs);
|
|
55
|
+
return { sendLogEntries, messageRecords };
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Sweep when no sweep ran today. A long-running client that never stops
|
|
59
|
+
* still deletes expired content each day that it sends.
|
|
60
|
+
*/
|
|
61
|
+
async sweepDaily() {
|
|
62
|
+
return this.sweptDay === Math.floor(this.now() / DAY_MS) ? null : this.sweep();
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The logged entries that a retry request from one device names, after
|
|
66
|
+
* expired entries are deleted. The first message ID with a row for the
|
|
67
|
+
* device wins. With none, every entry of the device at the client
|
|
68
|
+
* timestamp answers, ordered by `clientMessageId`. Only the row of this
|
|
69
|
+
* exact device authorizes a resend.
|
|
70
|
+
*/
|
|
71
|
+
async lookup(device, clientMessageIds, clientTimestamp) {
|
|
72
|
+
await this.store.deleteExpiredSendLog(this.retentionMs);
|
|
73
|
+
for (const clientMessageId of clientMessageIds) {
|
|
74
|
+
if (clientMessageId === undefined)
|
|
75
|
+
continue;
|
|
76
|
+
const entry = await this.store.getSendLogEntry(clientMessageId, device);
|
|
77
|
+
if (entry)
|
|
78
|
+
return [entry];
|
|
79
|
+
}
|
|
80
|
+
return this.store.findSendLogEntries(device, clientTimestamp);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The logged entry of one send and the row of one device, after expired
|
|
84
|
+
* entries are deleted, or null when the device has no row.
|
|
85
|
+
*/
|
|
86
|
+
async entry(clientMessageId, device) {
|
|
87
|
+
await this.store.deleteExpiredSendLog(this.retentionMs);
|
|
88
|
+
return this.store.getSendLogEntry(clientMessageId, device);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Count one resend of a logged send to one device. The count survives a
|
|
92
|
+
* restart. Returns the new count, or null when the device has no row.
|
|
93
|
+
*/
|
|
94
|
+
async countResend(clientMessageId, device) {
|
|
95
|
+
return this.store.incrementSendLogResendCount(clientMessageId, device);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The devices that have not confirmed a logged send with an E2EE delivery
|
|
99
|
+
* receipt, after expired entries are deleted.
|
|
100
|
+
*/
|
|
101
|
+
async pendingRecipients(clientMessageId) {
|
|
102
|
+
await this.store.deleteExpiredSendLog(this.retentionMs);
|
|
103
|
+
return (await this.store.getSendLogRecipients(clientMessageId)).map(({ userId, deviceId }) => ({
|
|
104
|
+
userId,
|
|
105
|
+
deviceId,
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Delete all resendable content, for a client with content recovery off.
|
|
110
|
+
* The clear is skipped when the store kept no content since the last
|
|
111
|
+
* clear. The marker is written only after the clear succeeds, and a
|
|
112
|
+
* failure propagates.
|
|
113
|
+
*
|
|
114
|
+
* @returns The deleted entries and records, or null for a skipped clear
|
|
115
|
+
*/
|
|
116
|
+
async clear() {
|
|
117
|
+
if ((await this.store.getMetadata(RESENDABLE_CONTENT_CLEARED_MARKER)) !== null)
|
|
118
|
+
return null;
|
|
119
|
+
const messageRecords = await this.store.clearAllMessageRecords();
|
|
120
|
+
const sendLogEntries = await this.store.clearSendLog();
|
|
121
|
+
await this.store.setMetadata(RESENDABLE_CONTENT_CLEARED_MARKER, String(this.now()));
|
|
122
|
+
return { sendLogEntries, messageRecords };
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Record that the client can keep resendable content, so the next clear
|
|
126
|
+
* runs. Call it before the client writes any content.
|
|
127
|
+
*/
|
|
128
|
+
async keepContent() {
|
|
129
|
+
await this.store.deleteMetadata(RESENDABLE_CONTENT_CLEARED_MARKER);
|
|
130
|
+
}
|
|
131
|
+
/** Delete the logged content of one send and its rows. */
|
|
132
|
+
async forget(clientMessageId) {
|
|
133
|
+
return this.store.deleteSendLogEntry(clientMessageId);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=resendable-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resendable-content.js","sourceRoot":"","sources":["../../client/resendable-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAQH,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,4BAA4B,CAAC;AAwB9E,MAAM,OAAO,iBAAiB;IAKT,KAAK;IAEN,WAAW;IACV,GAAG;IAPtB,gEAAgE;IACxD,QAAQ,CAAqB;IAErC,YACmB,KAA6B;IAC9C,qEAAqE;IACrD,WAAmB,EAClB,GAAG,GAAiB,IAAI,CAAC,GAAG;qBAH5B,KAAK;2BAEN,WAAW;mBACV,GAAG;IACnB,CAAC;IAEJ,mFAAmF;IAC5E,SAAS,CAAC,SAAiB;QAChC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC;IACnD,CAAC;IAED,6EAA6E;IACtE,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC;QAChD,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC/E,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACtF,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AuB;QACpD,MAAM,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACxD,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;YAC7F,MAAM;YACN,QAAQ;SACT,CAAC,CAAC,CAAC;IACN,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,iCAAiC,CAAC,CAAC,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAC5F,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAAE,CAAC;QACjE,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QACvD,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,iCAAiC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACpF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,WAAW;QACtB,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,iCAAiC,CAAC,CAAC;IACrE,CAAC;IAED,0DAA0D;IACnD,KAAK,CAAC,MAAM,CAAC,eAAuB;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import type { Logger } from '../logger.js';
|
|
13
13
|
import { withProcessedEnvelopeLock, type ResolvedRetryFamilyMember } from '../local/store/reliability.js';
|
|
14
14
|
import type { RetryRequestFailure } from './retry-request-envelope.js';
|
|
15
|
+
import type { SignalProtocolClientHooks } from './event-hooks.js';
|
|
15
16
|
import type { RetryRequestOutcome } from './retry-request-lifecycle.js';
|
|
16
17
|
type RetryFamilyStore = Parameters<typeof withProcessedEnvelopeLock>[0];
|
|
17
18
|
/**
|
|
@@ -38,16 +39,56 @@ export interface RetryFamilyReceive {
|
|
|
38
39
|
*/
|
|
39
40
|
admit(): Promise<boolean>;
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
-
* envelope
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
* Tell which failed envelope a decrypt with this content fulfills: the
|
|
43
|
+
* failed envelope of a member, or of a failed envelope with a request
|
|
44
|
+
* record. Undefined when `fulfill` writes nothing for it. The receive
|
|
45
|
+
* record of the content names the result as its `failedEnvelopeId`.
|
|
46
|
+
* Call it after `admit`.
|
|
47
|
+
*/
|
|
48
|
+
fulfills(decrypted?: {
|
|
49
|
+
readonly senderKeyDistribution: boolean;
|
|
50
|
+
readonly content: boolean;
|
|
51
|
+
}): string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Record a decrypt that succeeded: outcome 1. The receive path calls it
|
|
54
|
+
* right after the commit of the receive record, before the
|
|
55
|
+
* acknowledgment or the return. For a member, and for a failed envelope
|
|
56
|
+
* with a request record, one write marks the failed envelope processed
|
|
57
|
+
* and fulfilled. That write stops the retry scheduler for the failed
|
|
58
|
+
* envelope. A redelivery of the failed envelope on either path is then
|
|
59
|
+
* dropped, and so is each later member. When the write fails, the error
|
|
60
|
+
* propagates: the caller does not acknowledge the envelope, and its
|
|
61
|
+
* redelivery finds the committed receive record and writes again.
|
|
62
|
+
*
|
|
63
|
+
* The fulfilled write does not run `onDeliveryRecovered`. That hook waits
|
|
64
|
+
* for the completion of the receive record (outcome 2), as
|
|
65
|
+
* `reportDeliveryRecovered` tells.
|
|
66
|
+
*
|
|
67
|
+
* A failed group message whose sender key was missing has a request
|
|
68
|
+
* record with no group. When the decrypt that gives its content resolves
|
|
69
|
+
* the group, the record gets it before the fulfilled write, so
|
|
70
|
+
* `onDeliveryRecovered` names it. A record that names a group keeps it.
|
|
71
|
+
*
|
|
72
|
+
* A member that brings only a sender-key distribution, for a failed
|
|
73
|
+
* envelope that is a sender-key group message, writes nothing and does
|
|
74
|
+
* not fulfill the failed envelope. The member installs the sender key and
|
|
75
|
+
* gives no content. A redelivery of the failed envelope then decrypts
|
|
76
|
+
* with that key and gives its content, and a later member is admitted.
|
|
77
|
+
* One debug line records the behavior RETRY_SENDER_KEY_RESEND. A member
|
|
78
|
+
* that brings content beside the distribution fulfills the failed
|
|
79
|
+
* envelope, as any other member does.
|
|
80
|
+
*
|
|
81
|
+
* @param decrypted - The decrypted content. `senderKeyDistribution` is
|
|
82
|
+
* true when the content carries a sender-key distribution. `content` is
|
|
83
|
+
* true when it carries content other than a distribution. `groupId` is
|
|
84
|
+
* the group that the decrypt resolved for group content, in the form
|
|
85
|
+
* of `DecryptedEnvelope.conversationId`.
|
|
49
86
|
*/
|
|
50
|
-
fulfill(
|
|
87
|
+
fulfill(decrypted?: {
|
|
88
|
+
readonly senderKeyDistribution: boolean;
|
|
89
|
+
readonly content: boolean;
|
|
90
|
+
readonly groupId?: string;
|
|
91
|
+
}): Promise<void>;
|
|
51
92
|
/**
|
|
52
93
|
* Record a decrypted null message, in place of `fulfill`. A null
|
|
53
94
|
* message carries no content, so the caller never gives it to the
|
|
@@ -107,13 +148,19 @@ export interface RetryFamilyReceive {
|
|
|
107
148
|
* The processed record and the acknowledgment use the delivered envelope
|
|
108
149
|
* ID.
|
|
109
150
|
*
|
|
151
|
+
* Under the lock and before the receive, it runs `onDeliveryRecovered` for
|
|
152
|
+
* a failed envelope whose recovery the hook did not mark. An error from
|
|
153
|
+
* that hook propagates, so the receive path does not acknowledge the
|
|
154
|
+
* envelope, and its redelivery runs the hook again.
|
|
155
|
+
*
|
|
110
156
|
* @param storage - The local store that keeps the retry records.
|
|
111
157
|
* @param logger - The client logger.
|
|
158
|
+
* @param hooks - The client hooks, for `onDeliveryRecovered`.
|
|
112
159
|
* @param envelope - The IDs of the received envelope: the delivered
|
|
113
160
|
* envelope ID, and the client message ID when the relay delivers one.
|
|
114
161
|
* @param receive - The receive path. It runs under the lock.
|
|
115
162
|
*/
|
|
116
|
-
export declare function receiveInRetryFamily<T>(storage: RetryFamilyStore, logger: Required<Logger>, envelope: {
|
|
163
|
+
export declare function receiveInRetryFamily<T>(storage: RetryFamilyStore, logger: Required<Logger>, hooks: SignalProtocolClientHooks | undefined, envelope: {
|
|
117
164
|
readonly id?: string;
|
|
118
165
|
readonly clientMessageId?: string;
|
|
119
166
|
}, receive: (family: RetryFamilyReceive) => Promise<T>): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry-family.d.ts","sourceRoot":"","sources":["../../client/retry-family.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"retry-family.d.ts","sourceRoot":"","sources":["../../client/retry-family.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAQL,yBAAyB,EACzB,KAAK,yBAAyB,EAE/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;AAExE;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,yBAAy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EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,EACrE,OAAO,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,CAAC,CAAC,CAgBZ"}
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* gets the content of one failed envelope at most once, from the envelope
|
|
10
10
|
* itself or from one family member.
|
|
11
11
|
*/
|
|
12
|
-
import { getProcessedEnvelope, getRetryRequest, markRetryRequestAnswered, resolveRetryFamilyMember, RetryRequestedEnvelopeChangedError, storeProcessedEnvelope, withProcessedEnvelopeLock, } from '../local/store/reliability.js';
|
|
12
|
+
import { getProcessedEnvelope, getRetryRequest, markRetryRequestAnswered, resolveRetryFamilyMember, RetryRequestedEnvelopeChangedError, storeProcessedEnvelope, updateRetryRequest, withProcessedEnvelopeLock, } from '../local/store/reliability.js';
|
|
13
|
+
import { reportDeliveryRecovered } from './delivery-error.js';
|
|
13
14
|
/**
|
|
14
15
|
* Receive one envelope in the retry family of its failed envelope.
|
|
15
16
|
*
|
|
@@ -24,23 +25,35 @@ import { getProcessedEnvelope, getRetryRequest, markRetryRequestAnswered, resolv
|
|
|
24
25
|
* The processed record and the acknowledgment use the delivered envelope
|
|
25
26
|
* ID.
|
|
26
27
|
*
|
|
28
|
+
* Under the lock and before the receive, it runs `onDeliveryRecovered` for
|
|
29
|
+
* a failed envelope whose recovery the hook did not mark. An error from
|
|
30
|
+
* that hook propagates, so the receive path does not acknowledge the
|
|
31
|
+
* envelope, and its redelivery runs the hook again.
|
|
32
|
+
*
|
|
27
33
|
* @param storage - The local store that keeps the retry records.
|
|
28
34
|
* @param logger - The client logger.
|
|
35
|
+
* @param hooks - The client hooks, for `onDeliveryRecovered`.
|
|
29
36
|
* @param envelope - The IDs of the received envelope: the delivered
|
|
30
37
|
* envelope ID, and the client message ID when the relay delivers one.
|
|
31
38
|
* @param receive - The receive path. It runs under the lock.
|
|
32
39
|
*/
|
|
33
|
-
export async function receiveInRetryFamily(storage, logger, envelope, receive) {
|
|
40
|
+
export async function receiveInRetryFamily(storage, logger, hooks, envelope, receive) {
|
|
34
41
|
const envelopeId = envelope.id;
|
|
35
|
-
if (!envelopeId)
|
|
42
|
+
if (!envelopeId) {
|
|
36
43
|
return receive(retryFamilyReceive(storage, logger, undefined, undefined));
|
|
44
|
+
}
|
|
37
45
|
const member = await resolveRetryFamilyMember(storage, envelope.clientMessageId ?? envelopeId);
|
|
38
|
-
|
|
46
|
+
const failedEnvelopeId = member?.failedEnvelopeId ?? envelopeId;
|
|
47
|
+
return withProcessedEnvelopeLock(storage, failedEnvelopeId, async () => {
|
|
48
|
+
// A recovery whose hook did not return runs again. An error from the
|
|
49
|
+
// hook fails the receive, so the envelope is delivered again.
|
|
50
|
+
await reportDeliveryRecovered(storage, hooks, failedEnvelopeId);
|
|
51
|
+
return receive(retryFamilyReceive(storage, logger, envelopeId, member));
|
|
52
|
+
});
|
|
39
53
|
}
|
|
40
54
|
function retryFamilyReceive(storage, logger, envelopeId, member) {
|
|
41
55
|
const failedEnvelopeId = member?.failedEnvelopeId ?? envelopeId;
|
|
42
|
-
// The read comes before the decrypt, so only writes follow the
|
|
43
|
-
// application hook.
|
|
56
|
+
// The read comes before the decrypt, so only writes follow the commit.
|
|
44
57
|
let request = null;
|
|
45
58
|
return {
|
|
46
59
|
member,
|
|
@@ -75,18 +88,46 @@ function retryFamilyReceive(storage, logger, envelopeId, member) {
|
|
|
75
88
|
request = await getRetryRequest(storage, failedEnvelopeId);
|
|
76
89
|
return true;
|
|
77
90
|
},
|
|
78
|
-
|
|
91
|
+
fulfills(decrypted) {
|
|
92
|
+
if (member &&
|
|
93
|
+
request?.groupMessage &&
|
|
94
|
+
decrypted?.senderKeyDistribution &&
|
|
95
|
+
!decrypted.content) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
if (failedEnvelopeId === undefined || !(member || request))
|
|
99
|
+
return undefined;
|
|
100
|
+
return failedEnvelopeId;
|
|
101
|
+
},
|
|
102
|
+
async fulfill(decrypted) {
|
|
103
|
+
if (member &&
|
|
104
|
+
request?.groupMessage &&
|
|
105
|
+
decrypted?.senderKeyDistribution &&
|
|
106
|
+
!decrypted.content) {
|
|
107
|
+
logger.debug('A resend gave the sender key of a failed group message', {
|
|
108
|
+
category: 'E2EE',
|
|
109
|
+
data: { envelopeId, behavior: 'RETRY_SENDER_KEY_RESEND' },
|
|
110
|
+
});
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (failedEnvelopeId === undefined || !(member || request))
|
|
114
|
+
return;
|
|
79
115
|
try {
|
|
116
|
+
const groupId = decrypted?.groupId;
|
|
117
|
+
if (request && request.groupId === undefined && groupId !== undefined) {
|
|
118
|
+
request =
|
|
119
|
+
(await updateRetryRequest(storage, failedEnvelopeId, request.retryId, request.attempt, {
|
|
120
|
+
groupId,
|
|
121
|
+
})) ?? request;
|
|
122
|
+
}
|
|
80
123
|
// One write marks the failed envelope processed and fulfilled. A
|
|
81
124
|
// redelivery of it is then acknowledged with no decrypt, and each
|
|
82
125
|
// later member of its request is dropped.
|
|
83
|
-
|
|
84
|
-
await storeProcessedEnvelope(storage, failedEnvelopeId, Date.now(), undefined, true);
|
|
85
|
-
}
|
|
126
|
+
await storeProcessedEnvelope(storage, failedEnvelopeId, Date.now(), undefined, true);
|
|
86
127
|
}
|
|
87
128
|
catch (error) {
|
|
88
|
-
// The
|
|
89
|
-
//
|
|
129
|
+
// The receive record holds the content. The caller does not
|
|
130
|
+
// acknowledge, so the redelivery writes outcome 1 again.
|
|
90
131
|
logger.warn('The retry family record of a decrypted envelope failed to store', {
|
|
91
132
|
category: 'E2EE',
|
|
92
133
|
data: {
|
|
@@ -95,6 +136,7 @@ function retryFamilyReceive(storage, logger, envelopeId, member) {
|
|
|
95
136
|
error: error.message,
|
|
96
137
|
},
|
|
97
138
|
});
|
|
139
|
+
throw error;
|
|
98
140
|
}
|
|
99
141
|
},
|
|
100
142
|
async consumeNull(fingerprint) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry-family.js","sourceRoot":"","sources":["../../client/retry-family.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACxB,kCAAkC,EAClC,sBAAsB,EACtB,yBAAyB,GAG1B,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"retry-family.js","sourceRoot":"","sources":["../../client/retry-family.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACxB,kCAAkC,EAClC,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,GAG1B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AA+H3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAyB,EACzB,MAAwB,EACxB,KAA4C,EAC5C,QAAqE,EACrE,OAAmD;IAEnD,MAAM,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC/B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,OAAO,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IAC5E,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAC3C,OAAO,EACP,QAAQ,CAAC,eAAe,IAAI,UAAU,CACvC,CAAC;IACF,MAAM,gBAAgB,GAAG,MAAM,EAAE,gBAAgB,IAAI,UAAU,CAAC;IAChE,OAAO,yBAAyB,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,IAAI,EAAE;QACrE,qEAAqE;QACrE,8DAA8D;QAC9D,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AI,CAAC;gBACzB,EAAE,EAAE,gBAAgB;gBACpB,GAAG,CAAC,MAAM,EAAE,WAAW,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;gBAC7E,MAAM;gBACN,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;aACxD,CAAC,CAAC;YACH,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,UAAU,CAAC,IAAI,UAAU,EAAE,CAAC;gBACnE,MAAM,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;YAC7E,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Wire form of a retry request.
|
|
3
3
|
*
|
|
4
|
-
* A retry request
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* A retry request is a mailbox envelope with `messageType: 'retry_request'`.
|
|
5
|
+
* The envelope sender is the requester, so the payload never carries it.
|
|
6
|
+
* The `ciphertext` field holds canonical base64 of a small UTF-8 JSON
|
|
7
|
+
* payload. The payload is not ratchet-encrypted. It holds only what the
|
|
8
|
+
* requester knows about the failed message.
|
|
9
|
+
*
|
|
10
|
+
* The request record stores the identified form of the envelope.
|
|
11
|
+
* `retryRequestPost` seals it at each post when an access key of the target
|
|
12
|
+
* permits it: the seal holds the same payload as `PLAINTEXT_CONTENT`, and
|
|
13
|
+
* the sender certificate in the seal names the requester. Otherwise the
|
|
14
|
+
* post is identified, and the relay stamps the requester, only when the
|
|
15
|
+
* sealed sender delivery mode permits it.
|
|
9
16
|
*
|
|
10
17
|
* The requester keeps one request record for each failed envelope. The record
|
|
11
18
|
* holds a random retry ID, and every wire ID of the request family derives from
|
|
@@ -16,9 +23,15 @@
|
|
|
16
23
|
* The requester stores each request envelope before the post. After a post
|
|
17
24
|
* that fails with a retryable class, the retry request scheduler posts the
|
|
18
25
|
* stored envelope again, until the deadline of the record.
|
|
26
|
+
*
|
|
27
|
+
* A relay can assign its own envelope ID. The payload then also carries the
|
|
28
|
+
* client message ID of the failed envelope, the ID that the sender chose. A
|
|
29
|
+
* request without a ratchet key names a failed sender-key message.
|
|
19
30
|
*/
|
|
20
|
-
import type { Envelope } from '../remote/relay/types.js';
|
|
31
|
+
import type { Envelope, SignalProtocolRelayServer } from '../remote/relay/types.js';
|
|
32
|
+
import type { SealedReceipt } from './types.js';
|
|
21
33
|
import { type RetryRequest } from '../internal/sesame/types.js';
|
|
34
|
+
import type { ContentHint } from '../types/messages.js';
|
|
22
35
|
import { storeRetryRequest, type RetryRequestIds, type StoredRetryRequest } from '../local/store/reliability.js';
|
|
23
36
|
/** The decoder refuses a longer `ciphertext` value before it decodes it. */
|
|
24
37
|
export declare const MAX_RETRY_REQUEST_CIPHERTEXT_LENGTH = 2048;
|
|
@@ -49,6 +62,37 @@ export interface RetryRequestFailure {
|
|
|
49
62
|
fingerprint?: string;
|
|
50
63
|
/** The stored attempt of the request for this envelope, from `getRetryRequest`. */
|
|
51
64
|
stored: StoredRetryRequest | null;
|
|
65
|
+
/**
|
|
66
|
+
* True when the failed envelope is a sender-key group message. A new
|
|
67
|
+
* record stores it. A new attempt keeps the value of the stored record.
|
|
68
|
+
*/
|
|
69
|
+
groupMessage?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The client message ID of the failed envelope. Set it only when the
|
|
72
|
+
* failed envelope itself failed, because a member has its own ID. A new
|
|
73
|
+
* record stores it. A new attempt keeps the value of the stored record.
|
|
74
|
+
*/
|
|
75
|
+
clientMessageId?: string;
|
|
76
|
+
/**
|
|
77
|
+
* The raw group ID of the failed envelope, when the local device knows
|
|
78
|
+
* it. Set it only when the failed envelope itself failed. A new record
|
|
79
|
+
* stores it. A new attempt keeps the value of the stored record.
|
|
80
|
+
*/
|
|
81
|
+
groupId?: string;
|
|
82
|
+
/**
|
|
83
|
+
* The content hint of the failed envelope. Set it only when the failed
|
|
84
|
+
* envelope itself failed. A new record stores it. A new attempt keeps the
|
|
85
|
+
* value of the stored record.
|
|
86
|
+
*/
|
|
87
|
+
contentHint?: ContentHint;
|
|
88
|
+
/**
|
|
89
|
+
* The device that sent the failed envelope. A new record stores it. A
|
|
90
|
+
* new attempt keeps the value of the stored record.
|
|
91
|
+
*/
|
|
92
|
+
sender?: {
|
|
93
|
+
userId: string;
|
|
94
|
+
deviceId: number;
|
|
95
|
+
};
|
|
52
96
|
/**
|
|
53
97
|
* The envelope ID of the resend or the null message that failed to
|
|
54
98
|
* decrypt. Undefined when the failed envelope itself failed.
|
|
@@ -67,6 +111,47 @@ export interface RetryRequestFailure {
|
|
|
67
111
|
export declare function retryRequestEnvelope(request: RetryRequest, sender: RetryRequestDevice, failed?: RetryRequestIds & {
|
|
68
112
|
attempt: number;
|
|
69
113
|
}): Promise<Envelope>;
|
|
114
|
+
/**
|
|
115
|
+
* Seals the payload of one retry request for its target device, or resolves
|
|
116
|
+
* to undefined when the request goes identified. It throws when sealed
|
|
117
|
+
* sender is required and the request cannot be sealed.
|
|
118
|
+
*/
|
|
119
|
+
export type SealRetryRequest = (recipientUserId: string, recipientDeviceId: number, payloadBase64: string) => Promise<SealedReceipt | undefined>;
|
|
120
|
+
/**
|
|
121
|
+
* Make the function that posts one retry request envelope, by the sealed
|
|
122
|
+
* sender delivery mode, as a receipt goes.
|
|
123
|
+
*
|
|
124
|
+
* With an access key of the target, the post is sealed: the Relay sees the
|
|
125
|
+
* target, the timing and the size, and not the requester. The sealed post
|
|
126
|
+
* keeps the client message ID and the timestamp of the envelope, so the
|
|
127
|
+
* Relay deduplicates the attempt by the same operation as an identified
|
|
128
|
+
* post. When the Relay refuses the access key, the post goes identified
|
|
129
|
+
* only when the delivery mode permits it. When `seal` resolves to
|
|
130
|
+
* undefined, the post goes identified. In `'required'` mode `seal` throws
|
|
131
|
+
* instead, and nothing goes identified. The caller classifies each error
|
|
132
|
+
* of the post.
|
|
133
|
+
*
|
|
134
|
+
* When the Relay refuses the post as `STALE_DEVICE`, the target device has
|
|
135
|
+
* a new registration. The post then refreshes the session with the device
|
|
136
|
+
* once from a fresh bundle, and posts the same envelope again, sealed and
|
|
137
|
+
* named with the new session, as a receipt goes. The request is plaintext,
|
|
138
|
+
* so nothing is encrypted again. A refresh that finds no bundle,
|
|
139
|
+
* or a second refusal, throws the refusal. A refresh that fails for another
|
|
140
|
+
* reason throws StaleSessionRefreshError, which classifies as a transport
|
|
141
|
+
* outage, so the next post refreshes again.
|
|
142
|
+
*
|
|
143
|
+
* @param seal - Seals the payload. Without it, each post is identified.
|
|
144
|
+
* @param relay - Posts the sealed envelope.
|
|
145
|
+
* @param sendIdentified - Posts the identified envelope.
|
|
146
|
+
* @param registrationOf - The registration ID of the current session with
|
|
147
|
+
* the target device. The identified envelope names it, as the sealed body
|
|
148
|
+
* does, so the Relay refuses the post to a reinstalled device. With no
|
|
149
|
+
* session, or without this function, the envelope names none.
|
|
150
|
+
* @param refreshStaleSession - Refreshes the session with a refused device.
|
|
151
|
+
* Resolves to true when the new session is ready. Without it, a stale
|
|
152
|
+
* refusal throws.
|
|
153
|
+
*/
|
|
154
|
+
export declare function retryRequestPost(seal: SealRetryRequest | undefined, relay: Pick<SignalProtocolRelayServer, 'sendMultiRecipientUnidentified'> | undefined, sendIdentified: (envelope: Envelope) => Promise<unknown>, registrationOf?: (userId: string, deviceId: number) => Promise<number | undefined>, refreshStaleSession?: (userId: string, deviceId: number) => Promise<boolean>): (envelope: Envelope) => Promise<unknown>;
|
|
70
155
|
/** What a retry request post did. */
|
|
71
156
|
export type RetryPostOutcome =
|
|
72
157
|
/** The Relay holds the request attempt. */
|
|
@@ -75,6 +160,13 @@ export type RetryPostOutcome =
|
|
|
75
160
|
| 'pending'
|
|
76
161
|
/** The request ended. The record holds the terminal state. */
|
|
77
162
|
| 'terminal';
|
|
163
|
+
/**
|
|
164
|
+
* Tell whether a stored request attempt is answered and is the last
|
|
165
|
+
* attempt of its request. A sender answers at most
|
|
166
|
+
* `MAX_RETRY_RESPONSES_PER_MESSAGE` requests for one message, so when the
|
|
167
|
+
* resend that answered this attempt also fails, the request ends.
|
|
168
|
+
*/
|
|
169
|
+
export declare function answeredLastRetryAttempt(stored: StoredRetryRequest): boolean;
|
|
78
170
|
/**
|
|
79
171
|
* Post the retry request for one failed envelope.
|
|
80
172
|
*
|
|
@@ -85,8 +177,15 @@ export type RetryPostOutcome =
|
|
|
85
177
|
* record that ended posts nothing. At the deadline of the record, the
|
|
86
178
|
* request ends as `expired-content` and posts nothing. When a member
|
|
87
179
|
* failed and the stored attempt is answered, it creates the next attempt
|
|
88
|
-
* under the same retry ID, with the same deadline, and posts it.
|
|
89
|
-
*
|
|
180
|
+
* under the same retry ID, with the same deadline, and posts it. When that
|
|
181
|
+
* answered attempt is the last one, as `answeredLastRetryAttempt` tells,
|
|
182
|
+
* the request ends as `attempts-exhausted` and posts nothing. Otherwise it
|
|
183
|
+
* posts the stored attempt, as `postStoredRetryRequest` does.
|
|
184
|
+
*
|
|
185
|
+
* Each new attempt carries the failed client message ID, the content hint,
|
|
186
|
+
* the sender, the receive time and the delivery error state of the stored
|
|
187
|
+
* record. Attempt 1 takes them from `failed`, with the time of now as the
|
|
188
|
+
* receive time.
|
|
90
189
|
*
|
|
91
190
|
* @param store - The local store that keeps the request records.
|
|
92
191
|
* @param failed - The failed envelope and its stored request.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry-request-envelope.d.ts","sourceRoot":"","sources":["../../client/retry-request-envelope.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"retry-request-envelope.d.ts","sourceRoot":"","sources":["../../client/retry-request-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE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