fix(ui): avoid file search cache key collisions (#1343)

Co-authored-by: Isaac Sanchez <isanchez-hawkins@arize.com>
This commit is contained in:
Isaac Sanchez-Hawkins
2026-05-21 15:51:09 +03:00
committed by GitHub
co-authored by Isaac Sanchez
parent 51c8d52ab5
commit 6fbdb22c7e
2 changed files with 24 additions and 4 deletions
@@ -89,4 +89,16 @@ describe('useFileSearchStore', () => {
expect(cacheEntries).toHaveLength(1);
expect(cacheEntries[0]?.files).toEqual([{ path: 'fresh.ts' }]);
});
test('keeps directory and query separators from colliding in cache keys', async () => {
const firstPromise = useFileSearchStore.getState().searchFiles('/project::nested', 'foo');
searchRequests[0].resolve([{ path: 'first.ts' }]);
await firstPromise;
const secondPromise = useFileSearchStore.getState().searchFiles('/project', 'nested::foo');
expect(searchRequests).toHaveLength(2);
searchRequests[1].resolve([{ path: 'second.ts' }]);
expect(await secondPromise).toEqual([{ path: 'second.ts' }]);
});
});