fix: не откатывать конфигурацию поздним reload (#543)

Issue: #543
User-Visible: yes
This commit is contained in:
Sergey Matyunin
2026-09-12 22:29:16 +03:00
parent 3342910b27
commit a1fac44d72
59 changed files with 1429 additions and 558 deletions
+8 -1
View File
@@ -242,8 +242,15 @@ export const LOW_HEADROOM_WARNING_BYTES = 15_000;
* 12 816 Б gzip. Измеренный факт 287 284 Б оставляет 1 016 Б сверху и 984 Б до
* нижней границы полосы; общий бюджет 301 066 Б не меняется, запас до него
* вырос с 955 Б до 13 782 Б.
*
* 2026-09-12, #543: потолок перецентрирован 288 300 → 288 900 без изменения
* общего бюджета. В initial View вошёл session-scoped владелец конкурентных
* config reload: request claims, event high-water и lifecycle/baseline guards,
* без которых поздняя подложка откатывала уже показанный план. Измеренный факт
* 288 226 Б оставляет 674 Б сверху и 1 326 Б до нижней границы полосы; тяжёлых
* UI/runtime зависимостей механизм не добавляет.
*/
export const INITIAL_VIEW_GZIP_CEILING = 288_300;
export const INITIAL_VIEW_GZIP_CEILING = 288_900;
export const INITIAL_VIEW_CEILING_BAND = 2_000;
/**
+16
View File
@@ -9014,6 +9014,22 @@ const MUTANT_DEFINITIONS = [
+ ' const assetReady = await host._signer.prepareImage(host.hass, host._candidateBackdrop(candidateConfig));',
}],
},
{
id: 'config-reload-drops-asset-gap-ownership',
guard: 'node demo/smoke_config_reload_race.mjs',
because: 'a config response that was current before prepareImage may lose to a newer reload '
+ 'inside that await; omitting the request claim at the common adoption boundary lets the '
+ 'late response replace View, revision and cache again (#543 AC1, AC2, AC8)',
patches: [{
file: 'src/config-reload-authority.ts',
find: " profile: 'reload',\n"
+ ' isCurrent,\n'
+ " afterAdopt: () => { host._regSignature = ''; host._maybeRebuildDevices(); },",
replace: " profile: 'reload',\n"
+ ' // mutant: the common asset gate cannot see that this request lost ownership\n'
+ " afterAdopt: () => { host._regSignature = ''; host._maybeRebuildDevices(); },",
}],
},
];
const mutationCardSource = readFileSync(join(repoRoot, 'src/houseplan-card.ts'), 'utf8');