| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #296 +/- ##
==========================================
- Coverage 87.19% 86.75% -0.45%
==========================================
Files 23 23
Lines 7929 7929
Branches 1214 1217 +3
==========================================
- Hits 6914 6879 -35
- Misses 1008 1042 +34
- Partials 7 8 +1 see 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was a problem hiding this comment.
Verdict: Ship with changes — one Major (perf) worth landing first.
The bug is real: lib/walker.ts:459 records exactly one manifest entry per link (this.symLinks[file] = realFile), so node_modules/@t/lib/package.json has no key, and the pre-fix _resolveSymlink was exact-key only. The non-SEA prelude already did prefix matching (prelude/bootstrap.js:239-252, vfsKey.startsWith(k + sep)) — SEA was the outlier, which is exactly why standard mode worked.
The fix is correct. Built at 843326b on node v22.20.0:
| build | result |
|---|---|
| committed test, with fix | exit 0 |
| committed test, without the sea-vfs-setup.js hunk | ENOENT ... '/test-99-#295/lib/log.js', exit 1 |
| the npm-workspace repro from #295 (node_modules/@t/lib -> ../../packages/lib, ESM bare import), SEA with fix | exit 0 |
| same repro, SEA without fix | ERR_MODULE_NOT_FOUND at resolveBareSpecifier → vfsResolveHook, exit 1 |
| same repro, standard (non-SEA) mode | exit 0 — confirms the report |
Replaying _resolveSymlink against synthetic manifests: the #295 shape, multi-segment remainders, and chained links all resolve correctly; cycles terminate at MAX_SYMLINK_DEPTH (i is never reset); parentIdx > 0 correctly refuses the empty root key; win32 C:/… keys walk correctly and stop at C:; and there is no substring/prefix trap (/a/bc does not match /a/bcd). Nice work — the parent walk is also strictly better than bootstrap's version (O(path depth) hash lookups instead of O(number of symlinks) scans).
Specialists run: Correctness, DRY & Codebase Fit, Performance, Tests, Design/API/BackCompat, plus an empirical build-and-run verifier. Not run: Security, Operability, Readability — no files in their lane (the symlink map is build-time output from the developer's own tree, not a trust boundary; no logging/error-path changes; no file over 80 changed lines).
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #295
This change does require us to always walk up the full path hierarchy to detect any parent symlinks, which will worsen the performance. I also had to remove the object-has-key fast path.
To at least keep the performance the same for projects that don't use any symlinks, I added a precomputed flag that determines whether any symlink exists. If there are no symlinks, we can immediately return out of the function.