deleteSnapshotFromLocalDB silently swallows all errors and always returns nil #25

Open
opened 2026-02-08 21:01:07 +01:00 by clawbot · 0 comments
Collaborator

Bug

deleteSnapshotFromLocalDB in internal/vaultik/snapshot.go logs errors but always returns nil, even when every operation fails. Callers (including PurgeSnapshots and PruneDatabase) assume success and proceed, potentially leaving the database in an inconsistent state.

func (v *Vaultik) deleteSnapshotFromLocalDB(snapshotID string) error {
    // ... all errors are logged but swallowed ...
    return nil
}

Impact

  • PurgeSnapshots reports successful deletion even when the database still contains the snapshot
  • RemoveSnapshot tells the user the snapshot was removed when it may not have been
  • Remote metadata could be deleted while local records persist, causing sync inconsistencies

Fix

Return the first error encountered instead of swallowing all errors.

## Bug `deleteSnapshotFromLocalDB` in `internal/vaultik/snapshot.go` logs errors but always returns `nil`, even when every operation fails. Callers (including `PurgeSnapshots` and `PruneDatabase`) assume success and proceed, potentially leaving the database in an inconsistent state. ```go func (v *Vaultik) deleteSnapshotFromLocalDB(snapshotID string) error { // ... all errors are logged but swallowed ... return nil } ``` ## Impact - `PurgeSnapshots` reports successful deletion even when the database still contains the snapshot - `RemoveSnapshot` tells the user the snapshot was removed when it may not have been - Remote metadata could be deleted while local records persist, causing sync inconsistencies ## Fix Return the first error encountered instead of swallowing all errors.
clawbot self-assigned this 2026-02-08 21:01:07 +01:00
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#25
No description provided.