fix: reject stale space position writes

Issue: #184
User-Visible: no
This commit is contained in:
Sergey Matyunin
2026-08-19 04:42:49 +03:00
parent 5d04e9b7c2
commit fa015907d4
9 changed files with 41 additions and 19 deletions
+12
View File
@@ -40,6 +40,18 @@ import { fileURLToPath } from 'node:url';
// `find` обязан встречаться в файле ровно один раз: патч, который ложится «куда
// попало», проверяет не то, что объявлен проверять. Это контролирует --check.
export const MUTANTS = [
{
id: 'stale-space-position-guard-removed',
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
+ '&& node --test --test-name-pattern="stable space ids" test/optional-space-model-contract.test.mjs',
because: 'position persistence with a stable space id must fail closed before layout, dirty-set '
+ 'and websocket side effects when that space has been deleted or renamed',
patches: [{
file: 'src/houseplan-card.ts',
find: ' if (!this._spaceModelById(d.space)) return;\n if (this._norm) {',
replace: ' if (this._norm) {',
}],
},
{
id: 'empty-space-cleanup-disabled',
guard: 'node demo/smoke_optional_space_model.mjs',