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(snapshotIDstring)error{// ... all errors are logged but swallowed ...returnnil}
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
přiřadil/a sobě toto 2026-02-08 21:01:07 +01:00
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.
Bug
deleteSnapshotFromLocalDBininternal/vaultik/snapshot.gologs errors but always returnsnil, even when every operation fails. Callers (includingPurgeSnapshotsandPruneDatabase) assume success and proceed, potentially leaving the database in an inconsistent state.Impact
PurgeSnapshotsreports successful deletion even when the database still contains the snapshotRemoveSnapshottells the user the snapshot was removed when it may not have beenFix
Return the first error encountered instead of swallowing all errors.