Repository navigation
v6.0.0
-
Breaking: the
SignalProtocolRelayServercontract requires the relay
connection state.SignalProtocolClientgains therelayConnectionState
getter andsubscribeRelayConnectionState(listener), which returns an
Unsubscribe. TheRelayConnectionStatetype has astate(stopped,
connecting,connected, orreconnecting), asincetime, and on
reconnectingareason(handshake,protocol,closed,error,
frame,authentication, orsilent). The reason names the site that
failed, never an error message. The state readsstoppedbefore
startRelaySubscription()and afterstopRelaySubscription(). A token
renewal emits nothing unless its new socket fails, and the same value never
emits twice.SignalProtocolRelayServerrequires both members, so a custom
adapter must implement them. The memory and Convex adapters report
connectedandstoppedonly. The state is local to this device and is not
presence. -
New:
useRelayConnectionStateanduseRelayLifecyclehooks, and
bindRelayLifecycle.useRelayConnectionState({ signal })gives the
state to a component for a local indicator.bindRelayLifecycle(signal, appState, { keepOpenInBackground })from./clienttakes an object with the
shape of React Native'sAppState, so the client entry imports no
react-native.useRelayLifecycle({ signal, keepOpenInBackground })from
./hookspassesAppStateto it and does nothing on web. -
Behavior change: the lifecycle binding closes the socket in the
background. WithbindRelayLifecycleoruseRelayLifecycle,background
callsstopRelaySubscription(), which closes the socket with code 1000.
activestarts the subscription again after that stop, and the Relay
replays retained messages over the new socket.inactivechanges nothing,
and there is no grace delay. A stop that the app made stays in effect.
keepOpenInBackground: truekeeps the socket open, for example while an
Android foreground service runs. -
Behavior change: the hosted subscription gives up on a silent socket at
60 s. The ping watchdog reconnects 60 s after the open or after the last
answered ping, not 90 s. The Relay closes a silent socket at 75 s, so the
client now gives up first.