Remove legacy parser-cache workspaceState migration (post-#1681)
Author: riccardoferrettiCreated Jul 12, 2026Updated Jul 12, 2026
PR #1681 sharded the parser cache into bucket files under storageUri and added
one-time migration code that imports the old single-blob workspaceState cache
(LEGACY_STATE_KEY = 'foam-cache') into the new layout, then deletes it.
Once enough time has passed that essentially all users have activated a build containing #1681 at least once (their legacy blob is gone), this migration path is dead code and should be removed.
Target: remove after ~September 2026 (≈2 months post-merge, merged 2026-07-12).
Code to remove in packages/foam-vscode/src/vscode/services/cache.ts
LEGACY_STATE_KEYstatic constant (~line 41)importLegacyWorkspaceState()method (~lines 116–148) and its call inload()(~lines 102–105) — after removal,load()callsloadBuckets()unconditionally- the
workspaceState.update(LEGACY_STATE_KEY, undefined)cleanup at the end ofclear()(~lines 194–197)
Tests
- Remove the migration-specific cases in
packages/foam-vscode/src/vscode/services/cache.spec.ts(the "import legacy workspaceState" / migration tests).
Ref: #1681 (supersedes #1677).
Source: foambubble/foam