Repository navigation
Commit 41832ac
committed
fix(file-safety): fall back to the link walk only on a dangling link
resolveLockKey caught every resolution error and fell back to the
bounded readlink walk, so a transient EACCES or EIO from realpath or
lstat keyed the write to the alias path while a writer reaching the
referent directly keyed the referent - two locks for one file, and the
alias/referent serialization the unit promises did not hold. Only
ENOENT (the dangling-link case the walk exists for) now falls through;
every other error propagates, matching resolvePublishTarget's own
policy. Regression test: EACCES from realpath rejects resolveLockKey
instead of returning an alias key; removing the guard reddens exactly
that test.
Also restore the rename/unlink/console spies in a finally block in the
cleanup-safety test: a failed assertion previously left the spies
active for the afterEach rm and every later test.1 parent 6953d6b commit 41832ac
2 files changed
Lines changed: 38 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
303 | 310 | | |
304 | 311 | | |
305 | 312 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
173 | 190 | | |
174 | 191 | | |
175 | 192 | | |
| |||
186 | 203 | | |
187 | 204 | | |
188 | 205 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
197 | 219 | | |
0 commit comments