Commit 6735967
committed
fix: handle concurrent file edits and symlink loops in watcher/builder
Add readFileSafe helper that retries on transient OS errors
(EBUSY/EACCES/EPERM) from editors performing non-atomic saves.
Replace bare readFileSync calls in builder.js (3 sites) and
watcher.js (1 site).
Add symlink loop detection to collectFiles via realpathSync tracking
of visited directories, preventing infinite recursion from circular
symlinks.
Update architecture.md sections #7, #15, and summary table to
reflect these fixes.
Impact: 5 functions changed, 5 affected1 parent ea201d1 commit 6735967
3 files changed
Lines changed: 52 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| 476 | + | |
| 477 | + | |
476 | 478 | | |
477 | 479 | | |
478 | 480 | | |
| |||
583 | 585 | | |
584 | 586 | | |
585 | 587 | | |
586 | | - | |
| 588 | + | |
587 | 589 | | |
588 | 590 | | |
589 | 591 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
47 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
48 | 68 | | |
49 | 69 | | |
50 | 70 | | |
| |||
67 | 87 | | |
68 | 88 | | |
69 | 89 | | |
70 | | - | |
| 90 | + | |
71 | 91 | | |
72 | 92 | | |
73 | 93 | | |
| |||
125 | 145 | | |
126 | 146 | | |
127 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
128 | 169 | | |
129 | 170 | | |
130 | 171 | | |
| |||
193 | 234 | | |
194 | 235 | | |
195 | 236 | | |
196 | | - | |
| 237 | + | |
197 | 238 | | |
198 | 239 | | |
199 | 240 | | |
| |||
256 | 297 | | |
257 | 298 | | |
258 | 299 | | |
259 | | - | |
| 300 | + | |
260 | 301 | | |
261 | 302 | | |
262 | 303 | | |
| |||
459 | 500 | | |
460 | 501 | | |
461 | 502 | | |
462 | | - | |
| 503 | + | |
463 | 504 | | |
464 | 505 | | |
465 | 506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
0 commit comments