Repository navigation
Commit 4b3d007
committed
fix(config): stop a discarded write from retiring a current one
CodeRabbit review comment 4454293128 (Functional Correctness, Minor) against ec8850b. It
held: the rejection handler called retireWrite() before checking the generation, so a write
issued before resetAllState() decremented the in-flight count of writes issued after it.
The next landing for that key then saw no writes running and copied its value into the
mirror while a newer write was still pending.
The generation check now comes first in the rejection handler - a discarded write reports
its failure and leaves the current generation bookkeeping alone - which also made the
second belongsToCurrentState() inside the restore condition redundant, so that one was
removed rather than kept as untestable code.
Test (47/47 in ContextProxy.spec.ts): a rejected pre-reset write must not retire one of two
newer writes, so the older of the newer writes may not decide the mirror while the newest
is still in flight.
Sweep over the handler: 5 of 6 mutants killed (stale rejection still retires a write, any
rejection rolls the mirror back, a pre-reset write may land after the reset, landing never
repairs the mirror, rejection leaves the write in flight). The survivor is unchanged and
still disclosed: dropping writeSequences.clear() from resetAllState is not observable
because the generation guard already ignores that settlement.
Regressions: full unit suite 58 failed / 12008 passed (12007 before), 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 ec8850b commit 4b3d007
2 files changed
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
433 | 440 | | |
434 | 441 | | |
435 | 442 | | |
| |||
439 | 446 | | |
440 | 447 | | |
441 | 448 | | |
442 | | - | |
| 449 | + | |
443 | 450 | | |
444 | 451 | | |
445 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
682 | 715 | | |
683 | 716 | | |
684 | 717 | | |
| |||
0 commit comments