Commit 04ac019
committed
fix: 3 edge cases -- clear stale include_paths, invalidate dep cache, sanitize corrupt DB data
Adversarial review found 3 bugs:
1. CRITICAL: Re-indexing full repo didn't clear old include_paths.
if include_paths was truthy before save, re-index with None skipped
the DB update. Now ALWAYS writes include_paths (None clears it).
2. HIGH: Stale dep cache after re-index with different include_paths.
Dependency cache persisted across re-indexes. Now clear_file_dependencies
runs at start of every re-index so graph rebuilds with new include_paths.
3. MEDIUM: Corrupt jsonb from DB (e.g. [123, null]) crashed Path().parts.
build_dependency_graph now filters non-string entries and falls back to
full scan if all entries are invalid.
3 new tests:
- test_include_paths_with_corrupt_data: mixed valid/invalid entries
- test_include_paths_all_corrupt_scans_everything: all invalid -> full scan
- test_include_paths_empty_list_scans_everything: [] same as None1 parent 65d19e2 commit 04ac019
3 files changed
Lines changed: 41 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
609 | 612 | | |
610 | 613 | | |
611 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
145 | 151 | | |
146 | 152 | | |
147 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
283 | 311 | | |
284 | 312 | | |
285 | 313 | | |
| |||
0 commit comments