LOW: applyMigration deferred rollback skipped when Commit() fails #125
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
In
internal/database/migrations.go,applyMigrationhas:When
Commit()fails, the error is stored incommitErr, noterr. The deferred function checkserr, which is nil (from the last successful ExecContext). SoRollback()is never called.Impact
In practice, SQLite automatically rolls back failed commits, so data integrity is maintained. However, this is incorrect Go transaction handling and could cause issues with other database drivers or future changes.
Fix
Assign the commit error back to
err: