v3.23.7: the proactive log survives a TERMINAL PROFILE re-send

Pressing the Phone tab's Send (or Rescue) re-sends the profile and starts a
new CAT session.  The log was cleared with the rest of the session state,
losing the only record of the card's proactive commands - a common
tweak-the-profile-and-resend loop wiped the history every time.

_resend_terminal_profile now calls _mark_proactive_session(
'terminal-profile') instead: the entries stay, _PROACTIVE_SESSION_START
restarts (so the new session's elapsed values begin at 0) and a boundary
marker entry is appended.  The PWA renders the marker as a
'- TERMINAL PROFILE re-sent - new CAT session -' divider (EN/RU).

Equip / disconnect keep the full clear (a card change); the pending-command
cancel, menu timeout and event list reset are unchanged.

Tests: the marker keeps the entries and restarts the timer, the reset still
clears, the re-send path pinned by source (Python) and the renderer's marker
branch (Node).  857 frontend + 842 Python; sw cache simple-v420.
This commit is contained in:
2026-10-08 00:20:06 +03:00
parent 9fb46b786f
commit c9ab15c392
8 changed files with 85 additions and 8 deletions
+11
View File
@@ -226,3 +226,14 @@ test('SELECT by FID SIM (CLA A0): no Le anywhere', () => {
const apdu = setup('sim', { cmd: 'select', selMethod: 'fid', fid: '6FC5' });
assert.strictEqual(apdu, 'A0A40000026FC5');
});
test('the proactive log renders a session boundary marker', () => {
// v3.23.7: a TERMINAL PROFILE re-send keeps the log history and appends a
// marker entry - the renderer draws it as a boundary line, not a command
// row (and the marker branch must run before the normal row builder)
const src = extractFunc(html, 'pysimProactiveLogRender');
assert.ok(src.includes('if (e.marker)'), src.slice(0, 300));
assert.ok(src.includes("t('TERMINAL PROFILE re-sent \\u2014 new CAT session')"), src);
assert.ok(src.indexOf('if (e.marker)') < src.indexOf('CMD_NAMES[e.type_hex]'),
'the marker branch must run before the normal row');
});