Commit c00bf2e
committed
fix(runs): close findings from the session-wide review (M-1 + L-1/L-2/L-3)
Four findings from the final ~5-hour holistic review (zero CRITICAL/HIGH overall):
- M-1 (latent corruption): boot's fresh-number branch left a stale activeDbRunId
restored from the snapshot, so a later Save would updateRunOnFinish the WRONG
SQLite row. Null it when minting a fresh number (the reused branch keeps it —
the content-key match proves it belongs to that run).
- L-1: runRetestSkips now clears state.loadedReadonly — a retest mutates the
loaded run in place, so it's no longer read-only; an interrupted retest stays
resumable (and the run keeps its own number/dbRunId, so resume can't duplicate).
Makes loadRunIntoState's "cleared by Retest" contract true.
- L-2: boot run-number fallback uses Math.max(...numbers) instead of the last
array element — robust to index.runs reordering after delete+find-or-update,
matching latestRunNumber().
- L-3: /api/clear resets status='idle' so the wiped view isn't shown under a
stale stopped/error overlay.
Reviewed: safe to commit, no CRITICAL/HIGH/MEDIUM. Test suite green (188/31/45/35).1 parent 140cd36 commit c00bf2e
2 files changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
1263 | 1268 | | |
1264 | 1269 | | |
1265 | 1270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1140 | 1140 | | |
1141 | 1141 | | |
1142 | 1142 | | |
1143 | | - | |
| 1143 | + | |
1144 | 1144 | | |
1145 | 1145 | | |
1146 | 1146 | | |
| |||
1160 | 1160 | | |
1161 | 1161 | | |
1162 | 1162 | | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1163 | 1169 | | |
1164 | 1170 | | |
1165 | 1171 | | |
| |||
2744 | 2750 | | |
2745 | 2751 | | |
2746 | 2752 | | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
2747 | 2756 | | |
2748 | 2757 | | |
2749 | 2758 | | |
| |||
0 commit comments