ORISO Dokumentation
Design & Quality

Edge Cases & Scenarios

Failure modes, race conditions and abuse scenarios across the live-chat, session, link and admin flows — and how ORISO is designed to handle each.

Each edge case below has a trigger, an expected behaviour, and a risk if mishandled. Most are direct echoes of the issues raised in the Frank↔Nikunj huddle.

9.1 Client Edge Cases

9.1.1 Client closes the tab in the waiting room

TriggerClient tab close, navigation away, network drop, OS sleep > heartbeat threshold
ExpectedHeartbeat times out (~90 s) → ticket → Abandoned → Keycloak anonymous user wiped → ticket row deleted → queue counter decremented for everyone behind
Risk if mishandled"Phantom client" pile-up (the bug Frank described in the huddle). Counselors see nothing-burgers and the queue lies.
TestOpen waiting room, close tab; within ~2 min the ticket disappears from the counselor's view.

9.1.2 Client closes mid-active chat

TriggerTab close during active chat
ExpectedHeartbeat lost → session → Paused; if no resume in 5 min → Ended; Megolm keys lost from client side; counselor still sees the chat history (≤ 48 h); session metadata anonymized; client cannot re-enter
Risk if mishandledCounselor stuck with a "ghost" active session blocking their availability
TestActive chat → close tab → counselor sees "client disconnected" within 5 min

9.1.3 Client refreshes the tab

TriggerF5 / pull-to-refresh in the waiting room or chat
ExpectedNew cookie, new pseudonym, new ticket. Old one is orphaned and purged on heartbeat-loss timeout. Client cannot rejoin the previous session.
Risk if mishandledClient's identity persists across refreshes (privacy violation)
TestF5 in waiting room → pseudonym changes; old ticket disappears within ~90 s
TriggerURL hand-edited; agency deleted; topic disabled
ExpectedFriendly "currently unavailable" page with a CTA to the platform-wide enquiry; no anonymous user created; no error noise in logs
Risk if mishandledConfusing 500 / 404 / blank page; potentially a backend crash
TestVisit /live-chat/no-such-agency; lands on graceful page
TriggerCounselor accepted the ticket, client clicks "Reject" on the center-level GDPR popup
ExpectedTicket → Abandoned; anonymous user wiped; Matrix room never finalised; counselor sees "client declined"
Risk if mishandledChat opens without consent → legal liability
TestAcceptance flow → reject GDPR → counselor's queue updates within seconds

9.1.7 Client deletes self during active video call

Direct Figma question: "what happens when a user deletes himself during a video call (if he is the initiator)"

TriggerA client is the initiator of an active LiveKit call and clicks "Konto löschen" / closes their tab during the call
Expected(1) LiveKit session continues for remaining counselors. (2) Initiator role transfers to the next counselor by joined_at ASC. (3) The client's pseudonym is wiped within ~90 s. (4) System message in chat: "Ein Teilnehmer hat das Gespräch verlassen." (5) If no counselor remains in the room, LiveKit ends the call gracefully and the chat returns to text-only state.
Risk if mishandledCounselors stuck on a frozen call; client identity persists past disconnect; LiveKit room becomes a billing leak.
TestE2E: client initiates call → client deletes self → call survives among counselors; if last person leaves, call dies; client identity wiped.

9.1.8 Client deletes self from group chat

Direct Figma question: "What happens if a client deletes himself from a group chat?"

TriggerA client clicks "leave group" or deletes their account while in a group room
Expected(1) Pseudonym wiped immediately. (2) Their existing messages remain in the room with author label "Ehemaliger Teilnehmer" — bodies stay E2EE; pseudonym is no longer linked to a Keycloak user. (3) System message "{pseudonym} hat den Chat verlassen." (4) If the client was the only advice-seeker in the group, the room is auto-archived and counselors notified. (5) If other clients remain, the group continues normally.
Risk if mishandledClient identity lingers in a group; or messages disappear and the group context becomes confusing.
TestE2E: 1 client + 2 counselors group → client leaves → counselors see system message + author label change; group persists.

9.1.9 Client opts in to email mid-session

TriggerClient adds an email after the chat has started
ExpectedEmail is stored encrypted, visible only to Platform Admin; counselors do not see it; first verification email is sent; future notifications mirror to email
Risk if mishandledCounselor sees the client's email in any UI surface

9.1.10 Multi-Recipient send: one recipient is a wiped client

TriggerCounselor sends a message addressed to "+ Sasha (client)" but Sasha has just disconnected
ExpectedServer-side relay rejects the recipient with "user no longer in room"; counselor sees a fallback chip "delivery skipped: 1 user".
Risk if mishandledMessage body cached pending Sasha's return → privacy violation

9.1.11 Blur removed by mistake

TriggerCounselor clicks the eye toggle, then sends without re-blurring
ExpectedConfirmation dialog: "PII blur is disabled — send anyway?" before send completes
Risk if mishandledClient sees what should have been blurred

9.1.6 Browser without cookies / private mode (lockdown)

TriggerBrowser with cookies disabled
ExpectedShow clear instruction: "ORISO requires a session cookie. Cookies are deleted with you when you leave."
Risk if mishandledSilent failure; client thinks the system is broken

9.2 Counselor Edge Cases

9.2.1 Counselor goes offline mid-pickup

TriggerCounselor accepted a ticket but disconnected before client gave consent #2
ExpectedHeartbeat timeout → ticket reverts to Waiting and goes back into the queue; client either picked again or wipes if too long passes
Risk if mishandledLost ticket, lost client
TestAccept ticket → kill counselor browser → ticket reappears in the queue

9.2.2 Two counselors race to accept

TriggerSame ticket clicked by two counselors within milliseconds
ExpectedDatabase row-lock; first wins → ticket Accepted; second sees "already taken" toast; no double-room creation
Risk if mishandledDuplicate Matrix rooms, duplicate consent prompts to the client
TestConcurrency test: two clients call POST /live-chat/accept for the same id → one HTTP 200, one HTTP 409

9.2.3 Counselor flips Live Chat OFF mid-session

TriggerCounselor toggles availability OFF while in an active session
ExpectedActive session continues to completion; no new tickets are routed to this counselor; the toggle UI shows "OFF after current chat ends"
Risk if mishandledActive client orphaned mid-conversation

9.2.4 Counselor with no agency assignment

TriggerKeycloak consultant role exists but the user has no ConsultantAgency row
ExpectedThe user is invisible on the app layer (per huddle: "a counselor is not visible without a counseling center"); their dashboard shows an info banner asking to be assigned
Risk if mishandledTickets can never reach this counselor; or worse, they appear in the queue but cannot be picked up

9.2.5 Supervisor joins a session

TriggerA supervisor-consultant invites themselves to a colleague's room
ExpectedSystem message visible to all members: "Supervisor X has joined for QA review"; audit row written; supervisor can read messages but appears in the participant list
Risk if mishandledSilent observation → privacy violation

9.3 Admin / Tenant Edge Cases

9.3.1 Tenant tries to create an agency before signing data policy

TriggerTenant Admin clicks "Create center" without tenant.data_policy_signed_at set
ExpectedButton disabled with tooltip "Sign the platform data policy first"; route returns HTTP 403 if force-called
Risk if mishandledCenters operating without legal cover

9.3.2 Tenant attempts to access another tenant's data

TriggerURL tampering, API tampering, JWT replay
ExpectedTenant filter at the persistence layer rejects the query (HTTP 404, not 403, to avoid information leakage); audit log records the attempt
Risk if mishandledCross-tenant data leak — catastrophic

9.3.3 Platform Admin disables a tenant

TriggerPlatform Admin sets tenant.disabled_at
ExpectedAll centers under that tenant become read-only; counselors cannot accept new tickets; existing active sessions are allowed to finish; live-chat links return "currently unavailable"; tenant data preserved (not deleted)
Risk if mishandledMid-conversation hard cuts → bad UX
TriggerSame magic link clicked twice
ExpectedFirst click: registration succeeds, consumed_at set in Redis; second click: HTTP 410 "link already used" page
Risk if mishandledTwo users could claim the same role
TriggerClick after 24 h
ExpectedFriendly expiry page; "Request a new invite" CTA pointing to the inviter
Risk if mishandledConfusing JWT error
TriggerCounselor Admin disables the link mid-session
ExpectedActive sessions continue; new visits to the link see "currently unavailable"
Risk if mishandledHard-cut active sessions
TriggerOld link without ?topic= parameter
ExpectedFalls back to agency-wide queue (any topic); soft-warning logged; consider asking the user to pick a topic
Risk if mishandled500 error or silent topic mismatch

9.4.3 Zip code spans multiple agencies

TriggerClient types 10115; three agencies cover it
ExpectedShow a list with descriptions; client picks; if a topic was supplied, list is filtered
Risk if mishandledAuto-routing to a random agency → wrong counselor / wrong language
TriggerCurl loop, scraper, accidental retry
ExpectedIngress-level rate limit kicks in; HTTP 429; counselors are not bothered with bot tickets; in-memory IP counter (never persisted) used for the limit
Risk if mishandledReal clients get pushed out of the queue

9.4.5 Cross-tenant slug collision attempt

TriggerTwo tenants try to claim the same agency slug
ExpectedSlugs are unique per tenant; the public URL form includes the agency slug only; the tenant is resolved server-side from the agency owning the slug

9.5 Chat / Real-Time Edge Cases

9.5.1 Network split mid-message

TriggerBrief network outage; message in flight
ExpectedMatrix client retries with exponential backoff; once reconnected, message arrives in order; UI shows "sending…" indicator for delayed messages

9.5.2 Key loss (Megolm)

TriggerCounselor cleared browser cache mid-day; old messages can't decrypt
ExpectedCounselor sees "encrypted message — key not available" placeholder; expected behaviour consistent with the privacy model
Risk if mishandledCounselor thinks the system is broken; do not invent a server-side key escrow

9.5.3 Massive queue overload

Trigger500 simultaneous clients in the waiting room
ExpectedQueue counter scales correctly via Redis; old auto-deletes still happen on schedule; counselors are shown realistic ETA hints
Risk if mishandledDB row count explodes; cleanup job lags; queue numbers go stale

9.5.4 Failed Matrix room creation

TriggerSynapse temporarily unhealthy
ExpectedUserService retries 3× with backoff; on persistent failure, ticket is returned to queue and the counselor sees a clear error
Risk if mishandledTicket marked Active without a room; client stuck

9.6 Failed Transcription / AI Path (Planned)

Even though the AI path is not yet built, the failure modes to design for:

TriggerExpected
AI summarizer downCounselor falls back to manual note; UI shows graceful degradation
AI returns suspicious content (PII surfaced)Pre-display PII detector blocks the suggestion
Counselor edits the AI noteSave the edited version only; do not retain the unedited AI output
Network drop during summarizationRetry once; on second failure, fall back to manual

9.7 Operational / Security Edge Cases

ScenarioExpected
Keycloak running in dev modeHard alert. Block deploy via CI guard. Reinstated rule after 2026 incident.
External pen-test attempts session enumerationAll session ids are UUIDv4; tenant scoping makes enumeration useless
Backup file leakedPseudonyms aren't PII; messages are E2EE; staff data is column-encrypted; impact is bounded
Realm.json drift between dev and prodYearly external audit + CI diff alarm
MFA factor lost (admin)Recovery flow via Platform Admin out-of-band; no self-service reset for admins

9.10 Handover Edge Cases

TriggerExpected
Counselor B refuses handoverTicket returns to agency pool with "needs handover" flag
Client refuses handoverSession ends gracefully; client wiped
Reason law_violation selected by mistakeAction is irreversible from counselor; only Platform Admin can recall (with audit)
Active group chat handoverOnly Counselor A's seat is swapped; other members untouched
Cross-agency handover attemptedAPI returns 403 with "out of scope"
Active video call during handoverCall gracefully ended first, then handover proceeds
GDPR-#2-pending state during handoverHandover denied; ticket returns to queue instead

9.11 Group-Chat Edge Cases

TriggerExpected
Inviter exceeds admin-policy member capUI shows tooltip; API returns 403
Counselor invites a non-permitted user (e.g. cross-agency)API returns 403
Group disabled platform-wide while a group is activeExisting groups become read-only; no new groups can be created
Schedule conflict for a live round (live Mo 9.Sep 2026 um 18:00 Uhr)UI prompts to reschedule; reminder notifications go out 24 h, 1 h, and 5 min before
Group deleted by accidentSoft-delete (archive) by default; hard-delete only via Platform Admin with audit row

9.12 AI / Annotation Edge Cases

TriggerExpected
AI summarizer downButton greys out; counselor falls back to manual note
AI returns content that includes residual PIIBrowser-side post-filter scrubs again before display; flag for engineering
Mark exists on a message that gets redactedAnnotation orphan → garbage-collected on next render
Receiver's client too old to render annotationsBanner: "This message contains content the counselor wished to blur — please disregard"

9.13 Notification & Escalation Edge Cases

TriggerExpected
Notification fired for a wiped pseudonymSilently dropped
Email mirror requested but no email capturedUI explains opt-in is unavailable until email added
External escalation timed out (24 h)Cancelled silently; nothing leaves the system; counselor informed
Help Request to a counselor on holidayFalls back to next-up Supervisor in the agency

9.8 Compact "What Happens If…" Cheat Sheet

If…Then…
Client leaves waiting roomWipe within ~90 s
Client closes mid-chatPause; end after 5 min idle
Counselor disconnects pre-consentTicket back to queue
Two counselors accept same ticketOne wins, one sees "already taken"
Live-chat link disabled mid-sessionActive continues; new visits blocked
Tenant disabledRead-only; active sessions finish
Magic link reusedHTTP 410
Browser cookies offFriendly explainer
Queue counter inconsistentRedis Pub/Sub re-derives from DB on next event
Client deletes self mid-video-call (initiator)Call survives among counselors; initiator role transfers; client wiped
Client deletes self from groupPseudonym wiped; messages remain under "Ehemaliger Teilnehmer"; group auto-archived if last advice-seeker
Counselor blurs PII then unblurs by mistakeConfirmation dialog before send
Multi-recipient send to a wiped recipient"delivery skipped" chip; no message body cached
Email opt-in mid-sessionStored privileged-access only; counselors never see
Handover Counselor B refusesTicket returns to pool with "needs handover" flag

Auf dieser Seite

9.1 Client Edge Cases9.1.1 Client closes the tab in the waiting room9.1.2 Client closes mid-active chat9.1.3 Client refreshes the tab9.1.4 Client supplies a malformed live-chat link (bad slug / topic)9.1.5 Client refuses GDPR consent #29.1.7 Client deletes self during active video call9.1.8 Client deletes self from group chat9.1.9 Client opts in to email mid-session9.1.10 Multi-Recipient send: one recipient is a wiped client9.1.11 Blur removed by mistake9.1.6 Browser without cookies / private mode (lockdown)9.2 Counselor Edge Cases9.2.1 Counselor goes offline mid-pickup9.2.2 Two counselors race to accept9.2.3 Counselor flips Live Chat OFF mid-session9.2.4 Counselor with no agency assignment9.2.5 Supervisor joins a session9.3 Admin / Tenant Edge Cases9.3.1 Tenant tries to create an agency before signing data policy9.3.2 Tenant attempts to access another tenant's data9.3.3 Platform Admin disables a tenant9.3.4 Magic invite link reused9.3.5 Magic link expired9.4 Live-Chat Link / Pincode Edge Cases9.4.1 Link disabled while client is on the page9.4.2 Topic missing on link9.4.3 Zip code spans multiple agencies9.4.4 Bot floods the live-chat link9.4.5 Cross-tenant slug collision attempt9.5 Chat / Real-Time Edge Cases9.5.1 Network split mid-message9.5.2 Key loss (Megolm)9.5.3 Massive queue overload9.5.4 Failed Matrix room creation9.6 Failed Transcription / AI Path (Planned)9.7 Operational / Security Edge Cases9.10 Handover Edge Cases9.11 Group-Chat Edge Cases9.12 AI / Annotation Edge Cases9.13 Notification & Escalation Edge Cases9.8 Compact "What Happens If…" Cheat Sheet