SHA256
Исправить восстановление сессии после переподключения WS
This commit is contained in:
@@ -1004,9 +1004,11 @@ export class AuthService {
|
||||
|
||||
resetConnection(serverUrl = this.serverUrl, { clearSessionContext = true } = {}) {
|
||||
const normalized = normalizeServerUrl(serverUrl);
|
||||
const requestGuard = this.ws?.requestGuard;
|
||||
try { this.ws?.close(); } catch {}
|
||||
this.serverUrl = normalized;
|
||||
this.ws = new WsJsonClient(this.serverUrl);
|
||||
this.ws.setRequestGuard(requestGuard);
|
||||
this.headerHashCache = new Map();
|
||||
this.lineTailCache = new Map();
|
||||
this.lineWriteQueues = new Map();
|
||||
@@ -1185,6 +1187,7 @@ export class AuthService {
|
||||
|
||||
const sessionId = createResp?.payload?.sessionId;
|
||||
if (!sessionId) throw new Error('CreateAuthSession: не вернулся sessionId');
|
||||
this.ws.markSessionReady();
|
||||
const connectionScope = String(createResp?.payload?.connectionScope || '').trim().toUpperCase();
|
||||
|
||||
const canonicalLogin = await this.resolveCanonicalDisplayLogin(cleanLogin);
|
||||
@@ -1275,6 +1278,7 @@ export class AuthService {
|
||||
|
||||
const sessionId = createResp?.payload?.sessionId;
|
||||
if (!sessionId) throw new Error('CreateAuthSession: не вернулся sessionId');
|
||||
tempAuth.ws.markSessionReady();
|
||||
|
||||
const canonicalLogin = await tempAuth.resolveCanonicalDisplayLogin(cleanLogin);
|
||||
|
||||
@@ -1351,6 +1355,7 @@ export class AuthService {
|
||||
|
||||
const storagePwd = loginResp?.payload?.storagePwd;
|
||||
if (!storagePwd) throw new Error('SessionLogin: не вернулся storagePwd');
|
||||
this.ws.markSessionReady();
|
||||
const connectionScope = String(loginResp?.payload?.connectionScope || '').trim().toUpperCase();
|
||||
|
||||
const canonicalLogin = await this.resolveCanonicalDisplayLogin(cleanLogin);
|
||||
|
||||
Reference in New Issue
Block a user