diff --git a/docs/releases/console-3.1.13.md b/docs/releases/console-3.1.13.md new file mode 100644 index 0000000..21f3991 --- /dev/null +++ b/docs/releases/console-3.1.13.md @@ -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. diff --git a/stage-releases.json b/stage-releases.json index 8fdb4f3..c3a2294 100644 --- a/stage-releases.json +++ b/stage-releases.json @@ -14,7 +14,7 @@ "version": "1.0.0" }, "stage_ui": { - "version": "3.1.12" + "version": "3.1.13" }, "stage_avahi": { "version": "1.0.0" diff --git a/stage_ui/console_core/backend/app.py b/stage_ui/console_core/backend/app.py index 6140499..ae3d4f9 100644 --- a/stage_ui/console_core/backend/app.py +++ b/stage_ui/console_core/backend/app.py @@ -54,7 +54,7 @@ APP_DIR = "/opt/iomatex-console" PUBLIC_DIR = os.path.join(APP_DIR, "public") PROVIDERS_DIR = os.path.join(APP_DIR, "providers.d") 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" ZONEINFO_ROOT = "/usr/share/zoneinfo" diff --git a/stage_ui/console_core/backend/test_itscreen_version_ui.js b/stage_ui/console_core/backend/test_itscreen_version_ui.js new file mode 100644 index 0000000..1e7f4ab --- /dev/null +++ b/stage_ui/console_core/backend/test_itscreen_version_ui.js @@ -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'); diff --git a/stage_ui/console_core/frontend/console.js b/stage_ui/console_core/frontend/console.js index d222cef..bda0acb 100644 --- a/stage_ui/console_core/frontend/console.js +++ b/stage_ui/console_core/frontend/console.js @@ -49,7 +49,7 @@ { mode: "test_by", label: "test.it-screen.by", host: "rest.test.it-screen.by" }, { 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_BUFFER_LIMIT = 300; const ITSCREEN_LOG_BATCH_MS = 250; @@ -1593,7 +1593,11 @@ } 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() { diff --git a/stage_ui/console_core/frontend/index.html b/stage_ui/console_core/frontend/index.html index e8f812f..b0fa7fd 100644 --- a/stage_ui/console_core/frontend/index.html +++ b/stage_ui/console_core/frontend/index.html @@ -23,7 +23,7 @@ } catch (error) {} })(); - +
@@ -109,7 +109,7 @@
- - + + diff --git a/stage_ui/version.json b/stage_ui/version.json index 9acb272..23e0f7e 100644 --- a/stage_ui/version.json +++ b/stage_ui/version.json @@ -1,3 +1,3 @@ { - "version": "3.1.12" + "version": "3.1.13" }