Repository navigation
Commit 90bbdad
fix(utils): keep the pre-commit ancestry assertion out of the EPERM rename fallback
assertAncestryUnchangedBeforeCommit() ran inside the try whose catch decides the fallback by error code
alone, so an EPERM raised by the inspection was indistinguishable from a rename collision: the fallback
renamed the committed destination to a backup and continued, while the refusal it came from promises
that nothing moves. The assertion now runs immediately before the try, so only rename failures reach
the fallback. The two-step fallback itself and the crash-recovery pass at the start of the next write
are untouched, which is what #1405's seam ruling requires (its safeWriteText copy is one of the four
that #2350 has to reconcile, so this file's merge order is on the record).
New case arms an EPERM on the third destination look - the one the publication takes just before the
commit rename - over a committed destination, and asserts the promise rejects with EPERM, targetLooks
=== 3, the destination still reads { committed: true } byte for byte, and no backup-rename stage was
traced. Control on pinned node v22.23.4 (.tmp-node22; box shell v25.9.0): spec-only against the parent
impl gives 1 failed / 61 passed - exactly this case, and the red is the fallback moving the committed
file, not a harness artifact; with the assertion moved outside the try the file is 62/62, including the
existing two-step-fallback cases, so the fallback and the recovery pass still work.
Path-spelling probe (a windows-latest failure mode): async fs.realpath expands an NTFS 8.3 alias, so a
publish target can come back spelled differently from the path handed in. Re-ran this spec with TEMP at
C:\\work\\ZOO-CO~1\\WT-R20~3\\TMP-AL~1 (same inode as the long name, verified) and at the long name:
62/62 both ways on pinned v22.23.4, so this spec is not spelling-dependent and nothing here compares a
resolved path as text. Logs 1405-fixed-at-8.3-alias-r203.log and 1405-row7-case-against-*.log.
Gates: vitest.misc.config.ts (the shard src/package.json routes utils/** to) on pinned v22.23.4, tsc
--noEmit clean on box v25.9.0, eslint --prune-suppressions --max-warnings=0 clean on both files with
.eslintcache cleared after the last prettier write, prettier --check 0, src/eslint-suppressions.json
byte-identical to the parent cb6575a. knip skipped: no new file and no new export.
Co-Authored-By: Claude <[email protected]>1 parent 65f8658 commit 90bbdad
2 files changed
Lines changed: 46 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1319 | 1319 | | |
1320 | 1320 | | |
1321 | 1321 | | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
1322 | 1359 | | |
1323 | 1360 | | |
1324 | 1361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
353 | 362 | | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | 363 | | |
359 | 364 | | |
360 | 365 | | |
| |||
0 commit comments