4.3 KiB
MODIFIED Requirements
Requirement: Lifted keys and room resolution
Edition: CE and PRO. Every document SHALL carry lifted references resolved from the event: ROOM_CREATED
from room.sid, egress events from egress.room_id and egress.room_name, ingress events from
ingress.state.room_id, which the server fills from the active room of ingress.room_name when the ingress reports
none, and ingress.room_name, track events from the minimal room {sid, name}; a missing room leaves the reference
absent.
Scenario: ROOM_CREATED without room_id
- GIVEN a
ROOM_CREATEDevent with emptyroom_id,room.sid = "RM_x"androom.creation_time_ms - WHEN it is projected
- THEN the
roomsdocument has_id: "RM_x"andcreatedAtfromcreation_time_ms, and the raw event hasroomSid: "RM_x"
Scenario: Egress before any room event
- GIVEN an
EGRESS_STARTEDwithegress.room_idandegress.room_nameand no prior room event - WHEN it is projected
- THEN the
egressesdocument and the raw event carryroomSidandroomName, and theroomsdocument is upserted withfeatures.egress: trueand its egress counter
Scenario: Web egress without room
- GIVEN a web egress with empty
room_id - WHEN it is projected
- THEN
roomSidis absent from the egress document and the raw event, and noroomswrite model is produced
Scenario: Ingress session key
- GIVEN an
INGRESS_STARTEDwithingress.state.resource_id - WHEN it is projected
- THEN the
ingress_sessionsdocument has_idequal toresource_id,ingressIdandroomSidfromstate.room_id, and the raw event hasingressSessionId
Scenario: Ingress publishing before its state names the room
- GIVEN an ingress of room
qa-ingress, active asRM_x, whose service sends the publishing state withoutroom_id - WHEN the server handles the state update and the writer projects its
INGRESS_STARTED - THEN the event carries
state.room_id: "RM_x", theingress_sessionsdocument hasroomSid: "RM_x"while it publishes, and the room counts the session as active
Scenario: Ingress of a room that is not active
- GIVEN an ingress whose state has no
room_idand whose room name has no active room - WHEN the server handles the state update
- THEN the state keeps no
room_idand the session document has noroomSiduntil an event names the room
Scenario: Subscriber identity resolved
- GIVEN a participant session
PA_1already projected with identityalice - WHEN a
TRACK_SUBSCRIBEDwithparticipant {sid: "PA_1"}andpublisher {sid, identity}is processed - THEN the subscription has
subscriberIdentity: "alice",publisherSidandpublisherIdentityfrompublisher
Requirement: Rollup counters from events
Edition: CE and PRO. Each projected event SHALL increment the hourly and daily counters of its UTC bucket in both scopes, and its 5-minute lifecycle counters, once: an event stored raw counts only when its raw insert succeeds, so an event already stored by a previous process never counts again; an event not stored raw counts when it is projected; an in-process retry never reapplies a rollup step that succeeded. Map keys SHALL be enum names or a fixed vocabulary, never user input.
Scenario: Batch retried after a transient error
- GIVEN a batch whose raw inserts succeeded and whose rollup step failed with a network error
- WHEN the batch is retried
- THEN raw inserts are skipped as duplicates, the rollup step is applied once and the counters equal the event counts
Scenario: Replayed events from another process
- GIVEN events already stored by a previous process
- WHEN they are processed again
- THEN the rollup counters are unchanged
Scenario: Vocabulary keys
- GIVEN a
PARTICIPANT_JOINEDwithclient_info.sdk: JS,os: "Windows 11"andbrowser: "Chrome 130" - WHEN it is projected
- THEN the hourly rollup increments
participants.bySdk.JS,participants.byOs.windowsandparticipants.byBrowser.chrome, and a value outside the vocabulary incrementsother
Scenario: Session without a browser
- GIVEN a
PARTICIPANT_JOINEDwithclient_info.sdk: GOand an emptybrowser - WHEN it is projected
- THEN the hourly rollup increments
participants.byBrowser.none, notparticipants.byBrowser.other