diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e2112de521b..64ef4dbfede 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -695,6 +695,7 @@ jobs: tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts tests/e2e/cross-version-wire/reported-lossy-initial-snapshot.unit.test.ts tests/e2e/cross-version-wire/cross-version-agent-session-wire.unit.test.ts + tests/e2e/cross-version-wire/cross-version-worktree-identity-downgrade.unit.test.ts managed_hook_node18: name: managed hooks on Node 18 diff --git a/tests/e2e/cross-version-wire/cross-version-worktree-identity-downgrade.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-worktree-identity-downgrade.unit.test.ts index 6bd21f1ee8c..cf8071171d5 100644 --- a/tests/e2e/cross-version-wire/cross-version-worktree-identity-downgrade.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-worktree-identity-downgrade.unit.test.ts @@ -142,11 +142,17 @@ describe('cross-version worktree identity downgrade', () => { }) }) - it('neither build drops a row shape it does not recognise', () => { + // Both builds, because the load-bearing forward-compat guarantee is the CURRENT build's: the + // stack repoints rows by walking a fixed field list, and a field a later build adds must pass + // through untouched rather than be swept in by anything name-shaped. + it.each([ + ['the pre-stack build', (): Migrate => preStackMigrate], + ['the stack', (): Migrate => stackMigrate] + ])('%s drops no row shape it does not recognise', (_label, migrateOf) => { const state = persistedStateAfterRename() const session = state.workspaceSession as Record session.someFutureFieldByKey = { k: { worktreeId: OLD_ID, fromANewerBuild: true } } - preStackMigrate(state, OLD_ID, NEW_ID) + expect(() => migrateOf()(state, OLD_ID, NEW_ID)).not.toThrow() expect((state.workspaceSession as Record).someFutureFieldByKey).toEqual({ k: { worktreeId: OLD_ID, fromANewerBuild: true } })