MCPcopy Create free account
hub / github.com/codag-megalith/codag-visualizer / invalidateFile

Method invalidateFile

frontend/src/cache.ts:1418–1433  ·  view source on GitHub ↗

* Invalidate a single file and its cross-file edges

(filePath: string)

Source from the content-addressed store, hash-verified

1416 * Invalidate a single file and its cross-file edges
1417 */
1418 async invalidateFile(filePath: string): Promise<void> {
1419 await this.initPromise;
1420
1421 // Normalize path to full path (cache keys are always full paths)
1422 const normalizedPath = this.toRelativePath(filePath);
1423
1424 // Remove file cache
1425 delete this.files[normalizedPath];
1426
1427 // Remove cross-file edges involving this file
1428 this.crossFileEdges = this.crossFileEdges.filter(
1429 e => e.sourceFile !== normalizedPath && e.targetFile !== normalizedPath
1430 );
1431
1432 this.scheduleSave();
1433 }
1434
1435 /**
1436 * Clear all cache

Callers 2

activateFunction · 0.95

Calls 2

toRelativePathMethod · 0.95
scheduleSaveMethod · 0.95

Tested by

no test coverage detected