in src/components/Widget/index.js [125:142]
getSessionIdWithFallback() {
const { storage, socket } = this.props;
// Get the local session, check if there is an existing session_id
const localSession = getLocalSession(storage, SESSION_NAME);
let localId = localSession ? localSession.session_id : null;
// If no sessionId in localStorage, try to get it from socket (same logic as in store.js)
if (!localId && socket && socket.sessionId) {
localId = socket.sessionId;
}
// If still no sessionId, check for preserved session_id (during token refresh)
if (!localId && socket && socket.preservedSessionId) {
localId = socket.preservedSessionId;
}
return localId;
}