fix(db): WAL-safe safety backup + tests for validate-first and zip-traversal guard

This commit is contained in:
2026-07-02 06:45:17 +00:00
parent 7edd0a1265
commit 280b3d25ec
2 changed files with 31 additions and 1 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ def restore_db_and_waveforms(db_path: Path, waveform_root: Path,
if db_path.exists():
ts = datetime.datetime.utcnow().strftime("%Y%m%d_%H%M%S")
safety = db_path.with_name(f"{db_path.name}.pre-restore-{ts}")
shutil.copy2(db_path, safety)
snapshot_db(db_path, safety)
safety_name = safety.name
# Clear the OUTGOING db's WAL sidecars so they cannot attach to the incoming file.