Description
cmd/init.go and cmd/save.go both call database.Exec(...) and discard
the returned error:
// init.go
database.Exec(`CREATE TABLE IF NOT EXISTS snapshots (...)`)
// save.go
database.Exec(
"INSERT INTO snapshots(id, message, path) VALUES (?, ?, ?)",
id, saveMessage, path,
)
fmt.Println("Snapshot saved:", id)
If the INSERT fails for any reason (locked DB, disk full, schema issue),
save.go still prints Snapshot saved: <id> — the user believes the
snapshot is recorded, but eko history / eko restore will never find it,
even though the file tree under .eko/snapshots/<id>/ was actually written.
Suggested fix
Check the error from every Exec call and surface it:
if _, err := database.Exec(...); err != nil {
return fmt.Errorf("failed to record snapshot: %w", err)
}
Description
cmd/init.goandcmd/save.goboth calldatabase.Exec(...)and discardthe returned error:
If the
INSERTfails for any reason (locked DB, disk full, schema issue),save.gostill printsSnapshot saved: <id>— the user believes thesnapshot is recorded, but
eko history/eko restorewill never find it,even though the file tree under
.eko/snapshots/<id>/was actually written.Suggested fix
Check the error from every
Execcall and surface it: