Close an expired live chat session and apply the general reopen rules

A background job closes visitor sessions that have been inactive past the configured timeout. Closing a session never changes the conversation's status by itself — what happens when the visitor comes back later follows the platform's normal reopen rules, exactly as for any other channel.

When this happens: LiveChatSessionExpiryJob runs (every 5 minutes).

How it works

  • LiveChatSessionExpiryJob selects VisitorSession rows with Active and ExpiresAt < now.
  • Sets Expired and invalidates any outstanding visitor hub token for that session, closing the hub connection if still open.
  • Leaves Conversation.Status untouched — a conversation an operator left Waiting for Customer stays exactly that.

Other paths

Visitor returns after a resolved conversation, within the reopen window

EasyCRM returns after the widget session expired; their old resume token no longer resolves, so BootstrapAsync starts a fresh VisitorSession. The previous conversation is Resolved and within ReopenWindowDays (FR-14). EasyCRM reopens it; the visitor's new identity resolves back onto the same Contact via FR-02 matching.

Visitor returns after a resolved conversation, past the reopen window

The previous conversation is Resolved and past ReopenWindowDays. A new conversation starts instead.

Visitor returns while the conversation was never resolved

The previous conversation is still open (e.g. Waiting for Customer). The new session's identity resolves back onto the same Contact and conversation — no new conversation is created just because the browser session timed out.

Good to know

  • Session expiry (browser-side resume window) and conversation reopen (FR-14, day-based, applied at Resolved) are independent mechanisms.
  • No audit entry is raised per expiry — high-volume and routine; expiry counts feed widget monitoring instead.