File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,9 @@ describe("CacheManager", () => {
8080 relativePath = path . relative ( homedir , mockWorkspacePath )
8181 }
8282
83- const compositeKey = `${ workspaceName } ::${ relativePath } `
83+ // Normalize path separators for consistency
84+ const normalizedRelativePath = relativePath . replace ( / \\ / g, "/" )
85+ const compositeKey = `${ workspaceName } ::${ normalizedRelativePath } `
8486 const expectedHash = createHash ( "sha256" ) . update ( compositeKey ) . digest ( "hex" )
8587
8688 expect ( vscode . Uri . joinPath ) . toHaveBeenCalledWith (
Original file line number Diff line number Diff line change @@ -56,10 +56,14 @@ export class CacheManager implements ICacheManager {
5656 console . warn ( "Failed to get relative path from home directory:" , error )
5757 }
5858
59- // Create a composite key using workspace name and relative path
59+ // Normalize path separators to forward slashes for consistency across platforms
60+ // This ensures the same cache key is generated regardless of the OS
61+ const normalizedRelativePath = relativePath . replace ( / \\ / g, "/" )
62+
63+ // Create a composite key using workspace name and normalized relative path
6064 // This should be more stable across SSH sessions where the absolute path might change
6165 // but the relative structure remains the same
62- const compositeKey = `${ workspaceName } ::${ relativePath } `
66+ const compositeKey = `${ workspaceName } ::${ normalizedRelativePath } `
6367
6468 // Generate hash from the composite key
6569 return createHash ( "sha256" ) . update ( compositeKey ) . digest ( "hex" )
You can’t perform that action at this time.
0 commit comments