Session
Purpose
A member's signed-in seat in one conversation — everything the surface needs to read and write on their behalf, gathered in one place so the contexts above it speak of "the session" the way a person does. The seat holds who the member is, which conversation they are in, the epochs of it their device has unsealed, and their opened ring. It holds no judgement: whether the member may still write is their ring's business at the moment of sending, and a removed member's session is still a session — they keep reading what they could already read.
Attributes
- member: the signed-in
Member - conversation: the
Conversationthis seat is in - revisions: the
GroupRevisionsof the conversation's lineage the member's device has unsealed — the epochs, and so the names and keys, this seat can read by - ring: the member's
KeyRing, opened
Invariants
- The session holds at least one unsealed revision — a seat in a conversation the member cannot read at all is not a seat.
- Every revision the seat holds is of the conversation's lineage — a seat is a seat in one conversation; another lineage's epochs are another seat's business.
Scenarios
A seat gathers the member's standing
Given: the Member sofie.lind shown as "Sofie Lind", the Conversation "conv-7421" of lineage "g-7421", one unsealed GroupRevision "g-7421.3" of lineage "g-7421" under key id "k-0163" naming sofie.lind among its members, and sofie's opened ring holding the GroupKey "k-0163"
When: a Session is created
Then: it is accepted and reads back as sofie.lind's seat in "conv-7421" with that revision and that ring
A seat with nothing readable is refused
Given: the Member sofie.lind shown as "Sofie Lind", the Conversation "conv-7421", no unsealed revisions, and sofie's opened ring holding nothing
When: a Session is created
Then: the creation is rejected because the seat holds no unsealed revision
A seat holding another conversation's epochs is refused
Given: the Member sofie.lind shown as "Sofie Lind", the Conversation "conv-7421" of lineage "g-7421", unsealed GroupRevisions "g-7421" of lineage "g-7421" naming sofie.lind and "g-9001" of lineage "g-9001" naming sofie.lind, and sofie's opened ring
When: a Session is created
Then: the creation is rejected because "g-9001" is not of the conversation's lineage — another lineage's epochs are another seat's business