fix: remove destructive sync from ListSnapshots #49

Merged
sneak merged 1 commits from fix/list-snapshots-no-destructive-side-effect into main 2026-03-19 09:32:53 +01:00

1 Commits

Author SHA1 Message Date
clawbot
a36b314c79 fix: remove destructive sync from ListSnapshots
All checks were successful
check / check (pull_request) Successful in 4m8s
ListSnapshots() silently deleted local snapshot records not found in
remote storage. A list/read operation should not have destructive side
effects.

Changes:
- Remove the inline deletion loop from ListSnapshots() that deleted
  local snapshots not present in remote storage
- Update syncWithRemote() to use deleteSnapshotFromLocalDB() for
  proper cascade cleanup (deleting snapshot_files, snapshot_blobs,
  and snapshot_uploads before the snapshot record itself)

The sync behavior remains available via syncWithRemote(), which is
called explicitly by PurgeSnapshots().

closes #15
2026-03-18 16:28:34 -07:00