You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(sdk): recover chat transport when a restored session no longer exists
When a chat's session state is restored from a different environment (or
from before the sessions model), the cached token points at a session that
doesn't exist there. The transport assumed it was live and never created a
real one, so the next message 404'd and the chat could not send.
callWithAuthRetry now treats a 404 from a session call as a missing
session: after the existing 401/403 token refresh, it recreates the session
via startSession, drops the stale resume cursor, and retries the send once.
`useTriggerChatTransport` now recovers when restored session state points at a session that no longer exists in the current environment — for example a `sessions` entry persisted against a different trigger environment. Previously the transport assumed the session was live and the next message failed with a 404; it now recreates the session via `startSession` and retries the send, so the chat keeps working.
"TriggerChatTransport: session not found and no `startSession` configured to recreate it. The stored session state for this chat may be stale (e.g. created in a different environment) — provide `startSession` or clear the stored session so a fresh one can be created."
0 commit comments