This only deletes the snapshots row. The snapshot_files, snapshot_blobs, and uploads rows are NOT deleted first. Depending on FK constraints, this may either fail (FK violation) or leave orphaned records.
Compare with ListSnapshots() which correctly deletes related records first, and deleteSnapshotFromLocalDB() which also handles this.
In `snapshot.go` `syncWithRemote()`, local snapshots not found in remote are deleted with just:
```go
if err := v.Repositories.Snapshots.Delete(v.ctx, snapshotIDStr); err != nil {
```
This only deletes the `snapshots` row. The `snapshot_files`, `snapshot_blobs`, and `uploads` rows are NOT deleted first. Depending on FK constraints, this may either fail (FK violation) or leave orphaned records.
Compare with `ListSnapshots()` which correctly deletes related records first, and `deleteSnapshotFromLocalDB()` which also handles this.
Ref: parent issue #1
Closing: this is no longer an issue. PR #44 and PR #46 added ON DELETE CASCADE to all relevant FKs, and FK enforcement is enabled (PRAGMA foreign_keys = ON). Deleting a snapshot row now automatically cascades to delete related snapshot_files, snapshot_blobs, and uploads rows. The explicit cleanup in deleteSnapshotFromLocalDB() is redundant belt-and-suspenders. sneak closed PR #47 as unnecessary for the same reason.
Closing: this is no longer an issue. [PR #44](https://git.eeqj.de/sneak/vaultik/pulls/44) and [PR #46](https://git.eeqj.de/sneak/vaultik/pulls/46) added `ON DELETE CASCADE` to all relevant FKs, and FK enforcement is enabled (`PRAGMA foreign_keys = ON`). Deleting a snapshot row now automatically cascades to delete related `snapshot_files`, `snapshot_blobs`, and `uploads` rows. The explicit cleanup in `deleteSnapshotFromLocalDB()` is redundant belt-and-suspenders. sneak closed [PR #47](https://git.eeqj.de/sneak/vaultik/pulls/47) as unnecessary for the same reason.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In
snapshot.gosyncWithRemote(), local snapshots not found in remote are deleted with just:This only deletes the
snapshotsrow. Thesnapshot_files,snapshot_blobs, anduploadsrows are NOT deleted first. Depending on FK constraints, this may either fail (FK violation) or leave orphaned records.Compare with
ListSnapshots()which correctly deletes related records first, anddeleteSnapshotFromLocalDB()which also handles this.Ref: parent issue #1
Closing: this is no longer an issue. PR #44 and PR #46 added
ON DELETE CASCADEto all relevant FKs, and FK enforcement is enabled (PRAGMA foreign_keys = ON). Deleting a snapshot row now automatically cascades to delete relatedsnapshot_files,snapshot_blobs, anduploadsrows. The explicit cleanup indeleteSnapshotFromLocalDB()is redundant belt-and-suspenders. sneak closed PR #47 as unnecessary for the same reason.