Loads a session under the caller's identity and enforces ownership: UserID === contextUser.ID, then the
scope rule of AuthorizeSessionAccess (every anonymous visitor shares one Anonymous user, so the
session's conversation ExternalID must equal the caller's scope identity). It deliberately does NOT
reject Closed sessions: the final channel-state flush and the recording terminal signal legitimately
arrive after the session closed. Loading as the caller also applies the entity's row-level security.
RealtimeSessionNotFoundError when the row does not load
Throws
RealtimeSessionOwnershipError when another user owns the session (logged with both user ids) or
the scope rule refuses the caller (logged with the refusal reason)
Loads a session under the caller's identity and enforces ownership:
UserID === contextUser.ID, then the scope rule of AuthorizeSessionAccess (every anonymous visitor shares one Anonymous user, so the session's conversationExternalIDmust equal the caller's scope identity). It deliberately does NOT rejectClosedsessions: the final channel-state flush and the recording terminal signal legitimately arrive after the session closed. Loading as the caller also applies the entity's row-level security.