Repository navigation
Commit b15f32d
committed
allocate edit session numbers monotonically across a recovery
Row 4505376427 (DiffViewProvider.ts:655). Allocation and installation were the same number:
open() advanced the field and attemptRollbackRecovery() assigned the recovered record's older
value into it, with only the acquisition-rejection path putting the previous value back. A
settled recovery therefore left the provider holding an earlier attempt's stamp, and the next
open() re-issued a number a retained record already held. Path and edit type say nothing about
which attempt a record describes - a retry reopens the same file as the same kind of edit - so
the settled-acquisition comparison accepted that record against the new install and rolled the
newer edit back with the older attempt's baseline while reporting a successful recovery.
Allocation now has its own counter that nothing but open() writes: an install wears a stamp and
a recovery may wear an older one, and neither puts a number back into circulation. The guards
themselves are unchanged - same fields, same comparison, same refusal - only the source of the
stamp moved.
The test runs two attempts at one file, rolls the first back through its record, opens the file
a third time and asserts the new install keeps its edit when the second attempt record is
offered back: the recovery refuses, and nothing is restored or saved out of the live edit.
Control: with the previous head's file installed the third open re-issues the number - the
assertion fails as expected 2 to be greater than 2 - and restoring the fix is byte-equal.
Focused suite at this change: 109 passed.
Local Stryker preflight before this push: not run.1 parent 8b95a8e commit b15f32d
2 files changed
Lines changed: 77 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
121 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
132 | 140 | | |
133 | 141 | | |
134 | 142 | | |
135 | | - | |
| 143 | + | |
| 144 | + | |
136 | 145 | | |
137 | 146 | | |
138 | 147 | | |
| |||
681 | 690 | | |
682 | 691 | | |
683 | 692 | | |
| 693 | + | |
| 694 | + | |
684 | 695 | | |
685 | 696 | | |
686 | 697 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2986 | 2986 | | |
2987 | 2987 | | |
2988 | 2988 | | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
2989 | 3054 | | |
2990 | 3055 | | |
2991 | 3056 | | |
| |||
0 commit comments