MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / invalidateNoteMetaCache

Function invalidateNoteMetaCache

apps/desktop/src/main/vault.ts:1859–1875  ·  view source on GitHub ↗
(root: string, rel?: string)

Source from the content-addressed store, hash-verified

1857}
1858
1859export function invalidateNoteMetaCache(root: string, rel?: string): void {
1860 const rootAbs = path.resolve(root)
1861 clearScheduledPersistNoteMetaCache(rootAbs)
1862 if (!rel) {
1863 for (const key of noteMetaCache.keys()) {
1864 if (key.startsWith(`${rootAbs}\0`)) noteMetaCache.delete(key)
1865 }
1866 loadedPersistedNoteMetaCacheRoots.delete(rootAbs)
1867 return
1868 }
1869
1870 try {
1871 noteMetaCache.delete(noteMetaCacheKey(root, resolveSafe(root, rel)))
1872 } catch {
1873 /* ignore invalid relative paths */
1874 }
1875}
1876
1877async function getCachedVaultTextSearchCandidates(
1878 root: string,

Callers 15

vault.test.tsFile · 0.90
index.tsFile · 0.90
vault.perf.test.tsFile · 0.90
writeNoteFunction · 0.85
appendToNoteFunction · 0.85
createNoteFunction · 0.85
createExcalidrawFunction · 0.85
importExternalNoteFunction · 0.85
renameNoteFunction · 0.85
moveBetweenFoldersFunction · 0.85
emptyTrashFunction · 0.85

Calls 4

noteMetaCacheKeyFunction · 0.85
deleteMethod · 0.80
resolveSafeFunction · 0.70

Tested by

no test coverage detected