Preserve registration app version on initial It-Screen navigation
This commit is contained in:
parent
cc8a2e182a
commit
54d5feaa91
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Console 3.1.13
|
||||||
|
|
||||||
|
Release date: 2026-10-06.
|
||||||
|
|
||||||
|
- Fix App version disappearing on first navigation to It-Screen after Health loaded registration. An empty version from the service-status response previously replaced the known registration version; the shared service accessor now falls back to registration data while preferring a nonempty installed binary version.
|
||||||
|
- Keep existing request cadence and manual refresh behavior. No polling or extra registration requests are added.
|
||||||
|
|
||||||
|
Validation: response-order and tab-refresh regression test, browser reproduction using empty status version and known registration version, and live local Edge verification.
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
"version": "1.0.0"
|
"version": "1.0.0"
|
||||||
},
|
},
|
||||||
"stage_ui": {
|
"stage_ui": {
|
||||||
"version": "3.1.12"
|
"version": "3.1.13"
|
||||||
},
|
},
|
||||||
"stage_avahi": {
|
"stage_avahi": {
|
||||||
"version": "1.0.0"
|
"version": "1.0.0"
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ APP_DIR = "/opt/iomatex-console"
|
||||||
PUBLIC_DIR = os.path.join(APP_DIR, "public")
|
PUBLIC_DIR = os.path.join(APP_DIR, "public")
|
||||||
PROVIDERS_DIR = os.path.join(APP_DIR, "providers.d")
|
PROVIDERS_DIR = os.path.join(APP_DIR, "providers.d")
|
||||||
CONFIG_PATH = "/etc/iomatex/console.json"
|
CONFIG_PATH = "/etc/iomatex/console.json"
|
||||||
UI_VERSION = "V 3.1.12"
|
UI_VERSION = "V 3.1.13"
|
||||||
STORAGE_HEALTH_COMMAND = "/usr/local/sbin/iomatex-storage-health"
|
STORAGE_HEALTH_COMMAND = "/usr/local/sbin/iomatex-storage-health"
|
||||||
ZONEINFO_ROOT = "/usr/share/zoneinfo"
|
ZONEINFO_ROOT = "/usr/share/zoneinfo"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
const assert = require('node:assert/strict');
|
||||||
|
const fs = require('node:fs');
|
||||||
|
const path = require('node:path');
|
||||||
|
const vm = require('node:vm');
|
||||||
|
const source = fs.readFileSync(path.join(__dirname, '../frontend/console.js'), 'utf8');
|
||||||
|
const state = {itscreen: {data: {}}};
|
||||||
|
const ctx = {state, textValue: (value, fallback) => value == null || String(value).trim() === '' ? fallback : String(value).trim()};
|
||||||
|
vm.createContext(ctx);
|
||||||
|
vm.runInContext(source.slice(source.indexOf(' function itscreenPayload()'), source.indexOf(' function itscreenServerMode(')), ctx);
|
||||||
|
for (const order of [['registration', 'service'], ['service', 'registration']]) {
|
||||||
|
state.itscreen.data = {};
|
||||||
|
for (const key of order) state.itscreen.data[key] = key === 'registration' ? {app_version: '4.410.142'} : {version: '', state: 'running'};
|
||||||
|
assert.equal(ctx.itscreenService().version, '4.410.142');
|
||||||
|
// Navigating from Health loads another status response without reloading registration.
|
||||||
|
state.itscreen.data.service = {version: '', state: 'running'};
|
||||||
|
assert.equal(ctx.itscreenService().version, '4.410.142');
|
||||||
|
assert.equal(state.itscreen.data.service.version, '', 'Read must not mutate API data');
|
||||||
|
}
|
||||||
|
state.itscreen.data.service.version = '4.410.143';
|
||||||
|
assert.equal(ctx.itscreenService().version, '4.410.143');
|
||||||
|
state.itscreen.data = {};
|
||||||
|
assert.equal(ctx.itscreenService().version, '');
|
||||||
|
console.log('App version survives response ordering and tab status refresh; installed version takes precedence');
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
{ mode: "test_by", label: "test.it-screen.by", host: "rest.test.it-screen.by" },
|
{ mode: "test_by", label: "test.it-screen.by", host: "rest.test.it-screen.by" },
|
||||||
{ mode: "custom", label: "Custom", host: "" }
|
{ mode: "custom", label: "Custom", host: "" }
|
||||||
];
|
];
|
||||||
const UI_VERSION = "V 3.1.12";
|
const UI_VERSION = "V 3.1.13";
|
||||||
const ITSCREEN_LOG_INITIAL_LINES = 50;
|
const ITSCREEN_LOG_INITIAL_LINES = 50;
|
||||||
const ITSCREEN_LOG_BUFFER_LIMIT = 300;
|
const ITSCREEN_LOG_BUFFER_LIMIT = 300;
|
||||||
const ITSCREEN_LOG_BATCH_MS = 250;
|
const ITSCREEN_LOG_BATCH_MS = 250;
|
||||||
|
|
@ -1593,7 +1593,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function itscreenService() {
|
function itscreenService() {
|
||||||
return itscreenPayload().service || {};
|
const payload = itscreenPayload();
|
||||||
|
const service = payload.service || {};
|
||||||
|
// Status may not discover the binary version; registration already has it.
|
||||||
|
// Resolve on read so either response order and later status refreshes are safe.
|
||||||
|
return { ...service, version: textValue(service.version, "") || itscreenAppVersionFromRegistration(payload.registration) };
|
||||||
}
|
}
|
||||||
|
|
||||||
function itscreenRuntime() {
|
function itscreenRuntime() {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<link rel="stylesheet" href="/console.css?v=3.1.12&rev=camera-snapshot-1">
|
<link rel="stylesheet" href="/console.css?v=3.1.13&rev=camera-snapshot-1">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main class="shell">
|
<main class="shell">
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
</main>
|
</main>
|
||||||
<div id="menuBackdrop" class="menuBackdrop" hidden></div>
|
<div id="menuBackdrop" class="menuBackdrop" hidden></div>
|
||||||
<div id="toastStack" class="toastStack" aria-live="polite" aria-atomic="true"></div>
|
<div id="toastStack" class="toastStack" aria-live="polite" aria-atomic="true"></div>
|
||||||
<script src="/console.i18n.js?v=3.1.12&rev=camera-snapshot-1"></script>
|
<script src="/console.i18n.js?v=3.1.13&rev=camera-snapshot-1"></script>
|
||||||
<script src="/console.js?v=3.1.12&rev=camera-snapshot-1"></script>
|
<script src="/console.js?v=3.1.13&rev=camera-snapshot-1"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"version": "3.1.12"
|
"version": "3.1.13"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue