Repository navigation
Commit a4e8363
committed
fix(safe-write-json): lock the key every other writer to the file uses
The required ubuntu arm died in src's test:coverage:misc lane on 51 tests in
four specs. The guard spelled its lock key from the path the caller gave,
while src/core/tools/guardedWrite.ts locks the key resolveLockKey produces
and says so in its own comments. A write through an alias therefore queued
behind a lock no other writer to that file holds, and the guard's agreement
check then rejected the write it had just approved.
- utils/safeWriteJson.ts: resolve the lock key before taking the lock, and
commit the rename onto the resolved target rather than the caller's spelling.
- utils/__tests__/safeWriteJson.lockKey.spec.ts: restate the read ledger to the
readings the repaired guard actually takes.
- utils/__tests__/safeWriteJson.test.ts: name the leftover prefix the guard
writes, run the mock undo in order instead of hoisted above the imports, and
measure the follow-on write against the stage list the guard reports.
- integrations/editor/__tests__/DiffViewProvider.spec.ts: observe the paths
these fixtures publish, which is the state the guarded publish requires.
Negative control: reverting the guard lines brings back 49 failures in the
same four files. With the repair the misc lane runs 2253 passed, 21 skipped,
exit 0, where it printed 51 failed at this head.1 parent fbec995 commit a4e8363
4 files changed
Lines changed: 85 additions & 29 deletions
File tree
- src
- integrations/editor/__tests__
- utils
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1686 | 1686 | | |
1687 | 1687 | | |
1688 | 1688 | | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
1689 | 1695 | | |
1690 | 1696 | | |
1691 | 1697 | | |
| |||
3446 | 3452 | | |
3447 | 3453 | | |
3448 | 3454 | | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
| 3463 | + | |
3449 | 3464 | | |
3450 | 3465 | | |
3451 | 3466 | | |
| |||
3599 | 3614 | | |
3600 | 3615 | | |
3601 | 3616 | | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
| 3624 | + | |
| 3625 | + | |
| 3626 | + | |
3602 | 3627 | | |
3603 | 3628 | | |
3604 | 3629 | | |
| |||
4796 | 4821 | | |
4797 | 4822 | | |
4798 | 4823 | | |
| 4824 | + | |
| 4825 | + | |
| 4826 | + | |
| 4827 | + | |
| 4828 | + | |
| 4829 | + | |
| 4830 | + | |
| 4831 | + | |
| 4832 | + | |
| 4833 | + | |
4799 | 4834 | | |
4800 | 4835 | | |
4801 | 4836 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
174 | 177 | | |
175 | 178 | | |
176 | 179 | | |
| |||
182 | 185 | | |
183 | 186 | | |
184 | 187 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
| 575 | + | |
| 576 | + | |
576 | 577 | | |
577 | | - | |
| 578 | + | |
| 579 | + | |
578 | 580 | | |
579 | 581 | | |
580 | 582 | | |
| |||
621 | 623 | | |
622 | 624 | | |
623 | 625 | | |
624 | | - | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
625 | 630 | | |
626 | 631 | | |
627 | 632 | | |
| |||
695 | 700 | | |
696 | 701 | | |
697 | 702 | | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
698 | 711 | | |
699 | 712 | | |
700 | 713 | | |
701 | 714 | | |
702 | 715 | | |
| 716 | + | |
703 | 717 | | |
704 | 718 | | |
705 | | - | |
706 | | - | |
| 719 | + | |
| 720 | + | |
707 | 721 | | |
708 | | - | |
709 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
710 | 725 | | |
711 | | - | |
| 726 | + | |
712 | 727 | | |
713 | | - | |
| 728 | + | |
714 | 729 | | |
715 | 730 | | |
716 | 731 | | |
| |||
1043 | 1058 | | |
1044 | 1059 | | |
1045 | 1060 | | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
1050 | 1067 | | |
1051 | 1068 | | |
1052 | 1069 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
324 | 328 | | |
325 | 329 | | |
326 | 330 | | |
| |||
344 | 348 | | |
345 | 349 | | |
346 | 350 | | |
347 | | - | |
| 351 | + | |
348 | 352 | | |
349 | 353 | | |
350 | 354 | | |
| |||
370 | 374 | | |
371 | 375 | | |
372 | 376 | | |
373 | | - | |
| 377 | + | |
374 | 378 | | |
375 | 379 | | |
376 | 380 | | |
| |||
480 | 484 | | |
481 | 485 | | |
482 | 486 | | |
483 | | - | |
| 487 | + | |
484 | 488 | | |
485 | 489 | | |
486 | 490 | | |
| |||
0 commit comments