Commit 140cd36
committed
fix(db,runs): loop-failure error_logs fallback + don't delete a shared run log
Two MEDIUM findings from the bug hunt:
- Public failure-drawer empty for continuous-loop failures: loop runs persist per
node ONLY to batch_results (not results/error_logs), so getNodeErrors — which
queries error_logs⋈results with a results-table fallback — returned nothing for
a loop-only failure, violating the failure-log MUST. Add a second fallback that
synthesizes a failure entry from the most recent failed batch_results row (it
stores error + error_code). Same shape/aliases as the other queries; failed-only
(actual_mbps IS NULL OR error_code IS NOT NULL); no schema migration needed.
- deleteRun could purge a raw audit-*.log still referenced by ANOTHER saved run
(resume reuses one log file across passes). Guard the delete with sharedByOther
= index.runs.some(r => r.auditLog === entry.auditLog) (index.runs is post-splice)
so a shared log isn't deleted out from under another run's Live Log.
Adversarially reviewed (runtime-verified against a live schema): columns exist via
migrations, shape parity with the primary/results queries, failed-only filter,
post-splice some() check correct. No TEST RUN paths touched. Test suite green
(188/31/45/35).1 parent d24c87b commit 140cd36
2 files changed
Lines changed: 41 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
1157 | | - | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1158 | 1192 | | |
1159 | 1193 | | |
1160 | 1194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
961 | 961 | | |
962 | 962 | | |
963 | 963 | | |
964 | | - | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
965 | 970 | | |
966 | 971 | | |
967 | 972 | | |
| |||
0 commit comments