fix: preserve snapshots across repeated and colliding backups - #39
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 9:12 PM ET / September 13, 2026, 01:12 UTC (Revision 2). ClawSweeper reviewWhat this changesPreserves SQLite backup snapshots through unique private directories, filesystem-aware filename selection, crawler-ID encoding, failure cleanup, and regression coverage. Merge readiness✅ Ready for maintainer review The fix remains necessary: current main and v0.4.2 retain the overwrite behavior. The patch is focused, the supplied runtime results cover its intended behavior, and no blocking defect was found. Priority: P2 Review scores
Verification
How this fits togetherCrawlBar’s CLI and Settings send crawler-reported archive paths to a shared backup service. That service runs SQLite snapshots and returns their directory and file paths to callers. flowchart TD
A[Crawler archive status] --> B[CLI or Settings backup]
B --> C[Select local databases]
C --> D[Create unique private directory]
D --> E[Choose filenames and snapshot SQLite]
E --> F{All snapshots succeeded?}
F -->|Yes| G[Return backup paths]
F -->|No| H[Remove incomplete directory]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep backup allocation and cleanup in the shared service, preserve completed archives, and retain returned paths as the supported caller contract. Do we have a high-confidence way to reproduce the issue? Yes: main’s timestamp-only allocation and destination removal establish how same-second backups overwrite prior snapshots; case-only names also collide on case-insensitive storage. This review inspected source without executing a reproduction. Is this the best way to solve the issue? Yes: operation-local allocation and filesystem-aware collision checks repair the existing service without a competing backup path or new user configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cfe0670b6a10. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
What Problem This Solves
Backups taken within one second could overwrite an earlier snapshot. Archive filenames differing only by case could overwrite each other on the destination filesystem. Unusual crawler IDs could escape the backup root, and failed multi-database runs left partial snapshots.
User Impact
Each backup preserves previous snapshots and every selected archive, uses private directories/files, and removes its own incomplete output on failure. Compatibility: new directory names include a random suffix and encode unusual crawler IDs; callers should use the returned
directoryandfilespaths.Why This Change Was Made
Allocate an exclusive directory per operation, choose filenames against the actual destination filesystem, and keep cleanup scoped to that directory. Archive selection remains unchanged. The regression suite fixes time explicitly and checks completed snapshot contents, path containment, case collisions, permissions, and failure cleanup.
Evidence
backup --app <synthetic-id> --json, real SQLite fixtures, before/after:../crawler IDThe existing iMessage source-selection fixture now records the source and runs real SQLite, retaining all its assertions and verifying a usable archive snapshot. No tests were removed or weakened.
Isolated Codex autoreview at P0–P2: scoped-clean.
Combined backup/CLI candidate: the final packaged helper passes both the CLI contract suite and every backup preservation/containment/permission check; strict signature and icon checks pass.