Repository navigation
Commit c61e97b
committed
fix(config): report what landed when the last write standing for a key rejects
CodeRabbit pre-merge check Persistence Integrity on e265d53. The scenario it names held:
with persisted S and three writes A, B, C for one key, let C reject first, A land next and B
reject last. C is the newest issued, so the mirror correctly fell back to S; A landed but was
not the last write running, so it only advanced the rollback record; B rejected while being
the last write standing, but it was not the newest issued, so nothing corrected the mirror.
Storage held the value A landed and the cache kept reporting S.
The rejection handler now takes the result of retireWrite() and restores the newest persisted
value in either case: the rejection was the newest write issued for the key, or nothing is in
flight for that key any more. Landing behaviour is unchanged.
Test: keeps the landed value when the last write standing for the key rejects - the exact
three-write order above, asserting the intermediate fallback to S as well as the final value,
through getGlobalState() and getValues().
Sweep over the handler: 7 of 8 mutants killed (stale last-standing rejection keeps the stale
mirror, newest rejection not rolled back, any rejection rolls the mirror back, landed write
recorded only when last standing, stale rejection still retires a write, pre-reset write may
land after the reset, landing never repairs the mirror). The survivor is unchanged: dropping
writeSequences.clear() from the reset is not observable behind the generation guard.
ContextProxy.spec.ts 49/49. Full unit suite 58 failed / 12010 passed, same 15 pre-existing
Windows failures. check-types 114 pre-existing errors, none in a touched file. ESLint exits 0
with --max-warnings=0; eslint-suppressions.json untouched.1 parent e265d53 commit c61e97b
2 files changed
Lines changed: 46 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
447 | 448 | | |
448 | 449 | | |
449 | | - | |
| 450 | + | |
450 | 451 | | |
451 | 452 | | |
452 | 453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
333 | 370 | | |
334 | 371 | | |
335 | 372 | | |
| |||
0 commit comments