#1685·foam

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_KEY static constant (~line 41)
  • importLegacyWorkspaceState() method (~lines 116–148) and its call in load() (~lines 102–105) — after removal, load() calls loadBuckets() unconditionally
  • the workspaceState.update(LEGACY_STATE_KEY, undefined) cleanup at the end of clear() (~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).