From 207c61b5679a697cee4bbe990932d3916c15a151 Mon Sep 17 00:00:00 2001 From: Egor Kolesnikov Date: Sun, 22 Nov 2026 22:10:32 +0200 Subject: [PATCH 1/8] Watchface gate: refuse widgets the watch's firmware can't survive Both watches look a procedural widget's type (tag 0x82 + 0x5c) up in a table their loop can run off, which boot-loops the watch. The check reads the raw bytes the way the firmware's parser does and runs once, in the flash every install goes through: - types 8 and up go to no watch; - 4..7 go to a Watch 3 Pro; a Watch Pro 2 only gets an imageless 4 until a stub release that draws them is named in PRO2_FACES_STUB; - ETC2 bound for a Watch Pro 2 is counted unpacked. The firmware page and the Developer panel warn before a rollback to a firmware that can't draw such a face. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CQSU8M433m4WAvWEbAKocd --- .../device/components/dev-sheet.svelte | 6 +- src/lib/modules/device/i18n.ts | 10 + src/lib/modules/device/messages.ts | 38 +++- src/lib/modules/device/model/ble.model.ts | 2 + src/lib/modules/editor/core/format/compat.ts | 162 +++++++++++++++ src/lib/modules/editor/core/format/index.ts | 1 + src/lib/modules/store/i18n.ts | 10 + src/lib/modules/store/pages/firmware.svelte | 6 + tests/ble-messages.test.ts | 6 +- tests/face-compat.test.ts | 188 ++++++++++++++++++ tests/firmware-rollback.browser.test.ts | 45 +++++ tests/flash-compat.browser.test.ts | 52 +++++ tests/proc-face.ts | 98 +++++++++ 13 files changed, 621 insertions(+), 3 deletions(-) create mode 100644 src/lib/modules/editor/core/format/compat.ts create mode 100644 tests/face-compat.test.ts create mode 100644 tests/firmware-rollback.browser.test.ts create mode 100644 tests/flash-compat.browser.test.ts create mode 100644 tests/proc-face.ts diff --git a/src/lib/modules/device/components/dev-sheet.svelte b/src/lib/modules/device/components/dev-sheet.svelte index 7618130..c493fd4 100644 --- a/src/lib/modules/device/components/dev-sheet.svelte +++ b/src/lib/modules/device/components/dev-sheet.svelte @@ -106,7 +106,7 @@ {#if firmware}
- {$t.firmwareRisk} + {$t.firmwareRisk} {$t.rollbackRisk}