ListSnapshots has destructive side effect: deletes local snapshots not in remote #15

Open
opened 2026-02-08 17:16:27 +01:00 by clawbot · 0 comments
Collaborator

In snapshot.go ListSnapshots(), listing snapshots silently deletes local snapshot records that are not found in remote storage:

// Remove local snapshots that don't exist remotely
for _, snapshot := range localSnapshots {
    if !remoteSnapshots[snapshotIDStr] {
        // ... deletes from local DB
    }
}

A list/read operation should not have destructive side effects. This sync behavior should be a separate explicit operation (e.g. vaultik sync), or at minimum clearly documented and logged prominently.

Ref: parent issue #1

In `snapshot.go` `ListSnapshots()`, listing snapshots silently deletes local snapshot records that are not found in remote storage: ```go // Remove local snapshots that don't exist remotely for _, snapshot := range localSnapshots { if !remoteSnapshots[snapshotIDStr] { // ... deletes from local DB } } ``` A list/read operation should not have destructive side effects. This sync behavior should be a separate explicit operation (e.g. `vaultik sync`), or at minimum clearly documented and logged prominently. Ref: parent issue #1
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/vaultik#15
No description provided.