From 576e9eca0b17fb66f4d942ddf4aca85d5fbfa426 Mon Sep 17 00:00:00 2001 From: Merge Sim Date: Wed, 9 Sep 2026 05:44:17 -0700 Subject: [PATCH] test(projects): pin that persistence never receives a path the relocation did not apply --- src/main/project-path-relocation.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/project-path-relocation.test.ts b/src/main/project-path-relocation.test.ts index c9c1d1d76b5..523e8128adc 100644 --- a/src/main/project-path-relocation.test.ts +++ b/src/main/project-path-relocation.test.ts @@ -321,6 +321,22 @@ describe('projectHostSetup.update entry points', () => { expect(notices).toEqual([]) }) + it('does not hand persistence a path it did not apply', () => { + const store = storeWithFolderProject() + store.setWorktreeMeta(rootWorkspaceId(), { displayName: 'example-project' }) + const { controller } = rpcController(store) + + // The stored spelling is the trimmed one, so forwarding the raw request would trip the + // persistence backstop that refuses any path it did not apply itself. + controller.updateSetup({ + setupId: 'r1', + updates: { path: ` ${newPath} `, displayName: 'Renamed' } + }) + + expect(store.getRepo('r1')?.path).toBe(newPath) + expect(store.getRepo('r1')?.displayName).toBe('Renamed') + }) + it('passes an update with no path change straight through', () => { const store = storeWithFolderProject() const { notify, notices } = recordingNotifier()