Files
codegraph/__tests__
Colby Mchenry e8b478a00e fix(sync): record only indexed files as synthesis inputs (#2688)
A sync whose code lazy-loads a workspace package failed with "FOREIGN KEY
constraint failed" and rolled back, and every later sync did the same
(issue 2565). lazyValueModules names the module a lazy value loads as a
synthesis input, and for `import('icons')` or `import('@vben/layouts')`
the resolver gives the package directory, which is not an indexed file.
synthesis_inputs.file_path references files(path), so the stage's publish
step failed. A file that leaves the index while the passes run broke it
the same way.

Both places that write synthesis_inputs now keep only paths the files
table holds: replaceSynthesisInputs on the index, and SynthesisStage's
publish, inside its write transaction. The directory never matched a
changed file anyway, so nothing is lost.

A/B on main 3308cff0: fresh indexes of vben, excalidraw and zod are
byte-identical; vben's sync after editing its five layouts/index.ts files
exits 1 on main and 0 here, and the synced graph equals a fresh index of
the edited tree.

Reported by @bompus; @inth3shadows found the same cause.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 23:24:06 +00:00
..