Skip to Content
OpenE2EEDocs

Protocol and version upgrades

What changes when you upgrade the SDK, what happens to persisted sessions, and who owns version negotiation across a mixed device population.

Status
stable
Applies to
15.0.0
Platforms
Expo · Browser · Node
Prereqs
A working client from Start → Quickstart
Reading time
11 min

Two things change independently when you upgrade: the code, and the shape of what is already persisted on your users' devices. The first is your build pipeline's problem. The second is a user-visible event, and this page is mostly about that.

The maturity statement is the frame for everything below: 15.0.x. Public APIs and persisted formats follow semantic versioning.

The OpenE2EE Signal Protocol Relay applies this rule to every SDK release. No SDK upgrade is necessary.

The Relay registers only the first device of an account. A registration with a new device key on an account that has a device gets HTTP 409 with the code DEVICE_LINK_REQUIRED. The Relay adds no device. A registration with a device key that the account holds keeps its device ID.

Who gets the refusal. An application with custom-token or native provider identity that registers a new device key for an account with a device. Examples are a reinstall, a new phone, a second browser, and cleared site data. In device-owned identity, a new store makes a new account, so it does not get this refusal.

  1. Handle the refusal. createHostedSignalProtocolClient throws HostedSignalProtocolRelayDeviceLinkRequiredError. It is a HostedSignalProtocolRelayHttpError with code DEVICE_LINK_REQUIRED, status 409, and retryable false. Do not retry the registration. isRetryableError() returns false for this error, so withRetry() gives it to the caller after one attempt.
  2. Add the new device through the two-device link. The new device calls joinHostedSignalProtocolRelayAccount() with an empty store. Device 1 calls approveHostedSignalProtocolRelayDeviceLink(). When the Relay does not serve the two-device link, the join throws HostedSignalProtocolRelayDeviceProvisioningError with code SIGNAL_RELAY_UNSUPPORTED. Then link the device from device 1 with linkHostedSignalProtocolRelayDevice(). See multi-device.
  3. Recover the account when the user has no active device. Create the client with assertionPurpose: 'recover'. Recovery revokes every earlier device of the account.
  4. Check the path after HostedSignalProtocolRelayDeviceUnknownError. A re-registration after that error gets DEVICE_LINK_REQUIRED when the account has other devices.

See when the account already has a device.

Upgrading from 14.x to 15.0.0

15.0.0 is a major release. It removes the earlier names that 14.2.0 and 14.3.0 deprecated. The SDK reports 'signal-relay' for the Relay. Eleven errors and four log operations get a new name. The new values and names keep the stored formats and the wire formats.

The client speaks only Relay protocol version 3, and each device proof signs the version 3 label. To upgrade from 14.x:

  1. Do the 14.2.0 and 14.3.0 steps first. 15.0.0 removes each earlier name that those releases deprecated. See 14.1 to 14.2.0 and 14.2 to 14.3.0. Set each option that is required again. TypeScript gives an error when you do not set one.

    JavaScript code that sets a removed option name gets no error, and the SDK does not read that option. registerHook('onSignalProtocolRelayProtocolError', ...) throws Unknown Signal Protocol client hook. Use onRelayProtocolError. A bootstrap adapter that returns no relay or no relayScopeId makes the hosted client fail to start.

  2. Replace the earlier pre-key bundle type name with PreKeyBundle. 15.0.0 removes the earlier name from the package root. The two names identified the same type. The CHANGELOG.md file of the package gives the earlier name. TypeScript gives an error for each import of that name.

  3. Expect 'signal-relay' for the Relay. DeliverySource, the origin of ReceiveExpiredEvent, and the origin of PendingReceive are 'signal-relay' where SDK 14 gave 'relay'. This includes a record that an earlier SDK stored with 'relay'. The store keeps the stored value. The three types still accept 'relay'. Make each comparison with 'relay' match 'signal-relay'. Code that followed the 14.2.0 steps for these values needs no change. A switch on DeliverySource keeps its case for 'relay', because the type still accepts that value.

  4. Match the new error names. The name property of each error in the table below is now the name of its class. In SDK 14, the name was the name in the table without SignalProtocol. Change each match on name, in code and in a log query. instanceof checks need no change.

  5. Match the new log operations. The device transfer connection logs the operation values signal-relay-connect, signal-relay-disconnect, signal-relay-upload, and signal-relay-download. SDK 14 logged each value without signal-. Change each log query that matches one of these values. SDK 14.2.0 announced this change.

  6. Use protocol version 3 of the Relay. The client offers no other version. It offers version 3 on each HTTP request and on the mailbox socket. SDK 14 changed to version 2 when the Relay refused it. The OpenE2EE Signal Protocol Relay serves this version. When a Relay does not serve version 3, the SDK sends each request once:

    • An identified Relay route and the managed group authority throw HostedSignalProtocolRelayHttpError with the code PROTOCOL_UNSUPPORTED, the status 400, and retryable true.
    • A sealed post throws HostedAnonymousDeliveryError with the code DELIVERY_FAILED and the status 400.
    • A group server request throws HostedGroupError whose data.status is 400.
    • The mailbox socket reconnects with its usual backoff. Its state is reconnecting with the reason protocol-unsupported, where SDK 14 gave closed.

    Read PROTOCOL_UNSUPPORTED as a retryable fault. Do not expect the SDK to send a request again on another version. A send keeps the device pending until its posting deadline. UPGRADE_REQUIRED stays terminal. Add protocol-unsupported to each exhaustive switch on SignalProtocolRelayConnectionReason.

  7. Custom hosted.adapter: remove the protocolVersion argument. The signChallenge and signCertificateRequest methods of HostedSignalProtocolRelayDeviceAuthentication have no protocolVersion parameter. Each call signs the version 3 label. In SDK 14, a call without protocolVersion signed the version 2 label. Remove the argument from each call. TypeScript gives an error for a call with that argument. Make each adapter that verifies such a proof verify the version 3 label.

name in 15.0.0Announced in
SignalProtocolRelayWorkStopped14.2.0
InMemorySignalProtocolRelayRefusal14.2.0
HostedSignalProtocolRelayDeviceLinkError15.0.0
HostedSignalProtocolRelayDeviceUnknownError15.0.0
HostedSignalProtocolRelayDeviceRevokedError15.0.0
HostedSignalProtocolRelayHttpError15.0.0
HostedSignalProtocolRelayPresenceError15.0.0
HostedSignalProtocolRelayResumeError15.0.0
HostedSignalProtocolRelayUpgradeRequiredError15.0.0
SignalProtocolRelayProtocolError15.0.0
SendNeverAcceptedBySignalProtocolRelayError15.0.0

The SDK does not export InMemorySignalProtocolRelayRefusal, so an instanceof check cannot use it. Match its name.

The changelog lists each change and the SDK 14 name of each error.

Upgrading from 14.3.0 or earlier

The OpenE2EE Signal Protocol Relay serves only Relay protocol version 3. SDK 14.3.0 and earlier releases send version 1, version 2, or no version. The Relay refuses each of their requests to a Relay route with HTTP 426 and the code UPGRADE_REQUIRED. It closes each of their mailbox sockets with code 4426. A retry fails the same way.

  1. Upgrade to SDK 14.4.0 or a later release. This release sends version 3. See protocol versions.
  2. Do the steps of each newer release. Start at the section of your release. Then do each newer section in order.

Upgrading from 14.3 to 14.4.0

14.4.0 is a minor release. The SDK speaks version 3 of the Relay protocol. It writes new values and keys to the local store. A store that SDK 14.0.0 through 14.3.0 wrote opens with 14.4.0. For DeliverySource, PendingReceive.origin, and ReceiveExpiredEvent.origin, the SDK still reports 'relay', as 14.3.0 does.

  1. Use a Relay that serves version 3. On each HTTP request to a Relay route, 14.4.0 sends the header x-signal-relay-protocol: 3. On the mailbox socket, it offers the subprotocol token signal-relay.v3. The OpenE2EE Signal Protocol Relay serves only version 3. When the Relay refuses version 3 with PROTOCOL_UNSUPPORTED, the client falls back to version 2. The Relay refuses version 2 with UPGRADE_REQUIRED, so the client stops. See protocol versions.
  2. Custom hosted.adapter: pass the protocol version to the device proof signer. The signChallenge and signCertificateRequest methods of HostedSignalProtocolRelayDeviceAuthentication take an optional last argument, protocolVersion. A call without it signs the earlier label that versions 1 and 2 share. An adapter that sends the proof with x-signal-relay-protocol: 3 must pass 3 as the version. The Relay refuses a request with version 1, version 2, or no version with UPGRADE_REQUIRED.
  3. Expect the new store values and keys. A new receive record holds the origin 'signal-relay' and the receipt decision signalProtocolRelayOwnsReceipt. A new Relay delivery status holds the source 'signal-relay'. The SDK writes a hosted record to its signalRelay.<record>.v2: key only. When only the earlier .v1: key holds a record, a read copies the record to the current key. The read keeps the earlier key. The SDK also reads each earlier value and each .v1: key that SDK 14.0.0 through 14.3.0 wrote.
  4. Do not ship SDK 14.1.0 or earlier to a device after the device runs 14.4.0. To roll back, ship SDK 14.2.0 or 14.3.0 to the device. Those releases read each value that 14.4.0 writes. They read the current key of a hosted record first. SDK 14.1.0 and earlier releases refuse the origin 'signal-relay'. They read only the .v1: key of a hosted record. A device that goes back to SDK 14.1.0 or earlier can have these failures:
    • Messages that the device received but did not complete can stay unprocessed. The receive queue fails each time it reads a stored receive with the origin 'signal-relay'.
    • A device that registered with 14.4.0 cannot resume its Relay connection. The earlier release does not find the device authentication key. The resume fails with RETAINED_DEVICE_AUTHENTICATION_UNAVAILABLE.
    • A device-owned identity that 14.4.0 created is lost. The earlier release does not find the key, so it creates a new key. The Relay binds an account to that key, so the device gets a new account.
    • A hosted record that 14.4.0 changed goes back to its earlier value. An example is the stored Relay session.

The changelog lists each change.

Upgrading from 14.2 to 14.3.0

14.3.0 is a minor release. The role names of members and options, such as relay, relayUrl, and startRelaySubscription, are the names to use. The signalProtocolRelay* names that 14.2.0 added are deprecated, and SDK 15.0.0 removes them. Both names of each member and option still work in 14.3.0. The behavior of the SDK, the bytes on the wire, and the stored bytes do not change. Code that did not change for 14.2.0 needs no change.

  1. Change each signalProtocolRelay* name back to its role name. For example, use relay in place of signalProtocolRelay, and hosted.relayUrl in place of hosted.signalProtocolRelayUrl. Code that keeps a signalProtocolRelay* name compiles and runs in 14.3.0. The TypeScript tools mark that name as deprecated. Do this step before SDK 15.0.0.
  2. Remove each signalProtocolRelay* member that you added to an implementation. This applies to a class or object that implements SignalProtocolRelayServer, SignalProtocolContentAdapter, or HostedSignalProtocolRelayBootstrapResult. Keep the role-name member, such as relayConnectionState. 14.3.0 requires it.
  3. Read earlierName to find the name to keep. In a SignalProtocolRelayNameConflictError, earlierName holds the role name and newName holds the deprecated signalProtocolRelay* name.

The changelog lists each name.

Upgrading from 14.1 to 14.2.0

14.2.0 is a minor release. Each exported Relay name and package subpath without the Signal Protocol prefix gets a new name. Each earlier name still works in 14.2.0. SDK 15.0.0 removes the earlier names. Members and options keep their role names, as step 3 tells. A store that SDK 14.1.0 wrote opens unchanged, and SDK 14.1.0 reads each record that 14.2.0 writes. The bytes on the wire do not change.

  1. Replace each earlier name with its new name. A new name has the form SignalProtocolRelay. A new name that starts with Hosted has the form HostedSignalProtocolRelay. For example, useRelayLifecycle is now useSignalProtocolRelayLifecycle. The pre-key bundle type is now PreKeyBundle. The CHANGELOG.md file of the package lists each name. The TypeScript tools mark an earlier name as deprecated.
  2. Replace each earlier package subpath. remote/relay is now remote/signal-relay, and remote/relay/types is now remote/signal-relay/types. The two subpaths load one module. The TypeScript tools do not mark an earlier subpath.
  3. Keep the relay members and options. 14.2.0 adds a long form for each member and option, such as signalProtocolRelay for the relay adapter and hosted.signalProtocolRelayUrl for hosted.relayUrl. 14.2.0 marks the role name as deprecated. SDK 14.3.0 removes that mark and marks the long form as deprecated. SDK 15.0.0 removes the long forms and keeps the role names. Do not change your code to the long forms. Set each option by one name only. Two different values for the two names fail with SignalProtocolRelayNameConflictError. A class or object that implements SignalProtocolRelayServer keeps the role-name members, such as relayConnectionState.
  4. Read the new URL variable first. Set the Relay URL in OPEN_E2EE_SIGNAL_RELAY_URL. If your framework needs a public prefix, use the prefixed name, such as NEXT_PUBLIC_OPEN_E2EE_SIGNAL_RELAY_URL. An oe release before 5.0.0 wrote the earlier name without SIGNAL_. Until each environment has the new name, read the new name first and the earlier name second.
  5. Accept 'signal-relay' next to 'relay'. DeliverySource, the origin of ReceiveExpiredEvent, and the origin of PendingReceive accept both values. 14.2.0 reports 'relay'. SDK 15.0.0 reports 'signal-relay'. A switch that ends with an exhaustive check needs a case for each value now.
  6. Prepare error and log matches for SDK 15.0.0. SDK 15.0.0 adds SignalProtocol before Relay in two error names. The new names are SignalProtocolRelayWorkStopped and InMemorySignalProtocolRelayRefusal. SDK 15.0.0 also adds signal- before each log operation that starts with relay-. These operations are connect, disconnect, upload, and download. 14.2.0 does not change them. Make each match in code or in a log query accept both values.

Upgrading from 13.x to 14.0.0

14.0.0 is a major release. A group receive goes through processIncomingEnvelope(). Each own device gets each group master key in a GroupKeySync. The stores refuse SDK 13.x after the first open. To upgrade from 13.x:

  1. Replace decryptGroupMessage() with processIncomingEnvelope(). A decrypt* method is a cipher primitive that returns plaintext, such as decryptMessage(), decryptEnvelope(), and decryptFile(). A process* method is a receive workflow that returns an outcome and keeps the content until completeReceive(). Give the delivered envelope with its Relay id. An envelope with no id takes no receive lock, and a repeat call gives the retained content again until completeReceive(). A refusal gives a denied outcome and runs onDecryptionError in place of a throw. A retryable decrypt failure sends a retry request and throws. A receive that 13.x decryptGroupMessage() left pending completes through completeReceive() when listPendingReceives() lists it at awaiting-completion. A completeReceive() call before that stage deletes nothing. A repeat processIncomingEnvelope() call with the same frame does not find the receive. It fails with DECRYPTION_FAILED and sends a retry request. Stop each 13.x loop that calls again, and use listPendingReceives(). See groups.
  2. Send all managed group content with send(). The SDK denies managed group content that has no group context. A client with groups gives the reason legacy-no-context. An earlier check can deny the content first, for example blocked for a blocked group. A client with no groups refuses the content with a GroupReceiveRefusedError of reason configuration. Before, the client decided such content against the local group state. Every sender must run SDK 12.0.0 or later. The output of encryptGroupMessage() has no group context unless its plaintext holds one. A receiver denies that output in the same way for a managed group. A caller that delivers the bytes of encryptGroupMessage() itself decrypts them with decryptEnvelope(). See groups.
  3. Store the group master key before a send. A client with groups whose group store has no master key for a managed group refuses a new send to that group. It also refuses a manual resend of content with no logged group context. The send throws EncryptionError with the code GROUP_MASTER_KEY_MISSING, and it stores and posts nothing. An attachment send also uploads nothing. Store the group master key through the link or sync path, then send again. A manual resend of logged content that has a group context keeps that context. A replay that must build a sent transcript for an own device skips that transcript. It keeps its posts and logs one warning with the code. See errors.
  4. Remove the SDK 11 received-content names. At the first open of 14.0.0, each durable store deletes every SDK 11 received-content row and every converted record that waits for its envelope. The store logs the count once with the code LEGACY_RECEIVED_CONTENT_DELETED. The field readable counts the deleted rows that parse. A readable row is in a store that SDK 12.0.0 or later never opened. The sweep relies on the Relay retention period, 30 days in production. Where that limit applies, no SDK version shows the content of such a row. A device that received the content on SDK 11 in the last 30 days loses the row. The sweep does not restore it. Remove all use of ReceivedContent, ReceiveWorkRecord.awaitingEnvelope, receivedContentKey, and parseReceivedContent. A custom store must set messageId, senderUserId, and senderDeviceId on each ReceiveWorkRecord. See local storage.
  5. Upgrade every own device of an account in one release. Each own device gets each group master key in an encrypted GroupKeySync. An own device on an earlier SDK gives the raw sync to onMessageDecrypted, and that sync holds the group master key. A custom content adapter must implement serializeGroupKeySync(), or spread the result of createDefaultSignalProtocolContentAdapter() into itself. A switch statement on ParsedSyncContent.type must handle 'groupKeySync'. A custom local store must keep each metadata value across a close and a reopen. The first start of 14.0.0 sends one GroupKeySync to each other own device for each managed group that it can sync. Such a group has a verified record, and its stored state lists the account as a member. See groups.
  6. Replace case 'expired-content': with case 'request-expired': in onRetryTerminal. A retry request whose latest attempt the Relay answered or holds ends as request-expired at its deadline. That end resets no session. A retry request whose latest attempt the Relay did not accept ends as posting-deadline at its posting deadline or its deadline. That end resets the session. Only posting-deadline resets a session. During the reader window, the SDK reads a stored expired-content end as request-expired, and a record that the migration moved can have event.recovery. The reader window lasts until the next major SDK version. It also lasts at least 60 days after the publish day of 14.0.0. request-expired is not the delivery error cause request-ended. See error handling.
  7. Expect a unique send timestamp for each device. A new send with a timestamp that a different send of the device used throws InvalidSendTimestampError with the reason already_used. For that reason, earliest and latest are absent. SendResult.clientTimestamp is now required. Read the timestamp there when the SDK selects it. A retry with the same clientMessageId, a manual resend, and a retry answer keep the original timestamp. See errors.
  8. Expect a drop of a later message with the same sender and timestamp. The SDK drops a later message from any device of the same sender with the same timestamp. The rule also applies to sent transcripts from two own devices in two conversations. A custom store that reads ReceiveWorkRecord.received gets a key with only senderUserId and timestamp. A note to self gets to each other own device only as a sent transcript. See offline and reconciliation.
  9. Do not go back to SDK 13.x after the first open of 14.0.0. After that open, the stores refuse SDK 13.x. A 13.x reader throws on a record of 14.0.0. A 13.x web tab cannot open the IndexedDB store and gets a VersionError. A 14.x open waits for each open 13.x tab to close. A 13.x SQLite store refuses the file with INVALID_STATE. The key-value store has no version guard. Stop each 13.x process on it before the first 14.x open. See local storage.

The changelog lists each change.

Upgrading from 12.x to 13.0.0

13.0.0 is a major release. A new link gives the linked device its own registration ID and copies each group master key. These steps use the current names. In SDK 13.0.0, the names are linkHostedRelayDevice(), HostedRelayDeviceLinkError, and HostedRelayHttpError. SDK 14.2.0 adds the current names, and SDK 15.0.0 removes the earlier names. To upgrade from 12.x:

  1. One-process link: use a new store that holds only the account identity. Before the link copies the groups, linkHostedSignalProtocolRelayDevice() reads the linked device's group store. That group store is groups.store, or the SDK group store on the linked store. When it lists a group that the link did not write, the call throws HostedSignalProtocolRelayDeviceLinkError with code DEVICE_LINK_STORE_NOT_EMPTY. A call that resumes the link ignores the groups that the link wrote. The call throws the same error for a store that holds a device-authentication key and no registration of this link. The error has retryable false, and a call with the same store fails again. Link the device again with a new store that holds only the account identity. See multi-device.
  2. Custom local stores: accept an overwrite of the identity record. The link gives the linked device its own registration ID with the same identity keys. It calls storeIdentityKey() and then setLocalRegistrationId() for an identity type that the store already holds. After both calls, the record from getIdentityKey() and the value from getLocalRegistrationId() for that type must hold the new ID. A write of one identity type must not change the other type. The built-in stores already do this. To check a custom store, run assertLocalStoreConformance() from /local/store/conformance in your automated checks. assertLocalStoreConformance() does not check the sender-key handoff rows, the message records, or the send log. See adapters.
  3. SQLite stores: use a name that does not end in .oe2e-convert. The convertPlaintext conversion to encryption uses that ending for its temporary file. nodeStore(), expoStore(), reactNativeStore(), webSqliteStore(), and their reset functions refuse such a name with INVALID_STATE. See local storage.
  4. Remove your own group key transfer. For each group that the active device's group store lists, the link copies the master key into the linked device's group store. The link skips a listed group that has no master key. The copy runs in the calling process and sends no master key to the Relay. A client with groups on the linked device then fetches each copied group. It skips a group that groups.isGroupBlocked reports as blocked. It also skips a group when groups.isGroupBlocked throws. The application does not have to send each master key or call syncGroup() after the link. The SDK group store does not list a group that has only an older-format record. Any read or write of the group migrates the record to the current format and lists the group. On the active device, call getGroupInitStatus(groupId) once for each group ID that the application holds before the link. Use a client with groups whose group store is the store that the link copies from. hosted.onProgress reports the phase 'copying' for the 'device-link' operation before the copy. A switch statement on phase must handle 'copying'.
  5. Pass the active group store when a client runs during the link. The activeGroupStore option is the group store that the link copies from. The default is the SDK group store on activeDeviceStorage. If a client runs on the active device during the link, pass that client's group store, or stop that client first.
  6. Handle a rejected first sync. When the first sync of the linked client fails, linkHostedSignalProtocolRelayDevice() stops the client and rejects with OpenE2EE Signal Protocol Relay initial synchronization failed. Call linkHostedSignalProtocolRelayDevice() again with the same stores. The call resumes the link and gets the same device.
  7. Custom hosted.adapter: throw HostedSignalProtocolRelayHttpError for a Relay refusal. The package root and /client export the error. Give it the status, code, message, and retryable of the refusal. A refusal with retryable false and the code KEY_PROOF_INVALID or CONFLICT starts a rollback of the link. From SDK 14.6.0, a refusal with NOT_PRIMARY also starts a rollback. The rollback removes the link state and the copied groups. It keeps the identity records and the registration, so the next call sends the same registration ID. A completed link has no rollback. The call cannot tell whether the Relay accepted the link before the error, so throw this error only for a refusal of the link request. Every other error from the adapter keeps the link state, and the next call resumes the link.

A device that a 12.x release linked keeps its registration ID. A link that a 12.x release began and did not complete keeps its stored registration ID, and the next call registers the same device. Session records keep version 4, so the SDK reads the stored sessions of 12.x. The changelog lists each change.

Upgrading from 11.x to 12.0.0

12.0.0 is a major release. Every new session uses PQXDH, the managed device link replaces device provisioning, and a receive keeps its content until the application completes it. To upgrade from 11.x:

  1. Remove the classical fallback. 'required' is the only postQuantum value, and the SDK has no classical key agreement. postQuantum: 'compatible' throws Unsupported postQuantum policy at client creation. A peer bundle without an ML-KEM prekey fails with PQXDH_REQUIRED. PostQuantumPolicy.Compatible, allowClassicalFallback, ClassicalFallbackReason, usedClassicalFallback, classicalFallbackReason, and X3DH_INFO_DEFAULT are removed. PQXDHFallbackType and fallbackType are removed. Read PQXDHRequiredError.reason instead, which is no_kyber_prekey or pqxdh_failed. The X3DH module and its exports are removed. A stored 11.x classical session continues as a Double Ratchet session.

  2. Remove device provisioning. The SDK does not ship the device provisioning protocol. These names are removed: the ./device/provisioning subpath and all of its exports, PROVISIONING_SESSION_TTL_MS from ./device/constants, getDeviceMetadata from ./device/expo and ./device/react-native, ProvisioningService from ./remote/relay/types, and DeviceChoice.requiresQR. For the device fields of a transfer, use getTransferDeviceInfo().

    The managed device link is in the package root and ./client. In the two-device link, a new device with an empty store calls joinHostedSignalProtocolRelayAccount(), and device 1 calls approveHostedSignalProtocolRelayDeviceLink(). The account identity goes to the new device in an encrypted envelope, and the private keys that open it stay on the new device. The one-process link, linkHostedSignalProtocolRelayDevice(), needs the account identity in the new store from device transfer or an application channel. It sends no private key to the Relay. See multi-device.

  3. Custom relays: drop the provisioning methods. SignalProtocolRelayServer no longer has createProvisioningSession, connectNewDevice, sendProvisioningMessage, getProvisioningMessage, completeProvisioning, acknowledgeProvisioning, rollbackProvisioning, or deleteProvisioningSession. It extends only KeyRotationService. See adapters.

  4. Handle receive outcomes. processIncomingEnvelope() returns a ReceiveOutcome in place of the plaintext. Its kind is processed, pending, duplicate, null-message, denied, or refused. Acknowledge the envelope for each kind except refused. A refused outcome means that the receive queue has no room, so give the envelope again later. A processed receive keeps its content on the device until you call completeReceive() with its messageId, or until the onPersist option resolves. processIncomingEnvelopes() returns { envelope, outcome } or { envelope, error } for each envelope. decryptGroupMessage() is deprecated. See receive outcomes.

  5. Check the receive queue bounds. protocol.receiveQueue bounds the stored receives. maxItems is 3000 and maxBytes is 750 MiB by default. Stored content waits at most 30 days, and that age is fixed. Client creation refuses protocol.receiveQueue.maxAgeMs. The new onReceiveExpired hook reports content before the client drops it. A receive pass waits at most 2 minutes for each hook. Set receiveHookTimeoutMs when a hook can run longer.

  6. Check content recovery. protocol.contentRecovery decides whether the local store may keep the plaintext of a resendable message. The default mode, require-protected, keeps it only when the store is encrypted and its key is in an operating system keychain or a declared application vault. The IndexedDB store with the IndexedDB vault keeps its key in the same origin storage, so the default keeps no content there. A retry request for a direct message then resets the session with no content. Read contentRecoveryStatus for the decision. To keep content recovery on a web store, use a keychain or an application vault, or set allow-co-located-key after a product review. retentionMs sets the retention, at most 30 days.

  7. Handle the new retry ends and hooks. A retry request now ends 14 days after its first attempt. Before, it ended after 24 hours. A retry request is sealed when the client can seal it. RetryTerminalClass adds attempts-exhausted and membership-refused, so a switch over it must handle both. The new hooks are onDeliveryError, onDeliveryRecovered, onReceiveExpired, and onRelayProtocolError. SendResult adds refusedDestinationCount and syncPending. When syncPending is true, call send() again with the same clientMessageId to post the pending sync copies. See hooks.

  8. Custom local stores: implement the new contract. Client creation fails when the store declares no protection. The declaration must state what the store does, because it adds no encryption. The store must also implement these interfaces and methods:

    • the SendLogStore methods, and rewriteMessageRecords on MessageRecordStore
    • the six SenderKeyHandoffStore methods, with each row delete in the same write as the change that causes it
    • getReceiveWork, putReceiveWork, listReceiveWork, receiveWorkUsage, and completeReceiveWork, which replace getReceivedContent, deleteReceivedContent, and deleteExpiredReceivedContent
    • a receive record write in the same transaction as the session or sender key state
    • the removedAt field of a device record on SesameStore
    • getGroupReceiveRecord, updateGroupReceiveRecord, and listGroupReceiveRecords on GroupStateStore

    A custom key-value backend applies removeSenderKeyHandoffs inside atomicWrite. A custom KeyStorageOps adds clearSendLog(). The built-in stores already implement all of these. See adapters.

  9. Custom content adapters: add the new methods. SignalProtocolContentAdapter adds serializeContentWithGroupContext, withoutGroupContext, serializeContentBesideSenderKeyDistribution, and withoutSenderKeyDistribution. inspectContent reports groupContext and the required senderKeyDistributionOnly boolean. The default adapter implements them.

  10. Ask users to verify safety numbers again. Safety numbers order the two parties as libsignal does. For some identifier pairs, the displayed number differs from the 11.x number. The composite QR profile steps from version 3 to version 4, so a QR code from an 11.x client reports version_mismatch. SafetyNumberConfirmation.version steps from 1 to 2, and confirmSafetyNumber refuses a version 1 confirmation. Call verify() again and show the new safety number.

  11. Plan for a forward-only store. The SQLite schema moves to version 6 and the IndexedDB database to version 11. An earlier SDK refuses the SQLite file with SqliteSchemaTooNewError, and the browser refuses the IndexedDB open with a VersionError. The IndexedDB and key-value stores encrypt their metadata values at the first open. A downgrade is not supported. See local storage.

  12. Remove the dropped ratchet exports. The skipped-key cap now applies to each receiver chain, 2000 keys by default. countTotalMessageKeys and evictOldestMessageKey are removed. cleanupSPQRState and SPQR_CONFIG.MAX_SKIPPED_KEY_AGE are removed. trimEpochSkippedKeys(state, epoch) replaces trimSkippedKeys.

A removed device now keeps its record and its archived sessions, and it gets no fan-out. A send to a user whose devices are all removed fails with NO_DEVICES. The session record format stays at version 4. The changelog lists each change.

Upgrading from 9.5.0 to 10.0.0

10.0.0 reports each delivery by its source, and the Relay can take the delivery receipt. To upgrade from 9.5.0:

  1. Replace onDeliveryReceiptReceived with onDelivered. The new hook receives one DeliveredEvent for each new receipt source of each recipient device. It does not receive a sender ID and timestamps. Read clientMessageId and recipientDeviceId from the event. A Relay delivery receipt adds source: 'relay'. An E2EE receipt adds source: 'e2ee'. decryptionConfirmed is true only after an E2EE receipt. The DeliveredEvent and DeliverySource types are exported. See hooks.
  2. Remove unknown hook names. registerHook() and the hooks option of client creation now throw for a name that is not a hook. A removed or misspelled hook name therefore fails at registration. Remove onDeliveryReceiptReceived from each hooks option and each registerHook() call.
  3. Stop using IMPLICIT_ENVELOPE_TYPES and server_delivery_receipt. Both are removed. An envelope is implicit only when its contentHint is ContentHint.Implicit. Use isImplicitContentType() from ./client/constants to test an envelope. See package subpaths.
  4. Check the 'auto' delivery receipts. On the Signal Protocol Relay, deliveryReceipts: 'auto' now leaves the receipt to the Relay when it can. The client sends no E2EE receipt for an identified message that the Relay acknowledgment lists as receipted. A sealed message always gets the E2EE receipt. Only an E2EE receipt deletes the retry copy on the sender device. Set deliveryReceipts: 'always' to send an E2EE receipt for each message that asks for one. See delivery receipts.

The changelog lists each change.

Upgrading from 9.4.0 to 9.5.0

9.5.0 moves the retry request into the mailbox. To upgrade from 9.4.0:

  1. Receive pulled batches with receiveIncomingEnvelopes(). A retry request is now a retry_request envelope in the mailbox of the sender device. The relay subscription and receiveIncomingEnvelopes() handle it. processIncomingEnvelope() throws INVALID_CIPHERTEXT for it. A batch that goes through processIncomingEnvelopes() therefore never sends the resend. Remove each call to startRetryRequestSubscription(). The relay subscription carries retry requests. See offline and reconciliation.
  2. Custom relays: carry retry_request like any other envelope. SignalProtocolRelayServer no longer has sendRetryRequest or subscribeRetryRequests. Store and deliver an envelope with messageType: 'retry_request'. A relay that assigns its own envelope IDs must deliver the clientMessageId with the envelope on every delivery path. Envelope.operationEpochMilliseconds and a new last parameter of sendMultiRecipientUnidentified() carry the operation epoch of a post. See adapters.
  3. Without a relay: change the sendRetryRequest callback. ProcessEnvelopeOptions.sendRetryRequest received a RetryRequest in 9.4.0. It now receives a retry_request Envelope. Deliver that envelope to the sender device like any other envelope.
  4. Convex relay component: deploy the new component. The component no longer has a retry-request table, its cron, or its three functions.
  5. Custom content adapters: set nullMessage. InspectedSignalProtocolContent.nullMessage is now a required boolean. Set it on every inspectContent() result. Set it to true for your own null encoding. The default adapter sets it.
  6. Remove runPeriodicCleanup(). It cleaned only a map that the client no longer fills. Remove each call to it.

The changelog lists each change.

Upgrading from 8.2.0 to 9.0.0

9.0.0 is a major release. The public package now contains only client code. To upgrade from 8.2.0:

  1. Remove the /remote/relay/memory imports. The /remote/relay/memory entry is removed, with inMemoryRelay() and InMemorySignalProtocolRelayServer. The package contains no relay implementation. Use createHostedSignalProtocolClient() with a Sandbox environment of the OpenE2EE Signal Protocol Relay, or pass an application-owned SignalProtocolRelayServer to createSignalProtocolClient(). A test relay is your code: see testing encrypted flows.
  2. Convex R2: write the broker functions. The /remote/object-store/convex-r2/server entry is removed, with defineConvexR2ObjectStore(). Your Convex backend exports the four functions that ConvexR2ObjectStoreApi types. The @convex-dev/r2 peer is removed, because your backend mounts the component. See object store adapters.
  3. Remove the group server imports. The /groups/server entry is removed. The group server engine, the credential and certificate issuers, and the group administration CLI stay private. Group encryption, credential receipt, and presentation stay public.
  4. Reset group sender-key state. Sender Keys now use HKDF-Extract before HKDF-Expand. Sender-key state and distribution messages require senderKeyVersion: 'v2', and signed frames require version byte 0x44. Old state, distributions, and frames fail closed. Before you upgrade, discard queued group sends and reset group sender-key state on every device. Then redistribute keys with upgraded peers. The SQLite stores discard skipped keys from the old schema.
  5. Custom local stores: update the skipped Sender Key contract. Apply SenderKeyReceiveCommit.skippedKeys atomically with the record. Add senderKeyId to skipped-key lookup, storage, and deletion. SenderKeyReceiveCommit.consumedSkippedKey now carries the identifier and index. A custom key-value backend implements pruneSkippedSenderKeys inside atomicWrite.

The fix for overlapping Braid sessions does not change the wire format or the persisted state format. The changelog lists each change.

Upgrading from 7.2.0 to 8.0.0

8.0.0 is a major release. To upgrade from 7.2.0:

  1. React Native and Expo: install a global random source. Install react-native-get-random-values 2.x or react-native-quick-crypto, and load it before the first SDK call.
  2. Pass a secret vault. The profile key, the device ID, the device-lifecycle state, and the key-value store's value key live in a SignalProtocolLocalSecretVault that your app passes. A call without one throws SECRET_VAULT_REQUIRED. Bare React Native apps can use /local/vault/react-native-keychain, Expo apps /local/vault/expo-secure-store, and Electron apps /local/vault/electron-safe-storage.
  3. Key-value store: change the import and the names. The store moves from /local/store/react-native to /local/store/key-value, and its names drop the ReactNative prefix. To keep existing data, move its value key into the vault before the first open.
  4. Bare React Native: /local/store/react-native is now the SQLite store. reactNativeStore() opens an SDK-owned SQLCipher database on the optional peer @op-engineering/op-sqlite 18.2.5 or later, with the op-sqlite SQLCipher build turned on.
  5. Expo: await the store. Replace expoStore() with await expoStore(). The SDK owns the database, its schema, and its key.
  6. Node and Electron: open the new SQLCipher store. nodeStore({ directory, vault }) opens an SDK-owned SQLCipher database on the optional peer better-sqlite3-multiple-ciphers 13.0.3 or later. It does not read the files of the 7.2.0 Node store.
  7. Remove the deleted names. The /local/store/expo/db and /local/store/expo/schema entries, the Expo database and key functions, the profile-key storage functions, createReferenceReactNativeBackend, and the drizzle-orm, expo-crypto, and fs-native-extensions peers are removed.
  8. Signal Protocol Relay: copy the connection URL from the Console again. The API path and the developer environment kind changed, and the sandbox and staging hosts have new names.

Browser apps can also use the new /local/store/web-sqlite store. It is optional, and the IndexedDB store stays at /local/store/web. In 8.0.0 the web SQLite store is experimental. From 8.1.0, it is supported, and it is the store for browsers where the origin private file system works. The changelog lists each change.

Persisted formats: reset, not migrated

Session records carry a format version. The current version is 4, and the SDK's storage boundary requires "rejection of stale-format writes before replacing current state" and "removal or rejection of stale persisted session records on read."

The rule is direct: the SDK rejects and resets older session formats instead of migrating them.

Here is what that means in a deployed application. A user upgrades. On the next read of an older session record, the SDK discards it instead of updating it in place. The session is gone. The next message to or from that peer establishes a fresh session from a prekey bundle.

What the user experiences:

  • The user cannot send to that peer until a bundle fetch succeeds. The relay must be reachable for this fetch.
  • Messages that were in flight under the old session, encrypted before the reset, become undecryptable. Depending on your handling they surface as SESSION_NOT_FOUND or DECRYPTION_FAILED.
  • On the peer's side, a new session establishment from someone they already had a session with. If your product surfaces session resets to users, this looks like an event. If it does not, it is invisible.

What the user does not experience: an identity change. A session reset does not rotate identity keys and does not void safety numbers. Verification survives. Say this explicitly in whatever notice you show, because "your session was reset" reads to a security-conscious user like "you were attacked" unless you distinguish the two.

Before an upgrade changes a persisted format, plan for many users to lose sessions on the same day. The resulting bundle-fetch burst can reach your relay at once.

Protocol policy

The defaults are postQuantum: 'required' and braid: 'required'. Required mode means post-quantum session establishment and the post-quantum message ratchet are both mandatory, and a peer with no post-quantum material fails closed. That failure surfaces as PQXDHRequiredError.

const client = await createSignalProtocolClient({
  identity: { userId },
  adapters: { storage, relay },
  protocol: { postQuantum: 'required', braid: 'required' },
});

'required' is the only postQuantum value. The SDK has no classical key agreement, and no setting allows a classical X3DH session. Version 12.0.0 removed the classical fallback with no replacement, and postQuantum: 'compatible' throws Unsupported postQuantum policy at client creation. A stored 11.x classical session continues as a Double Ratchet session.

braid: 'disabled' keeps post-quantum establishment required and uses the direct ML-KEM SPQR mode instead of the Braid profile. The documentation defines it as an explicit escape hatch for product-reviewed constraints, not downgrade recovery. There is no public postQuantum: 'disabled' mode.

Spec revision pins

The profile pins specific published revisions instead of "the Signal Protocol" in general.

SpecificationRevision
X3DH, for the shared DH steps of PQXDHRevision 1, 2016-11-04
PQXDHRevision 3, 2023-05-24 (last updated 2024-01-23)
Double RatchetRevision 4, 2025-11-04
SesameRevision 2, 2017-04-14
ML-KEM BraidRevision 1, 2025-02-21 (last updated 2025-09-26)

When a pin changes in a future release, read the release notes carefully. A revision change can alter wire behavior or persisted shapes.

There is no wire compatibility with Signal Messenger

This matters when someone in your organization hears "upgrade" and thinks "interoperate."

"Public keys and ciphertexts require exactly 0x0A || raw ML-KEM-1024 bytes." And: "The 0x0A encoding is distinct from Signal Messenger deployments that use round-3 Kyber1024 tagged 0x08."

Untagged values, the 0x08 tag, unknown tags, and wrong lengths fail before secret derivation or state commit. This is a deliberate, checkable difference, not an accident of version drift, and no future release turns it into interoperability. Signal Protocol is the published specification family. Signal Messenger is an unaffiliated product. Upgrading this SDK never means talking to it.

Rolling upgrades across a device population

Your users do not upgrade at once. App-store rollout, corporate MDM, and delayed user updates create a mixed population. The two ends of a session can use different versions.

INVALID_CIPHERTEXT is the code you see when a client receives a message it cannot parse at the protocol version it implements. The SDK raises it and fails closed. It does not negotiate down, and it does not decide what your product should do about it. processIncomingEnvelope() also raises it for a retry_request envelope. That is not a version mismatch. Give that envelope to receiveIncomingEnvelopes().

Retry requests do not cross the 9.5.0 boundary. A 9.4.0 client does not handle a retry_request envelope. A 9.5.0 client has no retry subscription. It therefore does not get the retry requests of a 9.4.0 client. A message that fails to decrypt between a 9.5.0 device and an older device therefore gets no resend.

The application owns version-negotiation policy. That is a product decision with real options and no SDK default:

  • Publish a minimum supported version and refuse to run below it, with a forced-update screen. Clean, and it locks out users you may not be able to reach.
  • Accept the split and surface an honest per-conversation message when a peer's client is too old. Keeps everyone running, adds a support category.
  • Stage the rollout so that the receiving capability ships in an earlier release than the sending behavior that requires it. More release cycles, far fewer broken conversations.

Most teams select the third option after they try the first. If a release changes sent data, ship the receive capability one release earlier. Enable sending after telemetry shows that the receiving version reached the target population. client.getStats() and your version reporting provide the required data.

Rollback has two practical constraints. The SDK does not support downgrading a device after it writes version: 4 session records. An older build rejects the newer format, just as a newer build rejects an older format. After a 12.0.0 client opens a store, an earlier SDK cannot open it. See the 12.0.0 store steps. An upgraded peer does not have to communicate with a peer that rolled back. Treat SDK upgrades as forward-only for each device. Use feature flags, not package versions, for rollback safety.

Upgrade checklist

  • Read the release notes for changes to the spec revision pins table.
  • Check whether the session record version changed. If it did, expect population-wide session resets and a bundle-fetch burst.
  • Confirm your outbound queue survives a period with no establishable session.
  • Confirm INVALID_CIPHERTEXT from a malformed message reaches a user-facing state, not a silent drop. Give pulled batches to receiveIncomingEnvelopes(), so a retry request from a peer never surfaces as this error.
  • Verify your protocol policy is still what you intended. No setting suppresses PQXDHRequiredError. Its reason is no_kyber_prekey or pqxdh_failed.
  • Stage receive-then-send if the release changes the outbound format.
  • Re-run the failure-path suite in testing against the new version before rollout.

Opacity ledger

ArtifactStays on deviceSent to relayIn object storeVisible as metadata
Session record (version: 4)yesnonono
Stale-format session recorddiscarded on readnonono
KyberPreKey public half (0x0A-tagged)yesyesnotag and length are visible
SDK version in useyesyour telemetry onlynonot carried by the protocol
INVALID_CIPHERTEXT occurrenceyesnonosafe as a counter
Message plaintextyesnonono

Next

On this page