Fix remaining audit findings (bugs.md sweep) #27
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/audit-remainder"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Second pass over tmp/bugs.md after PRs #18-#26. Fixes every remaining confirmed BUG/RISK/SECURITY finding across propagation core, weather clients, auth, workers, terrain/radio/import, the Rust grid worker, and test hygiene.
Highlights:
make precommit green (format, tsc, tests 5015, deps.unlock, credo --strict, xref). cargo clippy -D warnings + cargo test clean.
🤖 Skippy PR review
1 finding — none blocking.
lib/microwaveprop/terrain/srtm.ex:47.tmp.SRTM tiles have no sweeperReviewed
9c390a760569. Commentskippy reviewto re-run.@ -44,0 +44,4 @@# pods on NFS) never observe a partially-written tile; a stray# .tmp file is ignored by readers and overwritten next time.tmp = path <> ".tmp." <> unique_suffix()File.write!(tmp, decompressed)🔵 Suggestion — Orphaned
.tmp.SRTM tiles have no sweeperThe unique suffix means a
.tmp.file is never reused, so a failedFile.write!/File.rename!or a pod killed between the two lines leaves a full-size partial tile (up to ~26 MB for SRTM1) in the tiles dir forever. Nothing prunessrtm_tiles_dir— the.tmp.*sweeper inScoreStoreonly walks the scores/profiles/scalar trees — andCanopy.BulkFetch, fixed in this same PR, uses a fixed.partname that the next run overwrites, so this path is the odd one out (the comment above claims the file is "overwritten next time", which the unique suffix prevents). Fix: use a fixedpath <> ".part"name like canopy does, or wrap the write+rename in try/after withFile.rm(tmp)on failure.Resolved 1 of 1 earlier findings:
Srtm.prune_tmp_files/2plus the sweep inPropagationPruneWorker(15 min cron, 1 h age gate) covers the orphaned.tmp.tiles, so the leak I flagged atsrtm.ex:47is closed. 0 still open. Nothing new in9c390a76..920ce623.Non-blocking: the comment at
srtm.ex:45-47still says a stray.tmpfile is "overwritten next time" - the unique suffix prevents that, and it is now the sweeper that removes it. Reword when you next touch the file so nobody deletes the sweep as redundant.