Исправить подпись сигналов звонка и ширину чата

This commit is contained in:
AidarKC
2026-11-30 12:03:21 +03:00
parent c175a54a01
commit 1e52b4dd2a
13 changed files with 107 additions and 80 deletions
@@ -0,0 +1,25 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const auth = readFileSync(new URL('../js/services/auth-service.js', import.meta.url), 'utf8');
const vault = readFileSync(new URL('../js/services/key-vault.js', import.meta.url), 'utf8');
const handler = readFileSync(new URL('../../SHiNE-server/shine-server-net-protocol/src/main/java/server/logic/ws_protocol/JSON/messages/Net_SendSignal_Handler.java', import.meta.url), 'utf8');
test('SendSignal берёт ключ только с текущим sessionId и подписывает канонический login адресата', () => {
assert.match(auth, /loadSessionMaterial\(cleanLogin, cleanSessionId\)/);
assert.match(auth, /resolveCanonicalDisplayLogin\(requestedToLogin\)/);
assert.match(auth, /ключ активной сессии не найден/);
});
test('key vault хранит независимый материал для каждой сессии одного login', () => {
assert.match(vault, /session-keys-by-id/);
assert.match(vault, /normalizeSessionStorageKey\(login, sessionId\)/);
assert.match(vault, /loadSessionMaterial\(login, sessionId = ''\)/);
assert.match(vault, /String\(legacyRow\?\.sessionId \|\| ''\)\.trim\(\) === cleanSessionId/);
});
test('для call_invite без онлайн-сессии сервер возвращает NO_TARGET_SESSIONS', () => {
assert.match(handler, /if \(targets\.isEmpty\(\)\) \{/);
assert.doesNotMatch(handler, /sendIncomingCallPushToOfflineSessions/);
});