Skip to content

Class: UnpersistedSenderKeyStateError

Defined in: rine-core/dist/src/crypto/sender-key-seal.d.ts:30

A group send handed a sender key that is on no disk this agent owns.

encryptGroupMessage writes the state it advanced back IN PLACE and writes nothing at all when the row is gone, because gone means RETIRED: a rotation dropped it, or a group leave removed the file. Both are silent on purpose. This is the third case, and it is none of the agent's history — the file names no key of this agent's at all and the group is not retired, so nothing ever persisted the state the caller passed in.

That is a caller defect, not a race, and it is silent in the worst way: the message is sealed and transmittable while the ratchet advance and the self-read cache it produced go nowhere. The sender cannot re-read its own post, and the next send under a freshly minted key starts from message index zero again. Every in-repo caller takes its state from getOrCreateSenderKey, which persists before returning — but encryptGroupMessage, generateSenderKey and saveSenderKeyState are all in the public @rine-network/core barrel, so composing the first two without the third is a shape any consumer can produce, so it is refused here rather than sealed.

🔴 One narrow race reaches this refusal honestly: a leave lifts its own retirement marker on re-admission (liftRetirementIfMember), so a send whose fan-out spans leave → rejoin → another send's lift can arrive here with neither the file nor the marker. It is refused rather than guessed at: the alternative is the silent discard above, and the send is retried honestly against the state the rejoin wrote.

Extends

  • Error

Constructors

Constructor

new UnpersistedSenderKeyStateError(senderKeyId, groupId): UnpersistedSenderKeyStateError;

Defined in: rine-core/dist/src/crypto/sender-key-seal.d.ts:33

Parameters

Parameter Type
senderKeyId string
groupId string

Returns

UnpersistedSenderKeyStateError

Overrides

Error.constructor

Properties

Property Modifier Type Defined in
groupId readonly string rine-core/dist/src/crypto/sender-key-seal.d.ts:32
senderKeyId readonly string rine-core/dist/src/crypto/sender-key-seal.d.ts:31